Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
this will allow ICMP (ping or traceroutes) into you machine from any ip address.
protocols are in "/etc/protocols" and "man iptables" for iptables commands.
My question was can you exclude more than one thing in a log entry. My log entry says to log all except for "lo" I want to know if I can add icmp or an ip or another service to this log rule. Or can you only specify one thing to exempt frm per iptable rule.
I'm assuming you have a DROP rule after that -j LOG rule...
and you are ACCEPTing specific packets before the drop..
Better to use the chain structure to isolate the protocol..eg
Everything I want to log gets -j jumped to the logging chain..
then those that you don't want logged get -j RETURNed back to the INPUT chain before they can hit the -j LOG rule
The packets you want logged hit the -j LOG rule,
then they return to the INPUT chain automatically
And the final rule DROPs them.. eg
iptables -A INPUT -i ! lo -j logger
iptables -A logger -p icmp -j RETURN
iptables -A logger -p 47 -j RETURN
iptables -A logger -m limit --limit 3/second --limit-burst 5 -i ! lo -j LOG --log-level 6 --log-prefix "FW_INPUT_DROPPED "
.. some ACCEPT rules ...
INPUT DROP POLICY.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.