Skip to contentSkip to conversation

Public Webserver behind IPtables Router

DISCUSSION thomas krause 2 participants 2 messages Jul 18, 2003

lore
Share & tools
lore
#0 lore raw

Hello , i tried to set up an IPTables Router for my Webserver. All hosts have has an official IP Adress. The eth0 of the Router is in a seperate Net.

The config on the Router is like this :

---------<Router>----------------------<WEBServer>
eth0 eth1 eth0

# Allow ssh ( 0.0.0.0/0 is replaced by my own client IP ) iptables -P INCOMING DROP
iptables -A INCOMING -s 0.0.0.0/0 -p tcp --dport 22 -j ACCEPT

iptables -P FORWARD DROP
iptables -A FORWARD -s 0.0.0.0/0 -p tcp --dport 80 -j ACCEPT

iptables -P OUTPUT ALLOW

Will this work ? O.K. Iam a Newbie but i will learn !

MfG Thomas

#1 lore raw
Quoted 8 lines · thomas krause

Hello , i tried to set up an IPTables Router for my Webserver. All hosts have has an official IP Adress. The eth0 of the Router is in iptables -P FORWARD DROP
iptables -A FORWARD -s 0.0.0.0/0 -p tcp --dport 80 -j ACCEPT

iptables -P OUTPUT ALLOW

Will this work ? O.K. Iam a Newbie but i will learn !

No, you just authorize packet to port 80 and what happened to return packet to have this working you have to add a rules using STATE, ie accept all packet of the connection (and in particular response packet) :

	iptables -P FORWARD DROP
	iptables -A FORWARD -m state --state ESTABLISHED -j ACCEPT
	iptables -A FORWARD -s 0.0.0.0/0 -p tcp --dport 80 -j ACCEPT

BR,

Signature · 1 line
Eric Leblond <[email protected]>