1

I am not sure ... but as I updated Ubuntu 22.04 & its kernel & restarted, I am being blocked from accessing the internet; though I am connected & can access & login the router's admin pages.

My smartphone which is in the same wifi has no problems.

Anything happened when updating that blocked the laptop ?



Update

I am not using Ethernet as I do not have the Ethernet cable right now, so I cannot comment on it at the moment.

My wifi chip based upon the command :

$ lspci -knn | grep Net -A2
02:00.0 Network controller [0280]: Intel Corporation Wireless 7260 [8086:02b1] (rev 73)
    Subsystem: Intel Corporation Wireless-N 7260 [8086:4462]
    Kernel driver in use: iwlwifi


Update 2

With$ ping 8.8.4.4 I get Destination Host Unreachable :

$ping 8.8.4.4
PING 8.8.4.4 (8.8.4.4) 56(84) bytes of data.
From 192.168.1.162 icmp_seq=1 Destination Host Unreachable
From 192.168.1.162 icmp_seq=2 Destination Host Unreachable
From 192.168.1.162 icmp_seq=3 Destination Host Unreachable

I see packets transmitted when tethering.

Also, when with tethering :

$ ip route show
default via 192.168.1.1 dev br0 proto static metric 100 linkdown 
default via 192.168.42.129 dev usb0 proto dhcp metric 100 
default via 192.168.0.1 dev wlan0 proto dhcp metric 600 
169.254.0.0/16 dev wlan0 scope link metric 1000 
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.109 metric 600 
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.162 linkdown 
192.168.42.0/24 dev usb0 proto kernel scope link src 192.168.42.167 metric 100 
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown 

$ dig google.com
; <<>> DiG 9.18.1-1ubuntu1.2-Ubuntu <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 13107
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;google.com.            IN  A

;; ANSWER SECTION:
google.com.     285 IN  A   142.250.196.46

;; Query time: 4 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Wed Nov 23 17:04:43 +0545 2022
;; MSG SIZE  rcvd: 55

And with Wifi only :

$ ip route show
default via 192.168.1.1 dev br0 proto static metric 100 linkdown 
default via 192.168.0.1 dev wlan0 proto dhcp metric 600 
169.254.0.0/16 dev wlan0 scope link metric 1000 
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.109 metric 600 
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.162 linkdown 
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown 


$ dig google.com
; <<>> DiG 9.18.1-1ubuntu1.2-Ubuntu <<>> google.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45316
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;google.com.            IN  A

;; ANSWER SECTION:
google.com.     102 IN  A   142.250.196.46

;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53) (UDP)
;; WHEN: Wed Nov 23 17:12:16 +0545 2022
;; MSG SIZE  rcvd: 55

I see there is a slight difference in ip route show.

It seems the packets are not able to get past the gateway when using wifi (?) .



Update 3

Wifi works fine when using a live cd.

When booting normally, I cannot access the net using mobile hotspot wireless alone.

Something wrong with the wireless settings of current Ubuntu ?



Update 4

I think VirtualBox had installed the bridge, and I use VirtualBox regularly.

maan81
  • 605
  • 1
  • 6
  • 22
  • Please [update your question](https://askubuntu.com/posts/1441962/edit) with all the new information. – user68186 Nov 22 '22 at 14:07
  • Have you tried biting booting from the older kernel? Press the ESC key when you turn on the laptop to get the grub menu. Go to advanced options and select the second kernel from top. – user68186 Nov 22 '22 at 14:13
  • Updated. Btw, now, I am using internet thru laptop using USB tethering from my mobile. – maan81 Nov 22 '22 at 14:14
  • In what way(s) exactly are you blocked from accessing the internet? Can you ping google.com from a terminal for example? Can you ping an external location (like 8.8.4.4) by IP? If you can access your router's admin page then the issue is more likely to be one of routing or address resolution than a physical layer problem – steeldriver Nov 22 '22 at 14:19
  • tried it. cannot ping to google. but can ping to the current ip address of laptop -- ``ping 192.168.0.109`` and ``ping 127.0.0.1`` – maan81 Nov 22 '22 at 14:23
  • @user68186 not working from the earlier kernel. i see some txt msg just before shutdown saying something like network configuration error.. It lasted for fraction of a sec before I can read it completely. – maan81 Nov 22 '22 at 14:54
  • @steeldriver Is there something I should do ? I think there was a network error; which went away before I can read. – maan81 Nov 22 '22 at 14:55
  • `ping 8.8.4.4` would be more useful than `ping 192.168.0.109` since it tells us whether packets can get past the gateway (router) - if they can, then the remaining issue is likely DNS resolution. Please [edit] results into your question as text. Other potentially useful diagnostics are `ip route` or `ip route show` and `dig google.com`. – steeldriver Nov 22 '22 at 15:27
  • 1
    First the good news, USB tethering to mobile works means Ethernet works (more or less). So the problem is limited to WiFi only. I had a similar problem resulting from a `linux-firmware` update. But that was for a different WiFi chip and a different distro. Please don't post pictures and screenshots of the terminal. Copy the text from the terminal and paste it directly into the question. Then format the pasted text as `code` using the {_} icon above the edit question window. You may have to do some juggling to get it out of the laptop that won't connect to the Internet. – user68186 Nov 22 '22 at 15:45
  • 1
    Might be worth trying tethering to your mobile via WiFi, ie using your mobile as a hotspot, if you can. Not suggesting it’s solving anything, but would help to focus on what / where the problem is. – Will Nov 23 '22 at 12:04
  • The Live ISO may be loading "non-free" firmware blobs for wireless chipsets, etc. to increase compatibility. Non-free software/firmware may not be auto-installed unless specifically enabled. – svin83 Nov 27 '22 at 10:17
  • Does [this](https://askubuntu.com/a/1263453/906933) help you?? – kanehekili Nov 27 '22 at 23:37

1 Answers1

5

maan81 did a pretty good job isolating this issue to the route table:

  1. Testing with the installation disk eliminated all hardware as a cause - smart start.
  2. Connecting to the wireless router validated the wlan0 connection configuration.

Two very savvy steps. So why can you connect to the wireless router but no traffic bound for Internet can?

The problem becomes apparent in maan81's route table:

$ ip route show
default via 192.168.1.1 dev br0 proto static metric 100 linkdown 
default via 192.168.0.1 dev wlan0 proto dhcp metric 600 
169.254.0.0/16 dev wlan0 scope link metric 1000 
192.168.0.0/24 dev wlan0 proto kernel scope link src 192.168.0.109 metric 600 
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.162 linkdown 
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown 

The route via br0 (which goes nowhere because it is in a linkdown state) has a lower metric (100) than the wlan0 route (600). This means it wins all the traffic except that bound for the 192.168.0.1 subnet. There is an interface directly on that subnet so default routing does not apply to that traffic.

Who's in charge here?

First step you should take is determine what network manager is in charge. In the vast majority of cases it will be NetworkManager.

Sadly, maan81 and I skipped this step assuming NetworkManager was running the show and were led a merry chase for two days as the bridge br0 kept popping back up with every reboot.

# Determine network renderer
netplan get renderer

If your renderer is NetworkManger you can skip down to Troubleshooting technigues.

If your renderer is networkd, then you are running netplan and all your issues are in /etc/netplan/*.yaml. Please refer to Canonical Netplan for complete documentation. If you intend to stick with netplan, some of what follows may be useful but netplan is too big a subject to be handled in the scope of this answer.

maan81 was indeed running netplan and opted to revert to NetworkManager.

Revert from netplan to NetworkManager

The following is performed as root. The cat...EOF command must be executed as a contiguous block. Mind you don't mess up the indentations on the .yaml file - netplan is picky about such things.

mkdir /etc/netplan/old
mv /etc/netplan/*.yaml /etc/netplan/old
cat << 'EOF' > /etc/netplan/01-network-manager-all.yaml
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
EOF
netplan generate && netplan apply && shutdown -r now

This is what ultimately resolved maan81's network issues. What follows are some of the "tools" we used to arrive at this solution.

Troubleshooting

Backing up your route table:

# Backup the route table
sudo ip route save > route.bin
# Recover the route table
sudo ip route restore < route.bin

Bridge manipulation:

# take bridge br0 down
sudo ip link set br0 down
# bring up bridge br0
sudo ip link set br0 up
# delete bridge br0 (requires bridge-utils)
sudo ip link set br0 down && sudo brctl delbr br0 

Change connection metric

# list connections
nmcli connection
# list devices
nmcli device
# set connection metric # requires link dn/up to take effect
nmcli connection modify <name> ipv4.route-metric <metric>

Brute force overwrite of default route

# Delete the default routes
sudo ip route del default
# Recreate new route to wireless router IP
sudo ip route add default via 192.168.0.1 metric 50 

Summary:

In the professional world, running multiple default routes is considered very bad practice. After all, "multiple" and "default" are contradictory concepts.

For user desktops, NetworkManager handles this automatically for you but does not always get it right. If you have more than one active network interface, it will create multiple default routes. When that happens, the metric determines where your Internet traffic flows.

Frobozz
  • 655
  • 2
  • 16