Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- PATH=/usr/sbin:/sbin:/bin:/usr/bin
- #
- #delete all existing rules.
- #
- iptables -F
- iptables -t Nat -F
- iptables -t mangle -F
- iptables -X
- # Alway accept loopback traffic
- iptables -A input -i lo -j ACCEPT
- #Allow established connections, and those not coming from the outside
- iptables -A input -m state --state ESTABLISHED,RELATED -j ACCEPT
- iptables -A input -m state --state NEW - ! eth0 -j ACCEPT
- iptables -A FORWARD -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
- #Allow outgoing connections from the lan side.
- iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
- iptables -A FORWARD -i eth2 -o eth0 -j ACCEPT
- iptables -A FORWARD -i eth3 -o eth0 -j ACCEPT
- iptables -A FORWARD -i eth4 -o eth0 -j ACCEPT
- iptables -A FORWARD -i wlan0 -o eth0 -j ACCPET
- #Masquerade
- iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
- #port forwarding (Currently disabled)
- iptables -A FORWARD -i eth0 -o eth0 -j REJECT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement