User Tools

Site Tools


iptables:save_iptable_rules

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
iptables:save_iptable_rules [2016/10/07 11:07] peteriptables:save_iptable_rules [2019/11/29 17:43] (current) – removed peter
Line 1: Line 1:
-====== IPTables - Save IPTable rules ====== 
- 
-===== Save the iptables rules ===== 
- 
-The generic method of saving iptables rules is to use the command **iptables-save**, which writes to stdout. 
- 
-<code bash> 
-iptables-save > /etc/network/iptables.rules 
-</code> 
- 
- 
- 
-===== Restore the iptables rules ===== 
- 
-The output created by **iptables-save** can then by read on stdin by **iptables-restore**.  
- 
-If on a server, without NetworkManager, a common approach is then to use a **pre-up** command in /etc/network/interfaces. 
- 
-<file /etc/network/interfaces> 
-iface eth0 inet static 
-        .... 
-        pre-up iptables-restore < /etc/network/iptables.rules 
-</file> 
- 
- 
-**NOTE**:  Do note that the commands iptables, **iptables-save** and **iptables-restore** are IPv4 only. For IPv6 traffic the equivalent commands are ip6tables, **ip6tables-save** and **ip6tables-restore**. 
  
iptables/save_iptable_rules.1475838448.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki