After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 569277 - DHCP setup is not robust with ill-configured servers (no Internet access)
DHCP setup is not robust with ill-configured servers (no Internet access)
Status: RESOLVED NOTGNOME
Product: NetworkManager
Classification: Platform
Component: general
0.7.x
Other All
: Normal critical
: ---
Assigned To: Dan Williams
Dan Williams
Depends on:
Blocks:
 
 
Reported: 2009-01-27 02:26 UTC by Moisés
Modified: 2009-02-01 04:02 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Moisés 2009-01-27 02:26:35 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.
Comment 1 Dan Williams 2009-01-28 17:25:49 UTC
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?
Comment 2 Moisés 2009-01-29 02:42:39 UTC
Thank you, Dan.

I'm using Kubuntu 08.10 (Intrepid), with KNetworkManager version 1:0.7svn864988-0ubuntu1.8.10.3.
Comment 3 Dan Williams 2009-01-29 23:32:11 UTC
Ok, your distro needs to add that patch to their local builds, or update to the final 0.7 release.
Comment 4 Moisés 2009-02-01 04:02:23 UTC
Thanks again, Dan.

I just informed the Kubuntu team about this problem:
https://bugs.launchpad.net/ubuntu/+source/knetworkmanager/+bug/323816