0

I think my IPTables on startup have a 'starting state' that is slightly different to completely flushing them.

Some docker containers have a tendency to stuff around with the IPTables in a negative way- and I'd like to put things back after I've removed them.

I've tried restarting the network service - but that doesn't seem to have the desired effect. I don't have firewalld.

One way to do this is to restart the box. But I'd like to get that effect without restarting the box.

My question is: How can I 'freshen' my IPTables same as rebooting without rebooting on Centos?

Hawkeye
  • 2,699
  • 9
  • 30
  • 35
  • CentOS6, or CentOS7? – MadHatter May 26 '17 at 11:38
  • have you tried service iptables restart (dor centos5 or 6 this might be applicable)? – Petter H May 26 '17 at 11:39
  • What do you mean by freshen? Do you mean flush the state tables? If so, this is also influence by various sysctl settings as to how current established sessions are handled. This is also influenced by your default chain policies. What behavior are you seeing docker exhibit? – Aaron May 26 '17 at 12:15
  • I want them to go back to the same state they would be in after a reboot. – Hawkeye May 27 '17 at 06:42

1 Answers1

0

You could use "iptables -F" to flush all chains of the iptable. But I would suggest that you flush it one chain at a time this way you wouldn't accidentally delete the SSH chanin and lock yourself out. Remember to load the iptables on boot before you attempt this because if you accidentally lock yourself out then rebooting the server is the only option.

sridhar pandurangiah
  • 763
  • 2
  • 11
  • 29