LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Redhat lost it's virtual IP address (https://www.linuxquestions.org/questions/linux-networking-3/redhat-lost-its-virtual-ip-address-841628/)

hazza96 11-01-2010 02:52 AM

Redhat lost it's virtual IP address
 
Last night we had a box lose it's virtual IP address on the eth0 card. I rebooted the box but it just would not give the card the second IP address. We rebooted several times in fact.

Today admin ran 'ifup ifcfg-eth0:1' and the virtual IP was there. Nothing was changed, just that command was ran.

I thought there might be a problem with the automagical stuff so I rebooted the box again, virtual IP is there and happy.

Anyone know why it would not have come back on reboot and why it now does?

MensaWater 11-01-2010 10:10 AM

Did the first IP address (eth0 as opposed to eth0:1) work? You know that the virtual is depending on the "real" one right? That is to say the virtual IP can only come up if the "real" IP is up.

Also I've seen issues with (real) IPs coming up when routing is confused. RHEL seems to want the default gateway to always be on eth0. You can add routes for other nics (e.g eth1) but making one of those primary gateway when you have a live eth0 seems to cause problems. (Of course virtuals should use same gateway as the real IP as they have to be on same network as the real IP so this shouldn't be an issue but I figured I'd mention it in case you didn't have eth0's gateway as your default.)

hazza96 11-02-2010 12:23 AM

Yeah the real IP address always worked, it only has a single NIC, the virtual IP does not have a gateway, it is limited to contacting hosts on the same network.

rew 11-02-2010 06:16 AM

It should come up automatically provided it is configured as "auto eth0:1" in /etc/network/interfaces . If it once or a few times didn't come up there is little we can do to figure out why.

MensaWater 11-02-2010 08:43 AM

Quote:

Originally Posted by rew (Post 4146724)
It should come up automatically provided it is configured as "auto eth0:1" in /etc/network/interfaces . If it once or a few times didn't come up there is little we can do to figure out why.

RHEL/CentOS have no "/etc/network/interfaces". The networking files are /etc/sysconfig/network and /etc/sysconfig/network-scripts/*.

Skaperen 11-02-2010 09:53 AM

Was there also another NIC, eth1? I've seen some weird things happen with the "sophisticated" network management one sees in 6 letter distros when there is more than one NIC. Ethernet interfaces might come up in a different order, and end up with interface names associated differently. Depending on how they are configured or what autoconfigured them, IP addresses may be associated with an interface name, or a MAC address. If one IP is associated with a MAC address, and the other with an interface name, for what is usually the same NIC, they would usually be together. But if sometimes the NICs activate out of order, then you could see those 2 IPs on different NICs, even if only one NIC is actually used.

If you see the problem again, do "ifconfig -a" and see what's going on. Do that command now and save its output for reference.

My workaround for such mess is I substitute my own network startup scripts that just do explicit address binding. That, and I also use the IPv6 link-local addresses (the ones beginning with "fe80::") as backdoors into the servers in case something goes wrong (has not since my scripts were debugged).

If you only have one physical NIC, ignore all this above.

hazza96 11-06-2010 12:34 AM

Quote:

Originally Posted by MensaWater (Post 4146911)
RHEL/CentOS have no "/etc/network/interfaces". The networking files are /etc/sysconfig/network and /etc/sysconfig/network-scripts/*.

The only thing I could see wrong is the file in the /etc/sysconfig/network-scripts directory is called ifcfg-eth0:1 but inside the file it had the line:

DEVICE=eth0:0

I pointed that out to the admins and they have now changed that line to match the file name. It now also has an additional line:

ONBOOT=yes

The /etc/sysconfig/network file just has three lines in it:
NETWORKING=yes
NETWORKING IPV6=yes
HOSTNAME=xxxxxxx

@Skaperen: There is only one NIC inside the machine, post ignored :)

hazza96 11-26-2010 04:35 PM

It has happened again, on several occasions, we have no idea why it is happening.

One person suggested that it could be a flaky cable, the box loses it's connection, drops it's shit, gets the connection back and does not bother to bring the virtual IP back online.

I doubt that though, there are no other indications it has a connection issue.


All times are GMT -5. The time now is 03:19 PM.