ubuntu下修改网卡名称

Ubuntu下把网卡eth0修改为eth1的步骤:

1、打开配置文件 /etc/udev/rules.d/70-persistent-net.rules,文件内容如下:

[plain]view plaincopy

  1. # This file was automatically generated by the /lib/udev/write_net_rules
  2. # program, run by the persistent-net-generator.rules rules file.
  3. #
  4. # You can modify it, as long as you keep each rule on a single
  5. # line, and change only the value of the NAME= key.
  6. # PCI device 0x11ab:/sys/devices/pci0000:00/0000:00:1c.1/0000:02:00.0 (sky2)
  7. SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:25:11:43:c7:86",
  8. ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

2、修改文件,将 NAME=“eth0” 修改为 eth1。

3、重启网络服务 sudo /etc/init.d/networking restart,大功告成!