Older Newer
Sun, 30 Apr 2006 23:35:29 . . . . ShavenWarthog? [fixed "interface" to "interfaces"]
Fri, 28 Apr 2006 02:18:05 . . . . ShavenWarthog? [clarified Step 2]
Thu, 30 Mar 2006 02:17:07 . . . . ShavenWarthog? [more minor wording changes]
Thu, 30 Mar 2006 02:07:43 . . . . ShavenWarthog? [minor English corrections]
Thu, 30 Mar 2006 01:54:01 . . . . c-24-130-248-115.hsd1.ca.comcast.net
Thu, 23 Mar 2006 08:14:37 . . . . port-195-158-177-14.dynamic.qsc.de
Fri, 17 Mar 2006 13:07:00 . . . . pop5-46.catv.wtnet.de
Wed, 15 Mar 2006 00:27:19 . . . . DataCompBoy?
Wed, 15 Mar 2006 00:17:49 . . . . DataCompBoy? [Initial load of page //datacompboy]
Wed, 15 Mar 2006 00:16:35 . . . . 217.8.236.1 [Initial load of page //datacompboy]


Changes by last author:

Changed:
Lets think, that you have only one external IP -- $EXTIP.

And you want to have several vservers runned without think about port overlapping.

The one solution is:

* You put all vservers into "virtual lan", say 192.168.1.x

* Every vsever have it own IP

* Control port forwarding on host like on real server.

Lets imagine, you have only one external IP -- $EXTIP.

You want to have several vservers running without worrying about port overlapping.

Changed:
So, what you doing:

1. Set up dummy0 iface on host

Example:

Two vservers run a default webserver, running on port 80. If each "guest" vserver shares an IP with the host, then the two webservers will confict.

One solution is:

* All vservers are contained in a "virtual lan", say 192.168.1.x

* Each vserver has its own IP

* Control port forwarding on "parent" host. That is, run a router.

This is how to set it up:

1. Set up dummy0 interface on the parent host

Changed:
# /etc/network/interfaces on debian box,
# /etc/network/interfaces on a Debian box,
Changed:
2. Set up your vserver:
2. Set up each guest vserver:
Changed:
# Contents of /etc/vservers/<vserver>/interface/0/

dev: dummy0

ip: 192.168.1.1

name: 1

prefix: 24

cd /etc/vservers/$VSERVER/interfaces/0

echo dummy0 > dev

echo 192.168.1.1 > ip

echo 1 > name

echo 24 > prefix

Changed:
I suggest you to use value of name equal to last digit of ip -- for easy separation

3. Now, configure firewall on server:

I suggest you use value of name equal to last digit of the IP -- for easy separation.

3. Now, configure the host to act as a router.

3a: For internal packets going outside, pretend each packet came from our external IP:

Changed:
And for each service that runned on vhosts local address $VHOST and port $INTPORT you select one external port $EXTPORT and map it by running

3b: For each service that runs on a vserver, map it to an external port. Vserver local address $VHOST and port $INTPORT you select one external port $EXTPORT and run the following:

Changed:
Thats all!
That's all!
Changed:
Try to connect to your $EXTIP:$EXTPORT (from other server) -- you will successfully connect to service at your vserver.
Try to connect to your $EXTIP:$EXTPORT (from another external host) -- you will successfully connect to service running on a guest vserver.