Ubuntu 上网设置

作者: shaoliang 2020-03-30 08:36   访问数:614

vim /etc/network/interfaces


ifconfig



auto enp1s0

iface enp1s0 inet dhcp


#auto lo

#iface lo inet loopback



#auto enp1s0

#iface enp1s0 inet static

#address 192.168.1.3

#netmask 255.255.255.0

#gateway 192.168.1.1





网卡为 enp1s0




# interfaces(5) file used by ifup(8) and ifdown(8)

auto enp1s0
iface enp1s0 inet dhcp
auto enp1s0
iface enp1s0 inet dhcp

#dhcp 为自动 动态获得ip




下面为静态ip,失败了


auto enp1s0
 iface enp1s0 inet static
address 192.168.1.9
netmask 255.255.255.0
gateway 192.168.1.1


设置好之后

重启网卡

systemctl restart networking


再次ifconfig

2020-03-29 21-28-47 的屏幕截图.png


IP地址自己改了,可以上网了


原因可能是与爱快路由器冲突?

将爱快路由器静态IP删除(就是用动态)



这个时候出现了问题,,有线未托管


原因可能是 network-manager图形界面,跟 interface 冲突,

systemctl disable network-manager

systemctl stop network-manager

世界清净了

鲁ICP备19029146号-1 管理
CopyRight@51dr.top 页面打开时间 0.0328 秒.