Skip to contentSkip to conversation

Iptables NAT & vserver

DISCUSSION Marc Kalberer 1 participant 1 message Mar 13, 2006

lore
Share & tools
lore
#0 lore raw

Hello,
I tried to setup a subnetwork using several vservers.

- host system is connected to internet
- several guest in a different subnetwork on it.
- the host has the normal eth0 interface and a "virtual" tap0 one.
- host can see and connect both network.

Now the "problem" is :
- from outside I have several subdomain test.example.com, test2.example.com pointing on the guest ip.

and base on the name I would like to redirect de incoming connection too the corresponding guest.
iptables is suppose to handle the -d <hostname>

(host is 10.0.0.160)

-A PREROUTING -p tcp -m tcp -d test.example.com -j DNAT --to-destination 10.0.1.2

... what's wrong with my approach, I didn't succeed to make it work.

Any Idea ?

Marc

Signature · 12 lines
Programmers.ch
Solutions libres et Opensources
Tel: ++41 76 44 888 72
Site: http://www.programmers.ch
Site: http://openprojects.ch

-- 
Programmers.ch
Solutions libres et Opensources
Tel: ++41 76 44 888 72
Site: http://www.programmers.ch
Site: http://openprojects.ch