View previous topic :: View next topic |
Author |
Message |
ExecutorElassus Veteran
Joined: 11 Mar 2004 Posts: 1435 Location: Berlin, Germany
|
Posted: Thu Oct 12, 2017 7:20 pm Post subject: DNS with dhcpcd and WiFi |
|
|
I have a laptop running gentoo, and it consistently has issues with WiFi. I can add access points by editing /etc/wpa_supplicant/wpa_supplicant.conf, and it connects fine. Ping with an IP address works fine, but ping with a URL returns nothing at all, and I get errors about "unable to resolve address" issues from the browser.
/etc/resolv.conf has four IP addresses manually entered (two each for OpenDNS and google), plus one added by the router from dhcpcd.
How can I debug why DNS lookups aren't working, and how can I fix it?
Cheers,
EE |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
ExecutorElassus Veteran
Joined: 11 Mar 2004 Posts: 1435 Location: Berlin, Germany
|
Posted: Fri Oct 13, 2017 4:07 am Post subject: |
|
|
What package provides dig? I don't seem to have it installed.
Also, the four nameservers I have listed are apparently added to resolv.conf, as deleting them gets overwritten on reboot. Where else might I have them listed?
Cheers,
EE
Update: I take it back. It's not just DNS: commenting out two nameservers, I could resolve addresses. But then I got "destination host unreachable" errors. Even checking with ping, it can't get past the router. So wifi connects to the router, but cant get past it. How can I debug this and fix it? |
|
Back to top |
|
|
bbgermany Veteran
Joined: 21 Feb 2005 Posts: 1844 Location: Oranienburg/Germany
|
Posted: Fri Oct 13, 2017 5:52 am Post subject: |
|
|
Hi,
did you set a default route? Please check with
greets, bb _________________ Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB |
|
Back to top |
|
|
ExecutorElassus Veteran
Joined: 11 Mar 2004 Posts: 1435 Location: Berlin, Germany
|
Posted: Fri Oct 13, 2017 3:04 pm Post subject: |
|
|
'netstat -rn' returns:
Code: | #netstat -rn
Kernel IP routing table
Destination. Gateway. Genmask. Flags. MSS Window. irtt. Iface
0.0.0.0. 192.168.1.1 0.0.0.0. UG. 0 0. 0. enp4s0
0.0.0.0. 192.168.2.1 0.0.0.0. UG. 0 0. 0. wlp3s0
192.168.1.0. 0.0.0.0. 255.255.255.0 U. 0 0. 0. enp4s0
192.168.2.0. 0.0.0.0. 255.255.255.0. U. 0 0. 0. wlp3s0
|
Sorry for all the terminal periods. I'm typing on a phone .
See anything here?
Cheers,
EE |
|
Back to top |
|
|
bbgermany Veteran
Joined: 21 Feb 2005 Posts: 1844 Location: Oranienburg/Germany
|
Posted: Fri Oct 13, 2017 4:07 pm Post subject: |
|
|
Hi,
there is your issue; two default gateways and no metric. Your system doesnt know which way it should go and where the packages return.
greets, bb _________________ Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB |
|
Back to top |
|
|
UberLord Retired Dev
Joined: 18 Sep 2003 Posts: 6835 Location: Blighty
|
|
Back to top |
|
|
ExecutorElassus Veteran
Joined: 11 Mar 2004 Posts: 1435 Location: Berlin, Germany
|
Posted: Sun Oct 15, 2017 10:56 am Post subject: |
|
|
'ip r' returns:
Code: | #ip r
default via 192.168.1.1 dev enp4s0 metric 2 linkdown
default via 192.168.2.1 dev wlp3s0 src 192.168.2.52 metric 304
192.168.1.0/24 dev enp4s0 proto kernel scope link src 192.168.1.3 linkdown
192.168.2.0/24 dev wlp3s0 proto kernel scope link src 192.168.2.52 metric 304 |
When I'm at home I use ethernet (enp4s0) but when elsewhere use WiFi (wlp3s0). Is something misconfigured here?
Cheers,
EE |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3137
|
Posted: Sun Oct 15, 2017 5:30 pm Post subject: |
|
|
Does it start working either after removing this route manually:
Code: | default via 192.168.1.1 dev enp4s0 metric 2 linkdown |
or restarting dhcpcd?
Lower metric has higher priority, so it is possible that you attempt to send packets via a disconnected wired NIC. I never really used dhcpcd in daemon mode, don't know how it handles such cases.
I don't move my box very often, and I've always had more "gui friendly" managers on my laptops. |
|
Back to top |
|
|
ExecutorElassus Veteran
Joined: 11 Mar 2004 Posts: 1435 Location: Berlin, Germany
|
Posted: Sun Oct 15, 2017 5:39 pm Post subject: |
|
|
I didn't get better results restarting dhcpcd; how do I remove that route manually?
Cheers,
EE |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3137
|
Posted: Sun Oct 15, 2017 9:26 pm Post subject: |
|
|
Code: | ip route del default dev enp4s0 |
Did the default route go away from wired NIC after restarting dhcpcd? (And before invoking the above command) |
|
Back to top |
|
|
ExecutorElassus Veteran
Joined: 11 Mar 2004 Posts: 1435 Location: Berlin, Germany
|
Posted: Mon Oct 16, 2017 9:15 am Post subject: |
|
|
no, restarting dhcpcd did not remove that route. However, removing it manually did enable me to get a working internet, hurrah!
Now: how do I ensure that the routes associated with enp4s0 aren't active when I'm not connected to an ethernet cable, so that only the routes associated with wlp3s0 are used?
Thanks for the help! It's almost there!
EE |
|
Back to top |
|
|
nokilli Apprentice
Joined: 25 Feb 2004 Posts: 196
|
Posted: Mon Oct 16, 2017 9:22 am Post subject: |
|
|
Not saying this is right, but I've always been manually starting and stopping these things.
Code: | rc-service net.wlan0 stop |
Code: | rc-service net.enp5s0 start |
And I've never had the issues you're experiencing. Then too, I don't run a Gnome or KDE which handles this stuff for you. _________________ Today is the first day of the rest of your Gentoo installation. |
|
Back to top |
|
|
|