0

I have a VPS with 2 IP addresses. If I restart the VPS the file /etc/sysconfig/network-scripts/ifcfg-eth0 looks like this:

DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=X.X.X.X
NETMASK=255.255.255.192
GATEWAY=X.X.X.X

I've tried adding this to eth0

DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=X.X.X.X
IPADDR2=Y.Y.Y.Y
NETMASK=255.255.255.192
NETMASK2=255.255.255.192
GATEWAY=X.X.X.X
GATEWAY2=X.X.X.X

and also tried creating a file /etc/sysconfig/network-scripts/ifcfg-eth0:1 that looks like this:

DEVICE=eth0:1
BOOTPROTO=static
ONBOOT=yes
IPADDR=Y.Y.Y.Y
NETMASK=255.255.255.192
GATEWAY=X.X.X.X

but after rebooting the VPS the ifcfg-eth0 file is reset and the ifcfg-eth0:1 file deleted.

1 Answer 1

0

Although I'm not sure if this was the case, after a "hard reset" as the VPS company calls it, the alias file ifcfg-eth0:0 reappeared and I had my second IP again.

I don't know if it was because of some kind of freeze on the hosting company end or if it was because I was trying 0:1 instead of 0:0.

But this is what fixed it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .