How to set up ubuntu server 22.04 minimal networking?

And I know the title seems like dumb, But after some try I think I get into struggle with ubuntu server 22.04 minimal install:

When installing and first boot up, Everything working fine, But soon I notice there is no iproute2 installed. After install I reboot the system.

After reboot. Network is gone. Yes, gone.

I manually using iproute2 to config networking:

PS: ip is fake

ip link set dev ens160 up
ip address add dev ens160 10.0.0.50/24
ip route add 10.0.0.1 dev ens160
ip route add default via 10.0.0.1

Then

ping 1.1.1.1

Oh, come on. Ping is not even installed. Then I try to apt update but get an working 0% failed.

Question: How to config network in ubuntu server 22.04 ?

Should I just install netplan when first boot ?

Edit1: Something wired happend,I create another VM and do same install process, Ping and IPRouter2 netplan exist after install. And no matter how reboot , netplan will handle the networking

I can't reproduce this behiver again

2

1 Answer

For server, I prefer ifupdown and edit /etc/network/interfaces. Netplan is a higher-level tool, which generates config for ifupdown / networkmanager. You don't need to use it if you want to keep your server minimal.

See Ubuntu 18.04: switch back to /etc/network/interfaces

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

You Might Also Like