Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 31893  / 2 Years ago, wed, august 17, 2022, 11:49:04

Recently, whenever I try to connect to Ethernet, Ubuntu detects the LAN wire but takes a long time(about 10min) to get the IP address.



Output of nm-tool:



Type: Wired
Driver: r8169
State: connecting (getting IP configuration)
Default: no
HW Address: ----------

Capabilities:
Carrier Detect: yes
Speed: 100Mb/s

Wired Properties:
Carrier: on


There is no problem with DHCP server. Windows connects to the same LAN very fast.



Contents of /etc/network/interfaces



# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback


What might cause this problem?



EDIT:



Output of ifconfig



eth0      Link encap:Ethernet  HWaddr e8:03:9a:b6:d1:2a  
inet addr:10.2.64.198 Bcast:10.2.95.255 Mask:255.255.224.0
inet6 addr: fe80::ea03:9aff:feb6:d12a/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1123164 errors:0 dropped:0 overruns:0 frame:0
TX packets:582761 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1503341500 (1.5 GB) TX bytes:56327121 (56.3 MB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:119202 errors:0 dropped:0 overruns:0 frame:0
TX packets:119202 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7588901 (7.5 MB) TX bytes:7588901 (7.5 MB)


Output of dmesg : Pastebin Link


More From » networking

 Answers
3

Here are couple of suggestions, but by no means definitive answers:



Try different dhcp client



If you search with apt-cache search dhcp | less, you will see quite a few alternatives to dhcp that comes by default. For instance, I'd suggest getting dhcpcd. I'm not sure if NetworkManager changes it's settings automatically once you install dhcpcd, but I'd suggest opening the /etc/NetworkManager/NetworkManager.conf and under [main] section specify dhcp=dhcpcd, like so. At least according to man NetworkManager.conf :




Presently dhclient and dhcpcd are sup‐ ported. The client configured
here should be avail‐ able on your system too. If this key is missing,
available DHCP clients are looked for in this order: dhclient, dhcpcd.




Disable dnsmasq plugin



dns=dnsmasq is another option that is specified in the NetworkManager.conf. The reason why I'd disable it, is because dnsmasq would fetch the dns server from the default gateway (aka your router), and that is also one of the elements in the "getting ip configuration" process. Simply comment out that plug in, like so # dns=dnsmasq. Small thing to keep in mind is that NetworkManager then won't resolve domain names. Thus, I suggest changing dns settings altogether. Also, think about deleting /etc/resolv.conf to let things reset or at least sudo dpkg-reconfigure resolvconf.



Delete connection configurations and reconnect



This can be done either through connections editor (Edit connections option in the drop-down menu ornm-connection-editor from terminal). Also, sudo rm -i /etc/NetworkManager/system-connections/* will do the trick.



Disable NetworkManager from creating a default wired connection



Again, it's in NetworkManager.conf, under [main], option should be no-auto-default=*



Try WICD network manager



I suppose that is self explanatory . . .



Examine /etc/dhcp/dhclient.conf file



You can compare with my configuration :



#send host-name "andare.fugue.com";
send host-name = gethostname();
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
#send dhcp-lease-time 3600;
supersede domain-name-servers 208.67.222.222,208.67.220.220,8.8.8.8;
# prepend domain-name-servers 208.67.222.222,208.67.220.220;
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, domain-search, host-name,
dhcp6.name-servers, dhcp6.domain-search,
netbios-name-servers, netbios-scope, interface-mtu,
rfc3442-classless-static-routes, ntp-servers,
dhcp6.fqdn, dhcp6.sntp-servers;


Among other things, I'd also suggest that you add information from ifconfig, what ethernet card you have, and output of dmesg to your questoin. Cheerios !


[#21650] Friday, August 19, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aciousoun

Total Points: 178
Total Questions: 110
Total Answers: 98

Location: Lithuania
Member since Fri, Sep 4, 2020
4 Years ago
;