OVH Community, your new community space.

Cant add secondary /32 static IP address to eth0? ( Centos 7 )


lynxus
12-09-2014, 13:58
Finally got to the bottom of this:

Fyi for others:

Right, Looks like the following needed to be added to the files on Centos7 64bit..

Add to both ifcfg-eth0 and ifcfg-eth0:0
NM_CONTROLLED=no

Ensure "chkconfig network on" is done.


Here are my files for your reference ( should other have this issue )

[root@vps95738 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=dhcp
ONBOOT=yes
NM_CONTROLLED=no

[root@vps95738 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE=eth0:0
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=37.187.235.XXX
NETMASK=255.255.255.255
ONBOOT=yes

lynxus
12-09-2014, 13:32
Quote Originally Posted by Dani
Hi

With the guide at http://help.ovh.co.uk/IpAlias

It should be:

BOOTPROTO="static"

Danny
Hey Dani,

Thanks againf or your time,
Still doesn't seem to work


File:
[root@vps95738 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE="eth0:0"
BOOTPROTO="static"
IPADDR="37.187.235.xx"
NETMASK="255.255.255.255"
ONBOOT="yes"
BROADCAST="37.187.235.xx"
[root@vps95738 ~]#
[root@vps95738 ~]# ifconfig eth0:0
eth0:0: flags=4163 mtu 1500
ether 02:00:05:c4:06:3e txqueuelen 1000 (Ethernet)

[root@vps95738 ~]#

After a reboot, once again , no ip attached to eth0:0

If i try an if up, i get this error:

[root@vps95738 ~]# ifup eth0:0
Error: no device found for connection 'System eth0:0'.

Dani
12-09-2014, 12:34
Hi

With the guide at http://help.ovh.co.uk/IpAlias

It should be:

BOOTPROTO="static"

Danny

lynxus
12-09-2014, 10:36
Hi Guys,

Followed the OVH guide for my server but no luck...


I have a vps with ovh and have a 2nd IP assigned /. routed to it.
Its running Centos7 but I cant seem to get it working?

What Have I missed? ( Replaced IP with XX )

cat /etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE="eth0:0"
BOOTPROTO="none"
ONBOOT="yes"
IPADDR="xx.187.235.xx"
NETMASK="255.255.255.255"
BROADCAST="xx.187.235.xx"


I then either reboot or ifup the interface. But it doesnt show the iP.

ifconfig eth0:0
eth0:0: flags=4163 mtu 1500
ether 02:00:05:c4:06:3e txqueuelen 1000 (Ethernet)


And I cant ping it.
Any ideas? Im not sure what im doing wrong here ( and im fairly well versed with linux. )


Whats really annoying is if i type:
ifconfig eth0:0 xx.187.235.xx/32 up


It works fine...


Nothing I do seems to bring up a secondary interface on boot, ( or even if I use ifup/down )

Help!

Thanks
G