Toggle between client and router mode on network interface (Linux)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
532 B

6 years ago
  1. *filter
  2. :INPUT ACCEPT [0:0]
  3. :OUTPUT ACCEPT [0:0]
  4. :FORWARD ACCEPT [0:0]
  5. -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
  6. -A FORWARD -o eth0 -j ACCEPT
  7. -A FORWARD -o usb0 -j ACCEPT
  8. -A FORWARD -o wlan0 -j ACCEPT
  9. COMMIT
  10. *nat
  11. #:PREROUTING ACCEPT [0:0]
  12. #:POSTROUTING ACCEPT [0:0]
  13. ## Use this interface to route traffic from other interfaces to internet
  14. ## E.g. traffic from eth0 -> wlan0 -> internet
  15. -A POSTROUTING -o wlan0 -j MASQUERADE
  16. -A POSTROUTING -o eth0 -j MASQUERADE
  17. -A POSTROUTING -o usb0 -j MASQUERADE
  18. COMMIT