Why can't I access the internet when using static ip in a vm? (Netplan)

Solution 1:

I see while you are making it static still it does ping its gateway, So, most probably of the issue is cause of DNS, set the DNS also.

echo 'nameserver 8.8.8.8' > /etc/resolv.conf

In case you want to add DNS in netplan:

> nameservers:
>         addresses:
>         - 8.8.8.8
>         - 1.0.0.1