Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # kernel ip_forward
- echo 1 > /proc/sys/net/ipv4/ip_forward
- # Flush
- iptables -F INPUT
- iptables -F OUTPUT
- iptables -F FORWARD
- iptables -t nat -F
- iptables -t nat -P PREROUTING ACCEPT
- iptables -t nat -P POSTROUTING ACCEPT
- iptables -t nat -P OUTPUT ACCEPT
- # Forwarding:
- iptables -A FORWARD -p ALL -i eth0 -j ACCEPT
- iptables -A FORWARD -i wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT
- # Masquerading
- iptables -t nat -A POSTROUTING -o wlan0 -j SNAT --to-source 10.0.0.43
- iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement