Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is what I have specified as a default rule in my iptables firewall script:

iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X

iptables -P INPUT ACCEPT

I have many interfaces and many networks and NATing where traffic should get forwarded, so I have made FORWARD ACCEPT as default rule. And next I have this:

iptables -t nat -A POSTROUTING -s -o eth0 -j SNAT --to-source

And at the end I have this:

iptables -A INPUT -i eth0 -j DROP

This DROP rule should drop only packets directed to the gateway host. Whatever traffic that comes in via eth0 to be forwared should not get affected.

My question is, if I have a INPUT DROP rule for an interface, whether it will affect the FORWARD chains on the same interface (or the global FORWARD ACCEPT chain)?

share|improve this question
up vote 3 down vote accepted

There should not be any problem because INPUT chain rule is applied when "Packet is going to be delivered locally. Local delivery is controlled by the “local-delivery” routing table: ip route show table local" and FORWARD chain is applied on packets that have been routed and so the packets that are not for local delivery will traverse this chain.

So your INPUT chain rule should not affect the FORWARD chain rule.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.