ubuntu重置网络配置

时间:2024-01-30 17:14:36

>重置网络

sudo service network-manager stop 
sudo rm /var/lib/NetworkManager/NetworkManager.state 
sudo service network-manager start

>配置网络

ifconfig -a //查看所有网卡信息

 

sudo ifconfig eth0 192.168.1.11 netmask 255.255.255.0  //配置ip地址 和 子网掩码

sudo route add default gw 192.168.1.1  //设置网关