[SOLVED] save iptables reboot and the rules are lost!
[SOLVED] save iptables reboot and the rules are lost!
Hello,
I need some help! I have created some custom iptables rules on my Centos 6.4 64 bits server, at the end I have save the rules with "service iptables save"
If I make a reboot I lose all the rules
How can I make the iptables rules permanet?
Thank you
I need some help! I have created some custom iptables rules on my Centos 6.4 64 bits server, at the end I have save the rules with "service iptables save"
If I make a reboot I lose all the rules
How can I make the iptables rules permanet?
Thank you
[SOLVED] save iptables reboot and the rules are lost!
[quote]
msm25 wrote:
I have save the rules with "service iptables save"
[/quote]
That should do it. What do you have after reboot?
[code]chkconfig --list iptables
iptables -S[/code]
msm25 wrote:
I have save the rules with "service iptables save"
[/quote]
That should do it. What do you have after reboot?
[code]chkconfig --list iptables
iptables -S[/code]
-
- Posts: 4
- Joined: 2013/04/03 12:12:36
Re: save iptables reboot and the rules are lost!
Heya,
In /etc/sysconfig/iptables-config check for :
# Save current firewall rules on restart.
# Value: yes|no, default: no
# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets
# restarted.
IPTABLES_SAVE_ON_RESTART="yes"
Regards
Shaun Glass
In /etc/sysconfig/iptables-config check for :
# Save current firewall rules on restart.
# Value: yes|no, default: no
# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets
# restarted.
IPTABLES_SAVE_ON_RESTART="yes"
Regards
Shaun Glass
Re: save iptables reboot and the rules are lost!
[quote]shaunglass wrote:
In /etc/sysconfig/iptables-config check for :
IPTABLES_SAVE_ON_RESTART="yes"[/quote]
That makes no difference here. It merely calls
[code]service iptables save[/code]
before doing the restart. Besides, reboot does not call 'restart'; it wants to 'stop'.
In /etc/sysconfig/iptables-config check for :
IPTABLES_SAVE_ON_RESTART="yes"[/quote]
That makes no difference here. It merely calls
[code]service iptables save[/code]
before doing the restart. Besides, reboot does not call 'restart'; it wants to 'stop'.
Re: save iptables reboot and the rules are lost!
You want
IPTABLES_SAVE_ON_STOP="yes"
too
IPTABLES_SAVE_ON_STOP="yes"
too
Re: save iptables reboot and the rules are lost!
Hi,
IPTABLES_SAVE_ON_RESTART="yes"
IPTABLES_SAVE_ON_STOP="yes"
I have change them and after a reboot still loses the rules:
jlehtone,
[root@v ~]# chkconfig --list iptables
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@ ~]#
IPTABLES_SAVE_ON_RESTART="yes"
IPTABLES_SAVE_ON_STOP="yes"
I have change them and after a reboot still loses the rules:
jlehtone,
[root@v ~]# chkconfig --list iptables
iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@ ~]#
Re: save iptables reboot and the rules are lost!
Not loading rules at all. Do
[code]chkconfig iptables on[/code]
then reboot or just 'service iptables start'.
[code]chkconfig iptables on[/code]
then reboot or just 'service iptables start'.
Re: [SOLVED] save iptables reboot and the rules are lost!
jlehtone,
thank you so much! it idid work!
thank you so much! it idid work!
-
- Posts: 1
- Joined: 2015/02/28 13:58:44
Re: [SOLVED] save iptables reboot and the rules are lost!
Hi,
I do search from google for this question, this post is the only way that I saw the question is solved.
I follow the suggestions that mentioned previously.
But after shutdown -r now, current iptables rule disappear.
Here is what I do:
1.
iptables -I INPUT -p tcp --dport 3128 -j ACCEPT
2.
Edit
IPTABLES_SAVE_ON_RESTART="yes"
IPTABLES_SAVE_ON_STOP="yes"
in /etc/sysconfig/iptables-config
3.
service iptables save
chkconfig iptables on
4.
shutdown -r now
then I can't connect via 3128 port which is what my client computer want to connect my proxy server with port 3128.
I have to manually enter iptables -I INPUT -p tcp --dport 3128 -j ACCEPT again,
where did I go wrong?
faulkhuang
I do search from google for this question, this post is the only way that I saw the question is solved.
I follow the suggestions that mentioned previously.
But after shutdown -r now, current iptables rule disappear.
Here is what I do:
1.
iptables -I INPUT -p tcp --dport 3128 -j ACCEPT
2.
Edit
IPTABLES_SAVE_ON_RESTART="yes"
IPTABLES_SAVE_ON_STOP="yes"
in /etc/sysconfig/iptables-config
3.
service iptables save
chkconfig iptables on
4.
shutdown -r now
then I can't connect via 3128 port which is what my client computer want to connect my proxy server with port 3128.
I have to manually enter iptables -I INPUT -p tcp --dport 3128 -j ACCEPT again,
where did I go wrong?
faulkhuang
Last edited by faulkhuang on 2015/03/01 14:14:38, edited 1 time in total.
Re: [SOLVED] save iptables reboot and the rules are lost!
If you use firewalld then you cannot use the iptables command to add rules. Well, you can but firewalld doesn't know they exist and will remove them. If using firewalld then you must use firewall-cmd to add and amend rules (or the GUI firewall-config).
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke