Operating System - Linux
1828834 Members
2466 Online
109985 Solutions
New Discussion

Changing IP of Linux IPtable Firewall.

 
walter crasto_1
Frequent Advisor

Changing IP of Linux IPtable Firewall.

Hi All,

I have the Redhat Linux IPtable firewall. Now want to change the IP of my whole internal network from 192.168.x.x series to 172.26.x.x series that will also change the IP of my firewall ethernet card & all the rule sets.
Can I simply change the IP of the exsiting firewall & reconfigured the rule set or I need to reinstall the OS.

Thanks in advance.

Regards

Walter
3 REPLIES 3
xyko_1
Esteemed Contributor

Re: Changing IP of Linux IPtable Firewall.

Hi Walter,

you don't have to reinstall the OS.

If you are changing IPs of your lan you just have to change the ip of the nic that is the interface with you lan and change all references of the old ip range to the new ip range into the firewall script. Pay attention also to all routes, static or not, that you may have configured on the server.

To change network configuration you may use redhat-config-network tool.

Hope it helps.
Xyko
Steven E. Protter
Exalted Contributor

Re: Changing IP of Linux IPtable Firewall.

You merely have to carefully go through the file /etc/sysconfig/iptables

Change the 192.168.x.x addresses to the appropriate 172.26.x.x

Keep a backup of the file as a reference.

service iptables restart

done with iptables.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
NiCK_76
Respected Contributor

Re: Changing IP of Linux IPtable Firewall.

Hi,walter crasto

You have not to reinstall OS. Logon system via console, edit file ifcfg-ethx in /etc/sysconfig/network-script to change ipaddress ,then perform "fdown ethx;if up ethx" to active it. Edit file iptables script ,such as /etc/sysconfig/iptables ,replace ip address 192.168.x.x to 172.26.x.x ,then restart the iptables service.

NiCK
just for fun