0

I need to restart my networking in ubuntu 20 as I do not have ifconfig or ifdown or ifup. Right now my vps ubuntu box has no internet, and I am logged in via the web console. When I do a ping 8.8.8.8, I do not get a response and it doesnt look like it can reach repositories for me to do apt install ifconfig neither. I want to try to turn off and on the networking to see if that works. Or is there another way to troubleshoot?

1
  • Try sudo systemctl restart NetworkManager. Jan 17, 2021 at 21:32

1 Answer 1

0

You should use iproute2 commands:

Temporary ip assignment:

sudo ip addr add ip/24 dev <interface>
ip link set dev <interface> up
sudo ip route add default via <gateway>

Persistent ip assignment:

edit /etc/netplan/99_config.yaml file , here is an example for dhcp:

network:
  version: 2
  renderer: networkd
  ethernets:
    <interface>:
      dhcp4: true

Then run:

sudo netplan apply

Netplan configuration examples

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .