Advertisement
Guest User

Untitled

a guest
Dec 21st, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.55 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # kernel ip_forward
  4. echo 1 > /proc/sys/net/ipv4/ip_forward
  5.  
  6. # Flush
  7. iptables -F INPUT
  8. iptables -F OUTPUT
  9. iptables -F FORWARD
  10. iptables -t nat -F
  11. iptables -t nat -P PREROUTING ACCEPT
  12. iptables -t nat -P POSTROUTING ACCEPT
  13. iptables -t nat -P OUTPUT ACCEPT
  14.  
  15. # Forwarding:
  16. iptables -A FORWARD -p ALL -i eth0 -j ACCEPT
  17. iptables -A FORWARD -i wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT
  18.  
  19. # Masquerading
  20. iptables -t nat -A POSTROUTING -o wlan0  -j SNAT --to-source 10.0.0.43
  21. iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement