Changes between Version 3 and Version 4 of Iptables


Ignore:
Timestamp:
01/23/25 03:25:06 (4 weeks ago)
Author:
krit
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Iptables

    v3 v4  
    3737}}}
    3838For unblock just change -A to -D on the above command
     39
     40
     41== IP table src NAT
     42Ref [https://gist.github.com/tomasinouk/eec152019311b09905cd here]
     43
     44All packets leaving eth1 will change source IP to 192.168.20.1
     45{{{
     46iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to 192.168.20.1
     47}}}
     48
     49We save iptable as persistent rule when reboot
     50{{{
     51~]# apt install iptables-persistent
     52~]# iptables-save > /etc/iptables/rules.v4
     53OR
     54~]# ip6tables-save > /etc/iptables/rules.v6
     55~]# iptable -L -t nat
     56}}}