You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Gaurav Aradhye <ga...@clogeny.com> on 2014/02/11 13:37:34 UTC

Network Interface Files with bootproto DHCP

Hello all,

I am trying to add network interface file for a secondary IP through code.
The simplest way would be copying the file for the primary IP and changing
required values accordingly.

But it seems that as the boot protocol value is DHCP, the values such as
ipaddress, netmask, gateway are not stored in the ifcfg-eth0 file. Are
these values not stored anywhere on the VM?

Also, what would be other way to add network interface file for secondary
IP? I believe CloudStack doesn't do this itself after acquiring secondary
IP.

Regards,
Gaurav

Re: Network Interface Files with bootproto DHCP

Posted by Nux! <nu...@li.nux.ro>.
On 11.02.2014 12:37, Gaurav Aradhye wrote:
> Hello all,
> 
> I am trying to add network interface file for a secondary IP through 
> code.
> The simplest way would be copying the file for the primary IP and 
> changing
> required values accordingly.
> 
> But it seems that as the boot protocol value is DHCP, the values such 
> as
> ipaddress, netmask, gateway are not stored in the ifcfg-eth0 file. Are
> these values not stored anywhere on the VM?
> 
> Also, what would be other way to add network interface file for 
> secondary
> IP? I believe CloudStack doesn't do this itself after acquiring 
> secondary
> IP.
> 
> Regards,
> Gaurav

Gaurav,

It's not ACS's job to the set the 2nd IP on the VM. You can easily do 
it from within. This is sysadmin job.
The "easiest", but not standard way of doing it is just adding 
something like this in rc.local:
ip a a 1.2.3.4/32 dev eth0

The better way to do it is just create another ifcfg file (assuming 
RHEL/CentOS) that looks like this:
DEVICE=eth0:1
IPADDR=1.2.3.4
PREFIX=32
ONBOOT=yes

HTH
Lucian

-- 
Sent from the Delta quadrant using Borg technology!

Nux!
www.nux.ro