- 查看网卡
ip addr
- 修改配置文件
sudo vim /etc/network/interfaces
添加:
auto eth160
iface eth0 inet static
address 192.168.23.203 #配置没有被使用的ip地址
netmask 255.255.255.0
gateway 192.168.23.254 #写入网关地址
dns-nameservers 114.114.114.114 #写dns解析地址
- 重置网络
/etc/init.d/networking restart
- 查看ip