ubuntu修改IP地址为静态IP
01-切换到如下目录
02-查看网关信息
route -n
03-编辑.yaml文件
切换到目录/etc/netplan,编辑.yaml结尾的文件
sudo vim /etc/netplan/50-cloud-init.yaml
替换如下内容
# Let NetworkManager manage all devices on this system #network: # version: 2 # renderer: NetworkManager # ethernets: # enp6s0: # dhcp4: yes network: version: 2 ethernets: ens33: dhcp4: no addresses: [192.168.192.11/24] optional: true gateway4: 192.168.192.2 nameservers: addresses: [114.114.114.114,8.8.8.8] renderer: networkd
04-使之生效
sudo netplan apply
05-重启系统
reboot
获取课件V: fmjava01