linux 网卡无法设置,Linux网卡配置出错无法联网-联网报错解决方法

e235a7c756ed4cde239d0b6e6585c509.png

root@rise-rs-171:/etc/network# mii-tool

eth2: negotiated 1000baseT-FD flow-control, link ok

eth3: autonegotiation restarted, no link

发现网卡绑定在eth2和eth3,之前正常应该是绑定在eth0和eht1 ,询问同事,原来这台机器之前维修过换了块主板,导致MAC地址变了

原因:以前用rulles绑定了MAC地址,造成eth0和eth1被占用了,只能按顺序排下去

root@rise-rs-171:/etc/udev/rules.d# cat 70-persistent-net.rules

# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:09.0/0000:05:00.0 (igb)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="e4:11:5b:e4:0f:80", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:09.0/0000:05:00.1 (igb)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="e4:11:5b:e4:0f:81", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x8086:/sys/devices/pci0000:00/0000:00:09.0/0000:05:00.0 (igb)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="80:c1:6e:6d:f8:ba", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

发现新的MAC地址变为80:c1:6e:6d:f8:ba

于是删除root@rise-rs-171:/etc/udev/rules.d# rm -f 70-persistent-net.rules

重新配置网络设置,重启机器reboot即可

root@rise-rs-171:/etc/network# cat interfaces

# The loopback network interface

auto lo

iface lo inet loopback

# The primary network interface

auto eth0

iface eth0 inet static

address 58.215.138.171

netmask 255.255.255.192

gateway 58.215.138.129

auto eth0:1

iface eth0:1 inet static

address 122.193.202.105

netmask 255.255.255.192

auto eth1

iface eth1 inet static

address 10.20.169.16

netmask 255.255.255.0

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值