Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I run dnsmasq locally as a cache server, in the old days, I allow all INPUT packets from lo+, and set policy of INPUT to DROP:

-A INPUT -i lo+ -j ACCEPT

Now I decide to put this on the raw table to speed up rules matching,

-A PREROUTING -i lo+ -j ACCEPT

But that doesn't work as expected. Why? Since the packets get processed by the raw table first, then nat, then filter, why isn't that rule work the same as the old one?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

See iptables port redirect not working for localhost.

PREROUTING isn't used by the loopback interface

I'd hazard this applies to every table regardless of the chain. Also, you should post the whole command line for a question instead of the tail snippet.

share|improve this answer
    
I didn't post all of them, 'cause I'm testing with only a few lines ;-P –  warl0ck Nov 18 '12 at 6:13
    
@warl0ck I meant the full 'iptables...', not every rule. –  Jeff Ferland Nov 18 '12 at 6:14
    
Oh, I'm editing the rules directy ... after iptables-save > XXX –  warl0ck Nov 18 '12 at 6:14

Your Answer

 
discard

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.