ubuntu18.04设置静态ip

# sudo gedit /etc/netplan/server.yaml 
# Let NetworkManager manage all device on this system
network:
  version: 2
  ethernets: 
    enp2s0:
      addresses:
      - 192.168.50.177/24
      dhcp4: false
      gateway4: 192.168.50.1
      nameservers:
        addresses:
        -  8.8.8.8

sudo netplan apply

你可能感兴趣的:(ubuntu)