Guest User

Untitled

a guest
Dec 14th, 2017
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
  2. service iptables save
  3. service iptables restart
  4.  
  5. iptables -L
  6.  
  7. Chain INPUT (policy ACCEPT)
  8. target prot opt source destination
  9.  
  10. Chain FORWARD (policy ACCEPT)
  11. target prot opt source destination
  12.  
  13. Chain OUTPUT (policy ACCEPT)
  14. target prot opt source destination
  15.  
  16. iptables --table nat --list
  17.  
  18. iptables -t nat -L
  19.  
  20. iptables -vL -t filter
  21. iptables -vL -t nat
  22. iptables -vL -t mangle
  23. iptables -vL -t raw
  24. iptables -vL -t security
  25.  
  26. # iptables-save > iptables_bckp
  27. # vim iptables_bckp
  28. # iptables-restore < iptables_bckp
  29.  
  30. iptables -t nat -L
  31.  
  32. #!/bin/bash
  33.  
  34. echo "Filter table:"
  35. iptables -t filter -L
  36.  
  37. echo "Nat table:"
  38. iptables -t nat -L
  39.  
  40. echo "Mangle table:"
  41. iptables -t mangle -S
  42.  
  43. echo "Raw table:"
  44. iptables -t raw -S
  45.  
  46. echo "Security table:"
  47. iptables -t security
  48.  
  49. echo
  50. echo "All rules in all tables printed"
  51.  
  52. # lsmod | grep ip_tables
  53. ip_tables 13193 4 iptable_raw,iptable_mangle,iptable_nat,iptable_filter
Add Comment
Please, Sign In to add comment