Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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.
i have 2 NIC on my system. suppose,
eth0 is 60.61.62.63 (public IP ) and
eth1 is 192.168.239.20 (for internal users).
i want to configure nat as well as firewall. following are the commands which i am planning to run. will it be ok ??
Hello.
It's OK. Your post is not a a lengthy one.
1) You forgot to flush 'mangle' table and set up its default policy
2) Think about adding some policies to packets with wrong flag combinations etc.
I missed this the first time I looked over your rules, but there appears to be a typo in your state matching rules. You need to prefix the state match with the -m option, so your rules for state matching should be:
iptables -t filter -A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t filter -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
hi Capt_Caveman & RomanG,
Thanx.
i used the same commands & working fine now. but, The commands which i have used .......is it sufficient for a good firewall.
what exactly "iptables -X "does ?
flushing 'mangle' table and setting up its default policy....................is it mandatory ???
Think about adding some policies to packets with wrong flag combinations etc..............what does this mean ???
yeah, i used the -m state --state option.
i used the same commands & working fine now. but, The commands which i have used .......is it sufficient for a good firewall.
It's a very minimal firewall that you could use some additional features. However, it is reasonably secure.
what exactly "iptables -X "does ?
Removes any user-defined chains (see the iptables man page under the -N option for more info)
flushing 'mangle' table and setting up its default policy....................is it mandatory ???
technically no, because if no default policy is defined then it will automatically be set to ACCEPT. However, you set policies for all the other tables and it's a good idea in case you've inadvertantly set the policy to something else or have rules listed for mangle.
Think about adding some policies to packets with wrong flag combinations etc..............what does this mean ???
This would be a good feature to add to your firewall. It DROPs/LOGs packets that contain imposible TCP flag combinations. These are almost always associated with malicious traffic like port scanning. Another good feature to add would be spoofing protection (rules to prevent forging of IP addresses on packets). This post has a basic example of both spoofing and bad flags protection.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.