Linux Iptables block all network traffic
You would like to block all network traffic using iptables firewall under Debian GNU/Linux. This will block all incoming and outgoing traffic including Internet aka ADSL/ppp0 and it is highly recommend. The logic is block everything and allow only required traffic. This can be done with four simple commands:
# iptable -F # iptables -P INPUT DROP # iptables -P OUTPUT DROP # iptables -P FORWARD DROP
Please do not enter above command over remote ssh login session.
Want to stay up to date with the latest Linux tips, news and announcements? Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
You may also be interested in other helpful articles:
- Linux Iptables block incoming access to selected or specific ip address
- Linux : Iptables # 4 Block all incoming traffic but allow ssh
- Block outgoing network access for a single user from my server using iptables
- Linux : Iptables #1 Basic concepts
- How to: Linux Iptables block common attacks
Discussion on This Article:
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: block traffic, gnu linux, iptable, iptables firewall, network traffic, outgoing traffic, ssh login



how can i use this order in fedora core?
Blocking really _ALL_ traffic can cause undesired effects. In fact quite a few applications use the internal loopback interface for internal communication. So the following two rules should be added to allow this:
iptables -A INPUT -i lo
iptables -A OUTPUT -o lo
which allow all traffic via the loopback interface. This should be perfectly safe, even in a hostile environment since all external traffic is still blocked.
hi,
It’s better to disable the the network service than using such firewall