You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

OCI: How To Migrate Iptables Firewall Rules to a New Server

Applies to

Oracle Cloud Infrastructure -

Linux OS


Goal

How to easily copy your active iptables rule set from one server to another.


Solution

To migrate your iptables firewall rules from the old server to the new one, perform steps below :

1. On the old server, export the iptables rules to a file by running the command:

$ iptables-save > iptables

2. Transfer the file "iptables” to the new server.

3. On the new server, to make sure the iptables rules persist post reboot, then install iptables-service and enable the service with command :  

$ yum install iptables-services 
$ systemctl enable --now iptables.service 

4. Import the iptables rules :

$ iptables-restore < iptables

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!