Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 03-01-2018, 09:25 AM   #16
Registered: Oct 2012
Posts: 562

Original Poster
Rep: Reputation: Disabled

Where would it be logging to? I don't have /var/log/messages.
Old 03-01-2018, 09:36 AM   #17
Registered: Oct 2012
Posts: 562

Original Poster
Rep: Reputation: Disabled
I figured out why http traffic was going through without any 80/443 rules. I've had to add these rules now to let the traffic through:
-A INPUT -i eth1 -p tcp -m tcp --dport 80 -m state --state NEW,ESTABLISHED -j ACCEPT
-A INPUT -i eth1 -p tcp -m tcp --dport 443 -m state --state NEW,ESTABLISHED -j ACCEPT

-A OUTPUT -o eth0 -p tcp -m tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT
-A OUTPUT -o eth0 -p tcp -m tcp --sport 443 -m state --state ESTABLISHED -j ACCEPT
I made sure that my http server is only listening on the internal interface (eth1).
Old 03-15-2018, 04:08 AM   #18
LQ Newbie
Registered: Mar 2018
Posts: 10

Rep: Reputation: Disabled
If you set your Policies to DROP you do not need a rule to block, you just need rules to allow.
This is most secure.


# Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP

# Accept on localhost
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT

# Allow established sessions to receive traffic and block port 80
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p tcp --dport 80 -j DROP

This is as simple as you will get other than creating .htaccess file to block all but your local net

Just a though


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Attempting to block all non-used ports with iptables. jddancks Linux - Security 12 10-19-2013 05:24 PM
Block all the ports excpet 80 on iptables (eth2) webboy105 Linux - Security 11 02-04-2010 04:17 PM
How to block high ports in iptables? sparc86 Linux - Security 1 12-01-2008 08:55 PM
block m$ related ports using iptables carboncopy Linux - Security 8 01-28-2005 01:30 PM
iptables: block ports and RELATED, ESTABLISHED Klaus Pforte Linux - Security 6 07-17-2003 11:00 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:20 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration