-2

I want to change the destination port of the ipv6 packet in the INPUT level.

So I tried to use ip6tables with nat in the INPUT level

but seems this command does not work

# ip6tables -t nat -I INPUT ! -i br0 -p TCP --dport 8080 -j REDIRECT --to-ports 80
ip6tables v1.2.7a: Unknown arg `--to-ports'
Try `ip6tables -h' or 'ip6tables --help' for more information.

I think beside the error returned by iptable, I think that nat is not working in the INPUT level.

So are there a solution to change the destination port of the ipv6 packet in the INPUT level?

I do not want to change it in the PREROUTING level since I do not want change the ipv6 packet that will be forwarded (not for loacal process)

MOHAMED
  • 151
  • 7

1 Answers1

2

Try something along the lines of this:

ip6tables -t nat -A PREROUTING -p tcp --dport 8080 -j REDIRECT --to-port 80

Your packet would not be hitting the INPUT chain for the nat table. Incoming packets go through iptables like so:

On the wire -> raw:PREROUTING -> mangle:PREROUTING -> nat:PREROUTING - > routing decision -> mangle:INPUT -> filter:INPUT -> Daemon

PersianGulf
  • 596
  • 6
  • 21
nubzzz
  • 21
  • 2