Subject: Re: [vserver] some questions of naddress
From: Jarek Dylag <jarek.dylag@gmail.com>
Date: Thu, 15 Mar 2012 07:35:31 +0100

 Thu, 15 Mar 2012 07:35:31 +0100
2012/3/14 songjun435 <songjun435@gmail.com>:

Hi,

> hi,all:
> I use naddress command to add ip to the vps
>
> 1. I have started a test vps with "--interface eth0:192.168.155.50/24",and I
> enter the test vps,execute ifconfig:
[...]
> 2. then I execute "naddress --set  --nid 42 --ip 10.0.0.3/24",information on
> the console:
> Adding 10.0.0.3
> 3.then I enter the test vps again,and execute ifconfig,
>    But now there is nothing output to the console,why?

You have to add new ip on hosts:
ip add addr 10.0.0.3/24 dev eth0

> Can I use the naddress to change the ip of the vps?

Yes, but naddres doesn't add ip for you.

> And how to give two or more ips to the vps?

naddress --set  --nid 42 --ip 10.0.0.3/255.255.255.0 -ip 10.1.0.3/255.255.255.0

number of positions is limited to 16 (i might be wrong about current
limit), you can also add more ip using --mask or --range:

naddress --set --nid 42 --ip 10.0.0.3/255.255.255.0 --mask 10.1.0.128/25

Jarek Dyląg