LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

RE: LVS-NAT and packets originating from realserver

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: LVS-NAT and packets originating from realserver
From: "C. R. Oldham" <cro@xxxxxxxxxxx>
Date: Wed, 25 Aug 2004 09:34:58 -0700
Joseph Mack wrote:

> I can't read these things real well, I'm afraid. 
> Could you paste a few comments in there for people like me? 

OK

> "C. R. Oldham" wrote:
> 
> > iface eth1 inet static

Define an interface eth1 that uses inet protocols and has a static
address

> >    address 192.168.0.2

Give the interface the address of 192.168.0.2

> >    netmask 255.255.255.0

And a netmask of 255.255.255.0

> >    up ip route add 192.168.0.0 dev eth1 src 192.168.0.2 table lvs

When the interface is brought up, execute 'ip route' adding an entry to
the routing table that causes packets with src address 192.168.0.2 to be
processed with the iptables table called 'lvs'

> >    up ip route add default via 192.168.0.1 table lvs

When the interface is brought up, set the default route for the table
lvs to 192.168.0.1 (which is my lvs director).

> >    up ip rule add from 192.168.0.2 table lvs

Add another routing rule so packets going from 192.168.0.2 are also
processed by table lvs.

> >    down ip rule delete from 192.168.0.2 table lvs
> >    down ip route delete 192.168.0.0 dev eth1 src 192.168.0.2 table
lvs

When the interface is brought down delete the routing rules.

--cro

<Prev in Thread] Current Thread [Next in Thread>