2010-11-29 7 views

Respuesta

4

ip6tables no soporta REDIRECT. (Normalmente las personas usan esto en un entorno NAT, y NAT generalmente no es compatible con IPv6.)

Si todo lo que necesita hacer es vincularse al puerto bajo como usuario normal, ¿por qué no prueba la solución descrita en this answer? Por supuesto, en el caso de Tomcat, parece que esto significaría darle a cualquier proceso de Java esa capacidad.

+7

Al parecer 'v1.4.18 ip6tables' y soporte en el núcleo Linux v3.8' REDIRECT': https://sector7g.be/posts/ipv6-nat-pre-routing-with-iptables –

5

Bueno, esto es una cuestión de edad, pero ya que tengo que hacer lo mismo ... Esto es lo que he encontrado:

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

Esto es válido para ip6tables solamente, por supuesto. Así que supongo que esto es válido:

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

Sin embargo, yo no lo probé todavía.

+0

Usted encontrará que es más difícil que REDIRECT en IPv4 ... El TPROXY tiene un comportamiento especial en la tabla mangle, por lo que deberá usar marcas y un enrutamiento avanzado. –

+0

¿qué versión de filtro de red se necesita para "--on-ip"? ip6tables v1.4.8 (Empaquetado con Debian Squeeze) no funciona. Gracias por adelantado ! – int2000

+1

Después de una breve búsqueda en /usr/share/doc/iptables/changelog.Debian.gz en mi cuadro de prueba, parece que se ha incluido en 1.4.11.1-1, como se menciona en http: //bugs.debian. org/cgi-bin/bugreport.cgi? bug = 529954 –

Cuestiones relacionadas