因电脑未加域导致Ubutu上获取的IP与其他主机冲突。
- 方法一
# 查看出网卡驱动名为enp4s0
ifconfig
# 关闭当前网卡驱动
ifconfig enp4s0 down
# 启动本机网卡
ifconfig enp4s0 up
- 方法二
# 释放当前ip
dhclient -r
# 开启当前ip
dhclient
当使用上面两种方法后还是没有改变IP地址,还是处于冲突状态
- 查看网络是否正常可ping一个内网络,如发现遗失包的现象即为不正常
需要进行动态IP设置
# 编辑网卡配置文件
vi /etc/network/interfaces
auto lo
iface lo inet loopback
auto enp4s0
# 加上这行
iface enp4s0 inet dhcp
# 注释掉这行
# iface enp4s0 inet static
- 之后重启networking服务
/etc/init.d/networking restart
# 再启动网卡发现IP改变了,也不再冲突了
dhclient