User Tools

Site Tools


tinctunnel

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
tinctunnel [2020/07/16 08:08] neoontinctunnel [2020/07/16 12:16] neoon
Line 9: Line 9:
   ip route add default via 10.0.0.1 table TUNNEL   ip route add default via 10.0.0.1 table TUNNEL
      
-**Forward traffic on the gateway** +**Forward traffic to specific IP** (Server) 
-  # Masquerade outgoing traffic+  iptables -t nat -A POSTROUTING -s 10.0.0.0/24 ! -o tun+ -j SNAT --to-source xxx.xxx.xxx.xxx 
 +  iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE 
 +  echo 1 > /proc/sys/net/ipv4/ip_forward     
 +**Forward traffic via default gateway** (Server)
   iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE   iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
   iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE   iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE
-  # Allow return traffic +  echo 1 > /proc/sys/net/ipv4/ip_forward
-  iptables -A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT +
-  iptables -A INPUT -i tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT +
-  # Forward everything +
-  iptables -A FORWARD -j ACCEPT+
      
 **Test it** **Test it**
tinctunnel.txt · Last modified: 2021/11/25 22:42 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki