Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-06-2014, 06:11 AM
|
#1
|
LQ Newbie
Registered: Mar 2014
Posts: 4
Rep:
|
After rebooting CentOS /etc/sysconfig/iptables changed
Hi,
I am using CentOS 5.9 and I have added port to make it accessible in a LAN but when I reboot the file /etc/sysconfig/iptables always changed to original one .
Kindly let me know how may I save my changes to these file so that it could not change by system reboot.
Thanks!
|
|
|
03-06-2014, 06:22 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
generally you wouldn't edit it, you'd add it in the live iptables config, and then use iptables-save to write it back to file.
|
|
|
03-06-2014, 08:02 AM
|
#3
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep:
|
on my CentOS 5.10 hosts, I run
Code:
/sbin/iptables-save > /root/safe.rules
and in /etc/rc.local I use
Code:
iptables-restore /root/safe.rules
How to get that to occur on restart|reboot, I don't know...
|
|
|
03-06-2014, 08:16 AM
|
#4
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
oh, yes.... "/etc/init.d/iptables save" wraps the iptables-save command with the sysconfig file. that's what I'd forgotten.
|
|
|
03-06-2014, 10:37 AM
|
#5
|
LQ Veteran
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Rep:
|
|
|
|
03-07-2014, 04:34 AM
|
#6
|
LQ Newbie
Registered: Mar 2014
Posts: 4
Original Poster
Rep:
|
Thanks to all for replying. Now I am able to save my iptables policy.
Regards,
archi2092
|
|
|
All times are GMT -5. The time now is 06:41 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|