Skip to contentSkip to conversation

multiple webservers behind iptables

DISCUSSION Raul I. Becette 3 participants 4 messages Feb 9, 2005 – Feb 14, 2005

lore
Share & tools
lore
#0 lore raw

Hello list

This is my first post.
I am in charge of a LAN connected to internet through a firewall box PIII 500MHz with iptables 1.2.10.

There are different internal webservers that I don't adminnister and are located physically in different parts of the building. There is an internal DNS server which I administer to resolve internal www queries.

My problem is that from the outside I cannot access those webservers when I type www.xxx.unp.edu.ar (xxx being the name of the server). My net schema is the following

INTERNET
Mail Relay Main Web Server Router

-------------------------Firewall--------------------------------

POP Server Proxy Webserver1 Webserver2
LAN

My question is how can I use iptables rules to be able to access those servers from the outside.

Any info you need just ask

Thank you for your time

Signature · 9 lines
-----------------------------------------------------------------
Raul I. Becette
E-mail: [email protected]
REPAC, Red Patagonica de  Comunicaciones
Univ. Nac. de la Patagonia San Juan Bosco
Ciudad Universitaria - Km.4.
9000 - Comodoro Rivadavia - Chubut
Tel/Fax : (0297) - 4550073
------------------------------------------------------------------
#1 lore raw
Quoted 6 lines · Raul I. Becette

Hello list

This is my first post.
I am in charge of a LAN connected to internet through a firewall box PIII 500MHz with iptables 1.2.10.

Quoted 8 lines

There are different internal webservers that I don't adminnister and are located physically in different parts of the building.
There is an internal DNS server which I administer to resolve internal www queries.

My problem is that from the outside I cannot access those webservers when I type www.xxx.unp.edu.ar (xxx being the name of the server). My net schema is the following

um--not to be silly, but does www.xxx.unp.edu.ar resolve to an IP address externally?

Quoted 4 lines

INTERNET
Mail Relay Main Web Server Router

Quoted 8 lines

-------------------------Firewall--------------------------------

POP Server Proxy Webserver1 Webserver2
LAN

My question is how can I use iptables rules to be able to access those servers from the outside.

depends on whether you need to use NAT to make the servers accessible from the Internet (i will assume you do not). for each webserver IP, add a rule like:

  iptables -A FORWARD -i $EXT_IF -p tcp --syn -d $WEB_SRV_IP \
    --dport 80 -j ACCEPT

this assumes that somewhere above this rule you have:

  iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

-j

--
"Me fail English? That's unpossible."
--The Simpsons

#2 lore raw
In reply to Raul I. Becette
Quoted 16 lines · Raul I. Becette

Hello list

This is my first post.
I am in charge of a LAN connected to internet through a firewall box PIII 500MHz with iptables 1.2.10.

There are different internal webservers that I don't adminnister and are located physically in different parts of the building. There is an internal DNS server which I administer to resolve internal www queries.

My problem is that from the outside I cannot access those webservers when I type www.xxx.unp.edu.ar (xxx being the name of the server). My net schema is the following

INTERNET
Mail Relay Main Web Server Router

Quoted 5 lines

-------------------------Firewall--------------------------------

POP Server Proxy Webserver1 Webserver2
LAN

depending on if your multiple web servers have a public IP or not, you may have to set up a proxy to redirect the requests to the right box

Quoted 6 lines

My question is how can I use iptables rules to be able to access those servers from the outside.

Any info you need just ask

Thank you for your time

#3 lore raw

Re: multiple webservers behind iptables (SOLVED)

In reply to Raul I. Becette
Quoted 19 lines · Raul I. Becette

Hello list

This is my first post.
I am in charge of a LAN connected to internet through a firewall box PIII 500MHz with iptables 1.2.10.

There are different internal webservers that I don't adminnister and are located physically in different parts of the building. There is an internal DNS server which I administer to resolve internal www queries.

My problem is that from the outside I cannot access those webservers when I type www.xxx.unp.edu.ar (xxx being the name of the server). My net schema is the following

INTERNET
Mail Relay Main Web Server Router

-------------------------Firewall--------------------------------

Quoted 9 lines

POP Server Proxy Webserver1 Webserver2
LAN

My question is how can I use iptables rules to be able to access those servers from the outside.

Any info you need just ask

Thank you for your time

Hello list

I solved the problem installing squid on the firewall and configuring it as a reverse proxy as described in http://squid.visolve.com/squid/reverseproxy.htm

The only line I had to add to my firewall script is in the INPUT chain allowing incoming connections on port 80 on the public interface.

Also, every www.xxx.unp.edu.ar on my external DNS server points to my firewall public IP.

Thanks everyone for your help

Signature · 9 lines
-----------------------------------------------------------------
Raul I. Becette
E-mail: [email protected]
REPAC, Red Patagonica de  Comunicaciones
Univ. Nac. de la Patagonia San Juan Bosco
Ciudad Universitaria - Km.4.
9000 - Comodoro Rivadavia - Chubut
Tel/Fax : (0297) - 4550073
------------------------------------------------------------------