M HYPE SPLASH
// updates

Ubuntu Desktop 20.04 - Netplan - Can't ping gateway, but DNS resolves

By Emily Wilson

I'm new to Linux but a veteran with Windows, to start i'm working with Ubuntu-Desktop 20.04LTS - new install.

When connected to the network via DHCP everything just works, however I need to set a static IP.

There is no difference if I configure the static IP through the GUI or edit the /etc/netplan/01-Network-Manager-All.yaml file I cannot ping the gateway or any other inside or outside addresses with the exception of the two internal DNS servers. I can still however browse webpages and download packages.

Please see my configuration file below.

network: version: 2 renderer: NetworkManager ethernets: enp5s0: dhcp4: no addresses: [10.0.2.3/21] gateway4: 10.0.1.1 nameservers: addresses: [10.0.8.10,10.0.8.12]

When I run "ip route," on the static IP config I get these results

default via 10.0.1.1 dev enp5s0 proto static metric 100
10.0.0.0/21 dev enp5s0 proto kernel scope link src 10.0.2.3 metric 100
169.254.0.0/16 dev enp5s0 scope link metric 1000

If I connect via DHCP, "ip route" it yields the same results except with the dynamic IP. I can then ping everywhere again.

1 Answer

If ping works when you have the address assigned by DHCP, but not when you assign an address statically, this sounds like your DHCP server is coordinating with your switches to filter traffic and only machines that have been granted DHCP leases are allowed to send certain traffic.

There's nothing fundamentally wrong with your netplan config, it looks like it just isn't compatible with your network.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy