ip route returns an empty string

When I connect the network cable on my laptop to my router, I get network access. Even if I then disconnect the network cable, I still have network access.

When booting (or sudo rcnetwork restart) without the network cable attached, I have no internet access and no default route (ip route returns an empty string).

I’m using wicked and configuring using YAST, but I’m obviously not configuring Network Settings properly. Please provide a step-by-step YAST setup to configure ens33 via DHCP. My default gateway is 192.168.1.1.

To configure a wicked connection:

I use

Yast → System → Network Settings

It usually comes up showing the “Overview” tab.

I select the network device, and click edit. And I set it to use DHCP.

That’s about all there is to it.

While editing the settings for that device, you can click the “General” tab. When I do that here, it shows the device will be activated at boot time. You could perhaps change that to “On Hotplug” and see whether that gives better results.

This is what I have:

Device Name: ens33
Configured with dhcp
Started automatically at boot

I tried Activate Device on Hotplug and also On Cable Connection, but that didn’t help.

Well, that was worth trying.

I normally don’t unplug the ethernet here. On the rare occasions that I do, I will use:

systemctl restart network

to make sure that everything knows about the change.

try this as root (or add sudo)
route add default gw 192.168.1.1 ens33

I don’t have the route command so I tried:

sudo ip route add default via 192.168.1.1 dev ens33

and a dozen variations. This one says Error: Nexthop has invalid gateway.

When I restart the network with the network cable attached to the router, ip route displays:

default via 192.168.1.1 dev ens33 proto dhcp
192.168.1.0/24 dev ens33 proto kernel scope link src 192.168.1.241

When I disconnect the network cable I still have connectivity and ip route gives me the same result as above.

I really don’t want my laptop tethered to my router. I’ve recently added a new router but my Windows 10 laptop host has no problem connecting to it. I have always used a bridged connection to virtualize the ip hardware for my vmware opensuse tumbleweed guest. Now, it isn’t working and ip route displays nothing.

Actually, this may be a VMWare problem. I just changed the IP setting on the virtual machine from bridged to nat and it now gives me a wireless connection.

$ sudo systemctl restart network
$ ip route
default via 192.168.221.2 dev ens33 proto dhcp
192.168.221.0/24 dev ens33 proto kernel scope link src 192.168.221.128
$

I also just upgraded from VMWare Workstation 15.x to Workstation 16.
I’ll take it this up with VMWARE.
Thanks, everyone.

Surprise!

Next time, please inform us about what you have and do. That VM is a complete surprise.

I had to refresh/renew the dhcp lease. It seems that upgrading to VMWare Workstation 16.0 lost the default route.

sudo dhclient -r ens33
sudo dhclient ens33

It seems that upgrading to VMWare Workstation 16.0 lost the default route. I had to release/renew the dhcp lease.

sudo dhclient -r ens33 # release
sudo dhclient ens33 # renew