Disappearing routes in HN

From OpenVZ Virtuozzo Containers Wiki
Revision as of 15:39, 3 December 2007 by Kir (talk | contribs) (Networking: disappering routes in HN moved to Disappearing routes in HN: Fixed to typo + no need to put category in page name.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Problem statement

Sometimes people complain about VE-related routes disappering in HN.

These routes usually look like this:

# ip r l
<skip>
192.168.225.195 dev venet0  scope link

and tell the kernel that IP address 192.168.225.195 belongs to venet0 device. Thus packets with destination IP equal to 192.168.225.195 are forwarded to venet0 and then to appropriate VE.

Resolution

The problem is usually one of these:

  1. DHCP client. If your host system uses DHCP for acquiring IP address, then DHCP is for sure to blame. DHCP client tries to be smart and resets all the routes to those got from the server. Check your logs for DHCP re-lease events or other messages correlating with routes disappearing.
  2. Hotplug events. Modern Linux distros come with hotplug subsytem which tries to handle events like "new device found", "device was unplugged", etc. It also tries to be smart when LINK is DOWN/UP event from network device is received and can remove manually set routes. Check that your dmesg have anything related to this events. (AFAIK SUSE is the worst distro in this regard).

Debugging

If you still can't find what happens with your network settings try to replace /sbin/ip and /sbin/route with scripts logging the commands and programs which executed them and calling original binaries after that. This will help to find the victim if it's some script. More robust but similar debug can be added to kernel if first approach doesn't help.