Subject: Re: [vserver] adding guest interface: isn't it hotplug?
From: Herbert Poetzl <herbert@13thfloor.at>
Date: Sat, 28 Nov 2009 16:42:23 +0100

On Sat, Nov 28, 2009 at 04:30:58PM +0100, Marc Chantreux wrote:
> On Thu, Nov 26, 2009 at 09:54:17PM +0100, Herbert Poetzl wrote:
> > > > ip link show dummy0
> > > 4: dummy0: <BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN

> > >     link/ether da:af:48:aa:25:95 brd ff:ff:ff:ff:ff:ff
> > > > sysctl net/ipv4/ip_forward                    
> > > net.ipv4.ip_forward = 1
> > > > iptables-save | grep SNAT                     
> > > -A POSTROUTING -s 10.0.0.0/8 -d ! 10.0.0.0/8 -j SNAT --to-source 212.85.154.29

> > > > grep -R . /etc/vservers/descartes/interfaces/1
> > > /etc/vservers/foo/interfaces/1/ip:10.0.0.2
> > > /etc/vservers/foo/interfaces/1/prefix:8
> > > /etc/vservers/foo/interfaces/1/dev:dummy0
> > > /etc/vservers/foo/interfaces/1/name:virt0
> > 
> > with this config, if you start the guest, util-vserver
> > will (according to your config) create an alias
> > 'dummy0:virt0' with the ip 10.0.0.2/8 and assign that
> > address to your guest
> 
> I would like to not restart the guest as there are some users using it,
> so according to your reply and Ghislain's link, i tried: 
> 
> /etc/vservers/foo/interfaces/1# grep . * 
> dev:dummy0
> ip:10.0.0.2
> prefix:8
> /etc/vservers/foo/interfaces/1# naddress --nid foo \ 
>     --add --ip 10.0.0.2 --bcast 10.255.255.255
> Adding 10.0.0.2 10.255.255.255

> so i connected on foo, i tried: 

> ip addr add dev dummy0 10.0.0.2/8 

> i have the error: 

> RTNETLINK answers: Operation not permitted

> i'm very sorry as i feel that i missed something simple. 

yeah, you want to do that 'ip addr add ..' on the
host instead :)

best,
Herbert

> regards
> 
> -- 
> Marc Chantreux
> BibLibre, expert en logiciels libres pour l'info-doc
> http://biblibre.com