Re: [vserver] Mounting NFS(v4) with vserver guest's own IP address

From: Mark Hunting <mark_at_netexpo.nl>
Date: Wed 30 Jan 2008 - 08:44:40 GMT
Message-ID: <47A038F8.3090302@netexpo.nl>

Martin Fick wrote:
> --- Mark Hunting <mark@netexpo.nl> wrote:
>
>> Herbert Poetzl wrote:
>>
>>> On Sun, Jan 27, 2008 at 11:34:17AM +0100, Mark
>>>
>> Hunting wrote:
>>
>>> sure, make sure that multiple routing tables are
>>>
>> enabled,
>>
>>> assign one to your guest, and setup proper routing
>>> (source based) there, and the kernel will honor
>>>
>> that
>>
>>>
>>>
>> That sounds great. But how do I assign a specific
>> routing table to a
>> guest?
>>
>
> You can find some good source routing info in the
> Advanced Linux Routing How-To here:
>
> http://lartc.org/howto/lartc.rpdb.html
>
> -Martin
Thanks. I've played with the routing tables now, but it just won't work.
Can you guys give me a hint? The IP address of the host is 192.168.4.6
(eth1), the IP of the guest is 192.168.4.38. I did this:

echo 200 test >> /etc/iproute2/rt_tables
ip rule add from 192.168.4.38 table test
ip route add default src 192.168.4.38 dev eth1 table test
ip route flush cache

Unfortunately my NFS actions on the guest keep coming from 192.168.4.6
instead of 192.168.4.38. I guess the 'local' table does have something
to do with this:

#ip route list table local
local 87.255.48.38 dev eth0 proto kernel scope host src 87.255.48.6
broadcast 192.168.4.255 dev eth1 proto kernel scope link src 192.168.4.6
local 87.255.48.6 dev eth0 proto kernel scope host src 87.255.48.6
broadcast 127.255.255.255 dev lo proto kernel scope link src 127.0.0.1
local 87.255.48.37 dev eth0 proto kernel scope host src 87.255.48.6
broadcast 87.255.48.127 dev eth0 proto kernel scope link src 87.255.48.6
local 192.168.4.39 dev eth1 proto kernel scope host src 192.168.4.6
local 192.168.4.6 dev eth1 proto kernel scope host src 192.168.4.6
broadcast 127.0.0.0 dev lo proto kernel scope link src 127.0.0.1
local 192.168.4.38 dev eth1 proto kernel scope host src 192.168.4.6
local 127.0.0.1 dev lo proto kernel scope host src 127.0.0.1
local 127.0.0.0/8 dev lo proto kernel scope host src 127.0.0.1

Herbert wrote that this is not something VServer specific, but I hope
somebody can help me. When this works I will certainly add it to the
VServer wiki. I guess this is a problem for more people working with
VServers and NFS (and who, like me, don't know all ins and outs of
routing tables).

Mark
Received on Wed Jan 30 08:46:30 2008

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Wed 30 Jan 2008 - 08:46:39 GMT by hypermail 2.1.8