Article 6GM2G make offline iptables rule stick after reboot

make offline iptables rule stick after reboot

by
chrisknight
from LinuxQuestions.org on (#6GM2G)
Hi! I've got an older CentOS 6.10 box.
I cannot issue commands to this box while it is running, but I can boot it with Fedora Live and access the file system. I want to be able to add something like
"iptables -A INPUT -p tcp --dport 22 --source 192.168.3.0/24 -j ACCEPT" to "/etc/sysconfig/iptables" so I can SSH into it but when I do, it does not survive a boot/reboot. At the top it says "# Generated by iptables-save v1.4.7 on some date..." Where is the source for what iptables-save is populating on boot? Or how else can I make the rule survive a boot? I tried to add it into "/etc/rc.d/rc.local" but that didn't work.
Thanks!
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments