赞
踩
1、修改配置文件
- vi /etc/netplan/01-network-manager-all.yaml
- ########配置文件如下:############
- network:
- version: 2
- renderer: NetworkManager
- ethernets:
- ens33: # 你的网络接口名称可能不是 eth0,请根据实际情况进行调整
- dhcp4: no
- dhcp6: no
- addresses: [172.16.4.88/24] # 你想要分配的静态 IP 地址和子网掩码
- routes:
- - to: 0.0.0.0/0
- via: 172.16.4.254 # 网关地址
- nameservers:
- addresses:
- - 114.114.114.114 # DNS 地址
- ~
2、加载配置
sudo netplan apply
问题1:
** (process:6048): WARNING **: 15:26:58.220: Permissions for /etc/netplan/01-network-manager-all.yaml are too open. Netplan configuration should NOT be accessible by others.
解决办法:
sudo chmod 600 /etc/netplan/01-network-manager-all.yaml
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。