Able to SSH via WLAN but unable to connect to the internet

Hi.

For some reason, I had to assign a static IP to my Jetson device so that other devices could always find it at the same IP. As the devices were to be connected via Ethernet, I created a new file eth0 in /etc/network/interfaces.d/eth0 and populated it as:

auto eth0
iface eth0 inet static
address 10.0.0.1 
netmask 255.0.0.0
gateway 192.168.1.254

This worked as intended but wouldn’t let me connect to the internet so whenever I needed to, I’d rather used WLAN.

But now as I have switched to a different WiFi device, I asked Jetson to connect to this new WiFi using nmcli (and the network’s SSID & password). Now, Jetson won’t connect to the internet.

The static IP I chose for the eth0 was 10.0.0.1 and the WiFI dongle assigns 192.168.1.100/105 to Jetson. I confirm this using ifconfig

#....
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 10.0.0.1  netmask 255.0.0.0  broadcast 10.255.255.255
        ether 00:04:4b:cb:ab:ad  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 40 
#...
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.100  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::8ac:88e5:38a5:746d  prefixlen 64  scopeid 0x20<link>
        ether 0c:54:15:b6:63:9f  txqueuelen 1000  (Ethernet)
        RX packets 722290  bytes 226415836 (226.4 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7651  bytes 1978671 (1.9 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

When I try to ping google.com, I get

jetson@jetson-desktop:~$ ping google.com
PING google.com (142.250.182.142) 56(84) bytes of data.
From jetson-desktop (10.0.0.1) icmp_seq=1 Destination Host Unreachable
^C
--- google.com ping statistics ---
6 packets transmitted, 0 received, +1 errors, 100% packet loss, time 5088ms
pipe 4

I noticed that it tries to use the static IP. How can I connect to the internet ?


Also checked dmesg and found

Intel(R) Wireless WiFi driver for Linux
[    6.986955] Copyright(c) 2003- 2015 Intel Corporation
[    6.987264] iwlwifi 0003:01:00.0: enabling device (0000 -> 0002)
[    6.991026] iwlwifi 0003:01:00.0: Direct firmware load for iwlwifi-8265-26.ucode failed with error -2
[    6.991216] iwlwifi 0003:01:00.0: Falling back to user helper
[    7.174902] random: crng init done
[    7.174992] random: 7 urandom warning(s) missed due to ratelimiting
[    7.413344] EXT4-fs (nvme0n1p1): recovery complete

Good afternoon!

Have you tried assigning the static IP on the router?

I do not wish a static IP on the router. Also, I actually don’t know how to do it; its like a small wireless portable hotspot. I don’t understand how the static IP on eth0 is stopping the wlan to provide an internet connection

Hm. Well the hotspot is what is giving your items the local IP address. Maybe because it is a portable thing that it doesn’t provide the same IP addresses on reboot? I imagine there is some way to get into the settings of the device, and if you provide a static IP from there you might be able to achieve what you are looking for. However, if you need to use the internet on the device and need to SSH into it, try using this article we made. You might find it provides what you need: working internet and a keyless (does not care about IP addresses) SSH tunnel.

I am able to SSH using a static IP on the eth0 and that’s what I intended to do. I didn’t mess with the wlan0 device and expect it to work normally; i.e., provide me some dynamic IP and access to the internet.

But I don’t understand why the eth0 device hinders the activity of wlan0

Maybe @linuxdev can help here.

Also, the keyless solution is amazing and I would try it soon but its not related to the problem here.

The “normal” use case which Ubuntu sets up for is that if a user logs in and WiFi is accessible, that this takes precedence over wired. This behavior can be changed (such as by setting up a static address on eth0). “Network manager” (managed networks) can cause one interface to go down when another comes up…or the equivalent, that WiFi could have a higher priority metric, and then anyone trying to reach an address to the outside world would try to instead use WiFi even if wired is up (in the case of routes not exactly matching an interface, and when there is more than one interface which might route to the desired destination, the lowest metric determines which interface is used…see the output of command “route”).

Incidentally, if you set up a static IP address, then you don’t need to the router to know, nor participate, unless the router accidentally assigns the same IP address to another DHCP device. Then you’d get a network collision. The router could be set up to never issue that specific address.

You might want to examine the output of both “ifconfig” and “route” when (A) it works with just one interface, and again after (B) things fail to work as expected. Mostly network management software will be causing the changes. Static IP addresses are not managed.

1 Like