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.
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.
Thank you for for reading this thread. I am currently building a simple firewall and dont' quite understand what does it mean by " Drop all incoming packets from reserved port 0 as well as inbound traffic to port 0" The following below is the few rules that I made so far. Can anyone tell me what is the script look like to drop all incoming packet & traffic for reserved port 0. Also, if you see any error on my scirpt, please let me know.
# Set the default policies to DROP
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
# Permit inbound/outbound ssh packets.
iptables -A INPUT -i eth1 -p tcp --dport 22 -- syn -j ACCEPT
iptables -A OUTPUT -o eth1 -p tcp --sport 22 -- syn -j DROP
# Permit inbound/outbound www packets.
iptables -A INPUT -i eth1 -p tcp --dport 80 -- syn -j ACCEPT
iptables -A OUTPUT -o eth1 -p tcp --sport 80 -- syn -j DROP
# Drop inbound traffic to port 80 (http) from source ports less than 1024
iptables -A INPUT -i eth1 -p tcp --dport 80 --sport 0:1024 -j DROP
# Drop all incoming packets from reserved port 0 as well as inbound traffic to port 0
You really shouldn't be trying to "roll your own" firewall w/ so little background knowledge, If you are determined to learn how, a commendable goal, look at Oscar Andreasson's Iptables Tutorial 1.2.2
Hi, cause I am currently working on my school assignment, really want to get some help, due to my little knowledge on linux and firewall. I am using Fedora 6, how can I execute the firewall when bootup? Also, can anyone please take a look my scipts and tell me where is wrong? I really appreciated. Thanks
# Set the default policies to DROP
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
# Allow the localhost
iptables -A INPUT -i lo -j ACCEPT
# Drop inbound traffic to port 80 (http) from source ports less than 1024
iptables -A INPUT -p tcp --dport 80 --sport 0:1024 -j DROP
# Drop all incoming packets from reserved port 0 as well as inbound traffic to port 0
iptables -A INPUT -p tcp --dport 0 -j DROP
iptables -A INPUT -p tcp --sport 0 -j DROP
# Allow DNS traffic through this machine
iptables -A INPUT -p udp --dport 53 -j ACCEPT
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.