linux下把eth1改为默认值eth0

/proc/net/dev shows "eth1" not "eth0"

Vancouver Linux Users Group View thread View thread

Have you ever had a different NIC in this machine?  If so this could be
a udev issue. When udev sees a nic it maps the MAC address to an ethX.
If it sees a new MAC address it will map it to a different ethX, even if
the original nic is no longer present.  This is actually a good thing,
and fixes the wandering NIC/ethX issue that used to happen if a NIC was
moved to a different PCI slot.

I'm not sure about Slackware, but on Debian you would look in the file

/etc/udev/rules.d/70-persistent-net.rules

My own looks like this:

# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.

# PCI device 0x10de:0x00df (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="00:11:2f:86:25:5d", ATTR{type}=="1", KERNEL=="eth*",
NAME="eth0"

(the line starting with SUBSYSTEM has wrapped, but should all be on one
line)

As you can see it maps the NIC with MAC address 00:11:2f:86:25:5d to
eth0.  If I wanted that NIC to be eth1 I would edit NAME= value and the
new mapping will be picked up when I reboot.

In your case I suspect there will be a line for an eth1 that is the NIC
you would like to have as eth0.  I would suggest editing it so that the
NAME= is eth0 and delete any other line that maps to eth0.  When you
reboot it should map eth0 correctly.

- Ben

--
This message came to you via the Vancouver Linux Users Group mailing list.
For unsubscription instructions do not email the list, but rather send mail
to vanlug-request*******. That would do it.  The MAC address from the NIC in the machine you
copied will still be listed as eth0.

- Ben

--
This message came to you via the Vancouver Linux Users Group mailing list.
For unsubscription instructions do not email the list, but rather send mail
to vanlug-request*******.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值