I have two separated networks and there is one computer that is in both of them.
I want to forward connections made to that computer on one port from one of the networks to a port on a specific computer in the other network.
I am able to do this in ipv4 by doing
sysctl -w net.ipv4.ip_forward=1
and adding the following rule to iptables
iptables -t nat -A PREROUTING -p tcp --dport 49000 -j DNAT --to-destination 192.168.2.1:49000
I have tried doing the same in ipv6 with
sysctl -w net.ipv6.conf.all.forwarding=1
and
ip6tables -t nat -A PREROUTING -p tcp --dport 49000 -j DNAT --to-destination [fc00::3]:49000
but it is not working.
Does anyone know why this doesn't work and what should I be doing instead?
UPDATE: The steps I explained here actually work. The problem was the way I was testing the ipv6 connectivity, my test was using a connection that only had an ipv4 address so it wasn't working. After assigning it an ipv6 address I realized the port forwarding was actually working.
-L -v
list); is the rule being hit at all? 2) Investigate using tcpdump or Wireshark, whether it really doesn't work at all or whether it does something else?