goez

partial iptables script

Mar 18th, 2011
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. # Always accept loopback traffic
  2. $IPTABLES -A INPUT -i lo -j ACCEPT
  3.  
  4. # Allow established connections
  5. $IPTABLES -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
  6.  
  7. # fowarding
  8. $IPTABLES -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
  9. # Allow outgoing connections from the LAN side.
  10. $IPTABLES -A FORWARD -i eth1 -o eth0 -j ACCEPT
  11.  
  12. # Masquerade.
  13. $IPTABLES -t nat -A POSTROUTING -o eth0 -j MASQUERADE
  14.  
  15. # Enable routing.
  16. echo 1 > /proc/sys/net/ipv4/ip_forward
Advertisement
Add Comment
Please, Sign In to add comment