Bug 222563 - Network Manager should not try to use DHCP if I set a static address
Summary: Network Manager should not try to use DHCP if I set a static address
Status: RESOLVED FIXED
Alias: None
Product: knetworkmanager
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Unspecified
: NOR normal
Target Milestone: ---
Assignee: Will Stephenson
URL:
Keywords:
: 224919 227247 259583 (view as bug list)
Depends on: 204340
Blocks:
  Show dependency treegraph
 
Reported: 2010-01-13 18:18 UTC by Ralf Jung
Modified: 2014-09-28 17:09 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Jung 2010-01-13 18:18:42 UTC
Version:            (using KDE 4.3.4)
Installed from:    Ubuntu Packages

I don't have working DHCP available for my PC, so I am required to set up a static IP address. This works fine using the Network Manager applet, but there is one problem: After logging in, it takes about 5-20 seconds before it sets up the connection properly. According to the status tip (keeping the mouse over the network manager icon) it is waiting to get an address - which does not work obviously, I would not need a static IP address if it did. So currently, I can't see a way to actually disable DHCP  - all I can do is add a fall-back in case DHCP does not work. This is not the expected behaviour if I manually set an address.
There might even be the need (though not in my case) to set a static address despite a DHCP being sent - which does not seem to be possible at all currently.
Comment 1 Tristan Miller 2010-10-25 13:51:33 UTC
I can confirm that this has been an issue up to and including KDE 4.5.2.  Here are further details to reproduce the problem.  This assumes that you are on a network which supports DHCP, but on which your machine has a static IP.  It should be possible to configure most modern routers to behave this way.

Steps to reproduce:

1) Manage Connections->Network Connections->Wired->Add
2) Enter a connection name.
3) IP Address->Method->Manual and enter the details for your static IP
4) Check "Connect automatically"
5) OK
6) OK
7) Disconnect and reconnect the network cable, or restart the machine.

Expected behaviour:

8) Since "Connect automatically" was selected, I assume that when Network Manager first attempts to make a connection, it will try to activate the one with the static IP.

Observed behaviour:

8) Network Manager requests and receives an address via DHCP.


It is possible to force Network Manager to use the static IP connection by right-clicking on the system tray icon and selecting it from the list.  It's only when automatically connecting (such as when starting up for the first time, or recovering from an interrupted network connection) that Network Manager ignores the "Connect automatically" setting and instead uses DHCP.  

However, this is a fairly serious bug, as it means that machines can become unreachable after a network hiccup.  For example, my home router forwards ssh requests to a static IP normally claimed by my home machine.  But if my home Internet connection drops out (as it sometimes does), Network Manager will use DHCP to request a new IP from the router, and so I won't be able to reach it remotely any more.
Comment 2 Tristan Miller 2010-10-25 14:29:33 UTC
Is this possibly the same issue as Bug 224919?
Comment 3 Silver Salonen 2010-10-25 14:42:08 UTC
*** Bug 224919 has been marked as a duplicate of this bug. ***
Comment 4 Lamarque V. Souza 2011-04-08 19:47:22 UTC
This is a side effect of http://bugs.kde.org/204340 . Networkmanager always
creates system auto-connect connections for wired connections and they have
priority over user connections (the ones created using Plasma NM). Once editing
system connections patch is commited you will be able to edit them to not auto
connect.
Comment 5 Lamarque V. Souza 2011-04-08 19:47:41 UTC
*** Bug 227247 has been marked as a duplicate of this bug. ***
Comment 6 Lamarque V. Souza 2011-04-08 19:47:51 UTC
*** Bug 259583 has been marked as a duplicate of this bug. ***
Comment 7 Ruchir Brahmbhatt 2011-04-09 07:08:58 UTC
This is a long standing bug which makes using static IP very difficult.
Comment 8 John Hunter 2014-09-09 15:14:20 UTC
I notice that there are claims that this bug has been fixed. I have just upgraded to Netrunner 14 (based on Ubuntu4.14) to find this issue has arisen -- in fact, trying to use nm does nothing helpful: and I cannot find any documentation or sensible work arounds. If this bug is closed, where is the write up of the "solution"? DHCP may be convenient for laptops, phones and tablets but it is VERY unhelpful for desktops (which are supposed to act as file, print and mail servers for the domestic toys). What is the recommended work around? My configuration is:
Intel i5-2320 (4X3.0GHz); 6GB RAM
Kernel: 3.13.0-35 Generic 32-bit
KDE 4:4.14.0; QT 4.8.6

Thanks for any help
Comment 9 Tristan Miller 2014-09-09 15:40:36 UTC
The best workaround for a desktop machine with a static IP is to use ifconfig instead of NetworkManager.  For a laptop which one tends to take from network to network, ifconfig obviously isn't a feasible workaround.
Comment 10 Christoph Feck 2014-09-28 17:09:35 UTC
"knetworkmanager" is probably not right here. If you find a bug in the Plasma NetworkManager applet, please report this issue using "plasma-nm".