質問

IP6tablesを使用して、あるポートを別のローカルポートにリダイレクトするにはどうすればよいですか?たとえば、このようなもの:ip6tables -t nat -a Prerouting -j Redirect -P TCP - DPORT 443-トーポーシス8443

役に立ちましたか?

解決

ip6tables サポートしていません REDIRECT. 。 (通常、人々はこれをNAT環境で使用し、NATは一般にIPv6ではサポートされていません。)

あなたがする必要があるのは、通常のユーザーとして低いポートにバインドするだけなら、で説明されている回避策を試してみませんか この答え?もちろん、Tomcatの場合、これはJavaプロセスにその能力を与えることを意味するように思えます。

他のヒント

まあこれは古い質問ですが、私は同じことをする必要があるので…ここに私が見つけたものがあります:

TPROXY

This target is only valid in the mangle table, in the PREROUTING chain and user-defined chains which are only called from this chain. It redirects the packet to a local socket without changing the packet header in any way. It can also change the mark value which can then be used in advanced routing rules. It takes three options:
--on-port port
    This specifies a destination port to use. It is a required option, 0 means the new destination port is the same as the original. This is only valid if the rule also specifies -p tcp or -p udp. 
--on-ip address
    This specifies a destination address to use. By default the address is the IP address of the incoming interface. This is only valid if the rule also specifies -p tcp or -p udp. 
--tproxy-mark value[/mask]
    Marks packets with the given value/mask. The fwmark value set here can be used by advanced routing. (Required for transparent proxying to work: otherwise these packets will get forwarded, which is probably not what you want.)

もちろん、これはIP6テーブルのみで有効です。だから私はこれが有効だと思います:

ip6tables -t mangle -A PREROUTING -p tcp --dport 443 -j TPROXY --on-port 8443

しかし、私はまだ試していません。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top