Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
NetworkManager problems with both dhclient and dhcpcd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Fitzcarraldo
Guru
Guru


Joined: 30 Aug 2008
Posts: 464
Location: United Kingdom

PostPosted: Mon Feb 03, 2014 5:42 am    Post subject: NetworkManager problems with both dhclient and dhcpcd Reply with quote

Since I installed Gentoo on my main laptop (~amd64) I had been using the DHCP client dhclient rather than dhcpcd, as the latter never worked with NetworkManager on either of my Gentoo installations (my main laptop runs KDE under Gentoo Testing ~amd64 and my other laptop ran Xfce in Gentoo Stable x86). So, my approach was:

Code:
emerge dhcp
USE="dhclient -dhcpcd" emerge networkmanager

This always worked perfectly.

However, after the latest world update a couple of days ago on my main laptop I found the only way I can get networking functioning again (albeit not perfectly) is to use dhcpcd instead of dhclient as the DHCP client:

Code:
emerge dhcpcd
USE="-dhclient dhcpcd" emerge networkmanager


But dhcpcd is not working reliably on some of the networks I use (although these networks never gave me problems before the latest world update). As you can see below, domain name resolution is not occurring correctly any more:

Code:
# ping www.google.com
ping: unknown host www.google.com
# dhcpcd wlan0
dhcpcd[11462]: dhcpcd already running on pid 11202 (/run/dhcpcd-wlan0.pid)
# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 212.77.192.59
nameserver 212.77.192.60
options single-request
#

Although NetworkManager won't use dhclient automatically any more (i.e. I can no longer get networking to work if I install NetworkManager with USE="dhclient -dhcpcd"), networking works again if I then run dhclient manually:

Code:
# dhclient wlan0
# ping www.google.com
PING www.google.com (173.194.113.145) 56(84) bytes of data.
64 bytes from ham02s11-in-f17.1e100.net (173.194.113.145): icmp_seq=1 ttl=48 time=153 ms
64 bytes from ham02s11-in-f17.1e100.net (173.194.113.145): icmp_seq=2 ttl=48 time=155 ms
64 bytes from ham02s11-in-f17.1e100.net (173.194.113.145): icmp_seq=3 ttl=48 time=156 ms
64 bytes from ham02s11-in-f17.1e100.net (173.194.113.145): icmp_seq=4 ttl=48 time=162 ms
^C
--- www.google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 153.282/157.020/162.909/3.626 ms
# cat /etc/resolv.conf
# Generated by resolvconf
nameserver 212.77.192.59
nameserver 212.77.192.60
#

These are the packages currently installed:

Code:
# eix -I network
[I] kde-base/kdenetwork-filesharing
     Available versions:  (4) 4.11.2(4/4.11) (~)4.11.5(4/4.11) (~)4.12.1(4/4.12)
       {aqua debug}
     Installed versions:  4.12.1(4)(08:34:54 31/01/14)(-aqua -debug)
     Homepage:            http://www.kde.org/
     Description:         kcontrol filesharing config module for SMB

[I] kde-base/kdenetwork-meta
     Available versions:  (4) 4.11.2 (~)4.11.5 (~)4.12.1
       {aqua ppp}
     Installed versions:  4.12.1(4)(11:03:01 31/01/14)(-aqua -ppp)
     Homepage:            http://www.kde.org/
     Description:         kdenetwork - merge this to pull in all kdenetwork-derived packages

[I] kde-misc/networkmanagement
     Available versions:  (4) 0.9.0.10
       {aqua debug openconnect LINGUAS="ar bs ca cs da de el es et fa fi fr ga gl hu ia it ja kk km ko lt mr nb nds nl nn pl pt pt_BR ro ru se sk sl sr sr@Latn sr@ijekavian sr@ijekavianlatin sv tr uk zh_CN zh_TW"}
     Installed versions:  0.9.0.10(4)(16:47:27 01/02/14)(-aqua -debug -openconnect LINGUAS="pt_BR -ar -bs -ca -cs -da -de -el -es -et -fa -fi -fr -ga -gl -hu -ia -it -ja -kk -km -ko -lt -mr -nb -nds -nl -nn -pl -pt -ro -ru -se -sk -sl -sr -sr@Latn -sr@ijekavian -sr@ijekavianlatin -sv -tr -uk -zh_CN -zh_TW")
     Homepage:            https://projects.kde.org/projects/extragear/base/networkmanagement
     Description:         KDE frontend for NetworkManager

[I] net-libs/glib-networking
     Available versions:  2.32.3 (~)2.34.2 2.36.2 (~)2.38.2 {+gnome +libproxy smartcard +ssl test}
     Installed versions:  2.38.2(02:36:04 31/01/14)(libproxy ssl -gnome -smartcard -test)
     Homepage:            http://git.gnome.org/browse/glib-networking/
     Description:         Network-related giomodules for glib

[I] net-misc/networkmanager
     Available versions:  0.9.6.4 0.9.8.8 {avahi bluetooth connection-sharing (+)consolekit dhclient +dhcpcd doc gnutls +introspection modemmanager +nss +ppp resolvconf systemd test vala +wext +wifi wimax KERNEL="linux"}
     Installed versions:  0.9.8.8(15:49:56 02/02/14)(avahi bluetooth consolekit dhcpcd introspection modemmanager nss ppp wext wifi -connection-sharing -dhclient -gnutls -resolvconf -systemd -test -vala KERNEL="linux")
     Homepage:            http://projects.gnome.org/NetworkManager/
     Description:         Universal network configuration daemon for laptops, desktops, servers and virtualization hosts

[I] net-misc/networkmanager-vpnc
     Available versions:  0.9.6.0 (~)0.9.8.2 0.9.8.6 {gtk test}
     Installed versions:  0.9.8.6(17:27:32 01/02/14)(gtk -test)
     Homepage:            http://www.gnome.org/projects/NetworkManager/
     Description:         NetworkManager VPNC plugin

Found 6 matches.
# eix -I dhcp
[I] net-misc/dhcp
     Available versions:  4.2.5_p1 (~)4.2.5_p1-r1 (~)4.2.5_p1-r2 {+client ipv6 ldap selinux +server ssl vim-syntax KERNEL="linux"}
     Installed versions:  4.2.5_p1-r2(15:44:01 02/02/14)(client ipv6 ldap ssl -selinux -server -vim-syntax KERNEL="linux")
     Homepage:            http://www.isc.org/products/DHCP
     Description:         ISC Dynamic Host Configuration Protocol (DHCP) client/server

[I] net-misc/dhcpcd
     Available versions:  5.6.4 (~)6.0.5-r1 (~)6.1.0 6.2.0-r1 (~)6.2.1 **9999 {ipv6 +udev +zeroconf ELIBC="glibc" KERNEL="linux"}
     Installed versions:  6.2.1(15:45:30 02/02/14)(ipv6 udev ELIBC="glibc" KERNEL="linux")
     Homepage:            http://roy.marples.name/projects/dhcpcd/
     Description:         A fully featured, yet light weight RFC2131 compliant DHCP client

Found 2 matches.
#

Code:
# uname -a
Linux meshedgedx 3.9.4-gentoo #1 SMP Thu Jun 13 03:09:36 BST 2013 x86_64 Intel(R) Core(TM) i7 CPU Q 720 @ 1.60GHz GenuineIntel GNU/Linux

As you can see below, I correctly do not have any clashing initscripts launched at startup, as NetworkManager is supposed to take care of everything:
Code:
# rc-update -v show | grep net
                local |      default nonetwork                       
              net.aol |                                               
             net.ath0 |                                               
             net.ath1 |                                               
             net.ath2 |                                               
             net.ath3 |                                               
             net.ath4 |                                               
             net.eth0 |                                               
             net.eth1 |                                               
             net.eth2 |                                               
             net.eth3 |                                               
             net.eth4 |                                               
             net.eth5 |                                               
             net.eth6 |                                               
             net.eth7 |                                               
             net.eth8 |                                               
               net.lo | boot                                         
             net.ppp0 |                                               
             net.ppp1 |                                               
             net.ppp2 |                                               
             net.ppp3 |                                               
              net.ra0 |                                               
              net.ra1 |                                               
              net.ra2 |                                               
              net.ra3 |                                               
              net.ra4 |                                               
              net.ra5 |                                               
            net.wlan0 |                                               
            net.wlan1 |                                               
            net.wlan2 |                                               
            net.wlan3 |                                               
             netmount |      default                                 
               xinetd |                                               
# rc-update -v show | grep dhc
               dhcpcd |                                               
#

With the current set-up (i.e. using NetworkManager and dhcpcd), when I start-up my laptop and use the KDE network management GUI to select a network (let's call it Network1), I can ping an external domain name and I can browse the Internet. However, if I then use the KDE network management GUI to disconnect from Network1 and connect instead to Network2, I cannot ping an external domain name nor browse the Internet. If I then use the command dhclient wlan0 manually, I can ping an external domain name and browse the Internet on Network2. Before doing the world update last weekend, a) NetworkManager manager worked with dhclient, and b) I did not experience any problem switching between the two networks. I don't know if (a) and (b) are related.

Incidentally, if you're wondering why I want to switch between Network1 and Network2, it's because they are separate networks in a building in which I am currently working; one network has a printer and the other does not, and they don't allow access to all the same Web sites. So I have to switch backwards and forwards between the two networks. Except that, as explained above, it is not possible.

My suspicion is that the problem lies with NetworkManager. Anyway, does anyone have any suggestions I could try, either to get dhclient working again with NetworkManager automatically, or to get dhcpcd working reliably? Thanks in advance.
_________________
Fitzcarraldo's blog
Back to top
View user's profile Send private message
Fitzcarraldo
Guru
Guru


Joined: 30 Aug 2008
Posts: 464
Location: United Kingdom

PostPosted: Tue Feb 04, 2014 6:27 am    Post subject: Reply with quote

Here is some actual console output showing what happens (I edited the network names to be Network1 and Network2):

Code:
# # I have started-up my laptop, logged-in to KDE 4.12.1 but not yet selected a network connection via the GUI.
# cat /etc/resolv.conf
# Generated by NetworkManager
options single-request
#
# # Now I have selected network Network1 via the GUI.
# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 172.21.100.103
nameserver 172.21.100.100
nameserver 172.27.1.13
options single-request
# ping -c 5 www.google.com
PING www.google.com (173.194.113.178) 56(84) bytes of data.
64 bytes from ham02s12-in-f18.1e100.net (173.194.113.178): icmp_seq=1 ttl=47 time=153 ms
64 bytes from ham02s12-in-f18.1e100.net (173.194.113.178): icmp_seq=2 ttl=47 time=152 ms
64 bytes from ham02s12-in-f18.1e100.net (173.194.113.178): icmp_seq=3 ttl=47 time=163 ms
64 bytes from ham02s12-in-f18.1e100.net (173.194.113.178): icmp_seq=4 ttl=47 time=159 ms
64 bytes from 173.194.113.178: icmp_seq=5 ttl=47 time=177 ms

--- www.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 32703ms
rtt min/avg/max/mdev = 152.456/161.329/177.509/9.029 ms
#
# # Now I de-select network Network1 & select network Network2 via the GUI.
# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 212.77.192.59
nameserver 212.77.192.60
options single-request
# ping -c 5 www.google.com
ping: unknown host www.google.com
#
# # Now I de-select network Network2 & select network Network1 via the GUI.
# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 172.21.100.103
nameserver 172.21.100.100
nameserver 172.27.1.13
options single-request
# ping -c 5 www.google.com
ping: unknown host www.google.com
#
# # Now I untick & re-tick 'Enable wireless', then re-select network Network1 via the GUI.
# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 172.21.100.103
nameserver 172.21.100.100
nameserver 172.27.1.13
options single-request
# ping -c 5 www.google.com
PING www.google.com (173.194.113.176) 56(84) bytes of data.
64 bytes from ham02s12-in-f16.1e100.net (173.194.113.176): icmp_seq=1 ttl=47 time=157 ms
64 bytes from ham02s12-in-f16.1e100.net (173.194.113.176): icmp_seq=2 ttl=47 time=180 ms
64 bytes from ham02s12-in-f16.1e100.net (173.194.113.176): icmp_seq=3 ttl=47 time=155 ms
64 bytes from 173.194.113.176: icmp_seq=5 ttl=47 time=219 ms

--- www.google.com ping statistics ---
5 packets transmitted, 4 received, 20% packet loss, time 25662ms
rtt min/avg/max/mdev = 155.973/178.339/219.998/25.951 ms
#
# # Now I de-select network Network1 & select network Network2 via the GUI.
# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 212.77.192.59
nameserver 212.77.192.60
options single-request
# ping -c 5 www.google.com
ping: unknown host www.google.com
#
# # Now I untick & re-tick 'Enable wireless', then re-select network Network2 via the GUI.
# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 212.77.192.59
nameserver 212.77.192.60
options single-request
# ping -c 5 www.google.com
ping: unknown host www.google.com
#
# # Now I de-select network Network2 & select network Network1 via the GUI.
# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 172.21.100.103
nameserver 172.21.100.100
nameserver 172.27.1.13
options single-request
# ping -c 5 www.google.com
ping: unknown host www.google.com
#
# # Now I untick & re-tick 'Enable wireless', then re-select network Network1 via the GUI.
# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 172.21.100.103
nameserver 172.21.100.100
nameserver 172.27.1.13
options single-request
# ping -c 5 www.google.com
PING www.google.com (173.194.113.178) 56(84) bytes of data.
64 bytes from ham02s12-in-f18.1e100.net (173.194.113.178): icmp_seq=1 ttl=47 time=153 ms
64 bytes from ham02s12-in-f18.1e100.net (173.194.113.178): icmp_seq=2 ttl=47 time=151 ms
64 bytes from ham02s12-in-f18.1e100.net (173.194.113.178): icmp_seq=3 ttl=47 time=152 ms
64 bytes from ham02s12-in-f18.1e100.net (173.194.113.178): icmp_seq=4 ttl=47 time=174 ms
64 bytes from 173.194.113.178: icmp_seq=5 ttl=47 time=188 ms

--- www.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 32703ms
rtt min/avg/max/mdev = 151.909/163.928/188.081/14.695 ms
#
# # Now I de-select network Network1 & select network Network2 via the GUI.
# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 212.77.192.59
nameserver 212.77.192.60
options single-request
# ping -c 5 www.google.com
ping: unknown host www.google.com
#
# # Now I untick & re-tick 'Enable wireless', then re-select network Network2 via the GUI.
# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 212.77.192.59
nameserver 212.77.192.60
options single-request
# ping -c 5 www.google.com
PING www.google.com (173.194.113.148) 56(84) bytes of data.
64 bytes from ham02s11-in-f20.1e100.net (173.194.113.148): icmp_seq=1 ttl=48 time=153 ms
64 bytes from ham02s11-in-f20.1e100.net (173.194.113.148): icmp_seq=2 ttl=48 time=156 ms
64 bytes from ham02s11-in-f20.1e100.net (173.194.113.148): icmp_seq=3 ttl=48 time=153 ms
64 bytes from ham02s11-in-f20.1e100.net (173.194.113.148): icmp_seq=4 ttl=48 time=151 ms
64 bytes from ham02s11-in-f20.1e100.net (173.194.113.148): icmp_seq=5 ttl=48 time=153 ms

--- www.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4031ms
rtt min/avg/max/mdev = 151.670/153.608/156.595/1.642 ms
#
# # Now I de-select network Network2 & select network Network1 via the GUI.
# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 172.21.100.103
nameserver 172.21.100.100
nameserver 172.27.1.13
options single-request
# ping -c 5 www.google.com
ping: unknown host www.google.com
#
# # Now I untick & re-tick 'Enable wireless', then re-select network Network1 via the GUI.
# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 172.21.100.103
nameserver 172.21.100.100
nameserver 172.27.1.13
options single-request
# ping -c 5 www.google.com
PING www.google.com (173.194.113.145) 56(84) bytes of data.
64 bytes from ham02s11-in-f17.1e100.net (173.194.113.145): icmp_seq=1 ttl=47 time=155 ms
64 bytes from ham02s11-in-f17.1e100.net (173.194.113.145): icmp_seq=2 ttl=47 time=156 ms
64 bytes from ham02s11-in-f17.1e100.net (173.194.113.145): icmp_seq=3 ttl=47 time=161 ms
64 bytes from ham02s11-in-f17.1e100.net (173.194.113.145): icmp_seq=4 ttl=47 time=173 ms
64 bytes from 173.194.113.145: icmp_seq=5 ttl=47 time=190 ms

--- www.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 32753ms
rtt min/avg/max/mdev = 155.158/167.365/190.058/13.107 ms
#

_________________
Fitzcarraldo's blog
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum