Question

Comment puis-je rediriger un port à un autre local en utilisant ip6tables? par exemple. quelque chose comme ça : ip6tables -t nat -A PREROUTING -j REDIRECT -p tcp --dport 443 --to-ports 8443

Était-ce utile?

La solution

ip6tables ne supporte pas REDIRECT. (Les gens utilisent normalement ce dans un environnement NAT et NAT est généralement pas pris en charge avec IPv6.)

Si tout ce que vous devez faire est de se lier au port bas en tant qu'utilisateur normal, pourquoi ne pas essayer la solution de contournement décrite dans cette réponse ? Bien sûr, dans le cas de Tomcat, il semble que cela signifierait donner tout processus Java cette capacité.

Autres conseils

Eh bien, c'est une vieille question, mais depuis que je dois faire la même chose ... Voici ce que j'ai trouvé:

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.)

Ceci est valable pour ip6tables seulement, bien sûr. Donc je suppose que ceci est valable:

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

Cependant, je ne l'ai pas essayé encore.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top