Set up a firewall

From LinuxIntro
Jump to: navigation, search

To set up a firewall use iptables:

echo "1" > /proc/sys/net/ipv4/ip_forward 
/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE 
/sbin/iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j
TCPMSS --clamp-mss-to-pmt 
/sbin/iptables -A INPUT -i ppp0 -m state --state ESTABLISHED,
RELATED -j ACCEPT

See also