Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I got a quite complicated firewall (8 segments) and sometimes I need to reload rules and add some new vlans. I'd like to quiet the traffic for few seconds while new rules are loaded. I.e. I want all outgoing traffic be dropped (but without killing existing conntrack rules).

I tried the following rule:

iptables -t raw -N __just_drop
iptables -t raw -I PREROUTING 1 -j __just_drop
iptables -t raw -I OUTPUT 1 -j __just_drop

Now atomically silent the network:

iptables -t raw -A __just_drop -j DROP

Now, do your stuff, start/stop interfaces, configure vlans and bondings and reconfigure iptables rules. Then atomically unblock the network:

iptables -t raw -F __just_drop
# clean up
iptables -t raw -D PREROUTING -j __just_drop
iptables -t raw -D OUTPUT -j __just_drop
iptables -t raw -X __just_drop

but it appears that silencing the network that way doesn't work. It almost work but still some protocols, like DHCP, pass through. What did I wrong and is there a way to global DROP of the whole network without affecting conntrack? I.e. I'm looking the way to simulated pull the interfaces' cables out.

share|improve this question
1  
I suspect that dhcp traffic may pass 'cause of conntrack entry. Can you check it in /proc/net/nf_conntrack ? – DukeLion May 21 '12 at 13:30

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.