New answers tagged tunneling
iptables -t nat -A PREROUTING -p tcp --dport <origin-port> -j REDIRECT --to-port <destination-port> service iptables save service iptables restart
I seem to have found the problem: I needed to compute the IPv4 header checksum for the incoming packets before writing them to the TUN interface, since I modify them.
You will need both sets of rules within iptables. The two rulesets ensure that traffic leaving by the specified interfaces is appropriately masqueraded. Here is my suggestion, which is a little simpler than yours: # Masquerade outgoing traffic iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE # Allow ...
The handy tool is to list existing rules with line-numbers: iptables --line-numbers -t filter -L FORWARD You could delete the rules with -D option: iptables -t filter -D FORWARD 1 You could insert a new rule at specified location with -I option: iptables -t filter -I FORWARD 0 blah-blah-blah this would insert a new rule at the very beginning of a ...
Top 50 recent answers are included