Older Newer
Tue, 14 Feb 2006 05:54:29 . . . . GeraldHochegger? [more routing infos]
Tue, 14 Feb 2006 05:09:17 . . . . GeraldHochegger?
Mon, 13 Feb 2006 04:24:23 . . . . DavidS? [directory name under interfaces is irrelavant]
Sun, 22 Jan 2006 04:16:46 . . . . (Titoo)? [Add a note about the mask on the interface.]
Sun, 01 Jan 2006 15:45:48 . . . . (cehteh)? [localhost workaround]
Fri, 30 Dec 2005 20:19:59 . . . . (cehteh)?
Fri, 30 Dec 2005 18:10:04 . . . . (cehteh)?
Fri, 30 Dec 2005 18:05:09 . . . . (cehteh)?


Changes by last author:

Added:
= configuring routing for a server with two network interfaces =

If your physical server has two or more network interfaces you have to configure routing correctly, if you are running vservers in both networks.

Packets must leave on the same interface on which they are received.

The following configuration on Debian/Ubuntu /etc/network/interfaces sets up two additional routing tables and two rules to route packets from different subnets through the correct interfaces.

<code>

# The primary network interface

auto eth0

iface eth0 inet static

address 10.10.64.16

netmask 255.255.255.0

network 10.10.64.0

broadcast 10.10.64.255

gateway 10.10.64.1

up /bin/ip route add 10.10.64.0/24 dev eth0 src 10.10.64.16 table 64

up /bin/ip route add default via 10.10.64.1 table 64

up /bin/ip rule add from 10.10.64.0/24 table 64

post-down /bin/ip rule delete from 10.10.64.0/24 table 64

auto eth1

iface eth1 inet static

address 10.10.68.61

netmask 255.255.255.0

network 10.10.68.0

broadcast 10.10.68.255

up /bin/ip route add 10.10.68.0/24 dev eth1 src 10.10.68.61 table 68

up /bin/ip route add default via 10.10.68.1 table 68

up /bin/ip rule add from 10.10.68.0/24 table 68

post-down /bin/ip rule delete from 10.10.68.0/24 table 68

</code>