GNOME Bugzilla – Bug 569277
DHCP setup is not robust with ill-configured servers (no Internet access)
Last modified: 2009-02-01 04:02:23 UTC
Please describe the problem: When an ill-configured DHCP server informs a gateway IP that is outside of the subnet, no route is created (but one can normally "ping" the gateway). As a result, Internet access is blocked. An example from my ISP (data from ifconfig and syslog): eth0's IP: 189.61.119.200 eth0's netmask: 255.255.240.0 eth0's subnet: 189.61.112.0 gateway: 189.61.96.1 "route" gives the following output (labels in portuguese): Tabela de Roteamento IP do Kernel Destino Roteador MáscaraGen. Opções Métrica Ref Uso Iface 189.61.112.0 * 255.255.240.0 U 1 0 0 eth0 link-local * 255.255.0.0 U 1000 0 0 eth0 No default route is set, so no Internet access is provided. Steps to reproduce: 1. (Mis)configure a DHCP server that gives a gateway IP outside the subnet of the provided IP. 2. Connect the client to the server. 3. Run "ifconfig" and "route" and confirm the results. Actual results: No routes are established. Expected results: The default route should be set to the gateway's IP address. Does this happen every time? Yes. Other information: I made a workaround, but it only works when the interface is brought up: file "/etc/network/if-up.d/fixgateway": ------ GATEWAY=189.61.96.1 if [ "$IFACE" = "eth0" ]; then route add -host $GATEWAY dev $IFACE route add default gw $GATEWAY fi ------ When the DHCP token expires and a new IP is asked to the server, the problem reappears. I have to unplug (or shut down) the interface and plug it again for the workaround to work.
Specific code to fix this issue was committed on: commit 3f0d6cd233127762adf4eb5cfe49f5466e2dba9d Author: Dan Williams Date: Fri Nov 14 20:42:38 2008 +0000 What is the specific SVN revision or git snapshot date of the NetworkManager that your distribution has packaged?
Thank you, Dan. I'm using Kubuntu 08.10 (Intrepid), with KNetworkManager version 1:0.7svn864988-0ubuntu1.8.10.3.
Ok, your distro needs to add that patch to their local builds, or update to the final 0.7 release.
Thanks again, Dan. I just informed the Kubuntu team about this problem: https://bugs.launchpad.net/ubuntu/+source/knetworkmanager/+bug/323816