1.查看当前ip ifconfig
2.cd /etc/netplan
3.编辑文件yaml 跳到行尾 esc + shif +$

network:
  version: 2
  renderer: NetworkManager
  ethernets:
    enp0s5:   # 网卡名称
      dhcp4: no     # 关闭dhcp
      dhcp6: no
      addresses: [10.211.55.10/24]  # 静态ip
      gateway4: 10.211.55.1     # 网关
      nameservers:
        addresses: [8.8.8.8, 114.114.114.114] #dns

4.sudo netplan apply
5.再次查看ip ifconfig


猴子哥99
0 声望0 粉丝

下一篇 »
ubuntu安装显卡