ubuntu修改网卡ip

 sudo nano /etc/netplan/01-network-manager-all.yaml

network:
version: 2
renderer: NetworkManager
ethernets:
 ens33:
  dhcp4: no
  addresses:
  - 192.168.72.140/24 (修改为自己的ip)
  gateway4: 192.168.72.2 
  nameservers:
   addresses: [8.8.8.8, 8.8.4.4]

$ sudo netplan try

你可能感兴趣的:(linux,ubuntu)