Ubuntu下把网卡eth0修改为eth1的步骤:
1、打开配置文件 /etc/udev/rules.d/70-persistent-net.rules,文件内容如下:
- # 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 0x11ab:/sys/devices/pci0000:00/0000:00:1c.1/0000:02:00.0 (sky2)
- SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:11:43:c7:86",
- ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
2、修改文件,将 NAME=“eth0” 修改为 eth1。
3、重启网络服务 sudo /etc/init.d/networking restart,大功告成!