eth0 eth1 入れ替え ubuntu

ubuntuマシンのマザーボードを入れ替えてから、ないはずのeth0をどうすればいいかずっと考えてたら
eth0とeth1を入れ替え(debian系)
http://kusumoto-jp.org/article.php/20111005124549597
↑のページに遭遇。


tetsuo@Ubuntu:~$ sudo vi /etc/udev/rules.d/
70-persistent-cd.rules 70-persistent-net.rules README
tetsuo@Ubuntu:~$ sudo vi /etc/udev/rules.d/70-persistent-net.rules


# This file maintains persistent names for network interfaces.
# See udev(7) for syntax.
#
# Entries are automatically added by the 75-persistent-net-generator.rules
# file; however you are also free to add your own entries.

# PCI device 0x10de:0x03ef (forcedeth)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:00:00:00:00:44", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# USB device 0x0411:0x0066 (usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:00:00:00:00:8d", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"

# PCI device 0x10ec:0x8168 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:00:00:00:00:5b", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

~
~


最後の行が現在のNICなので、それ以外をコメントにしてNAME="eth1"をeth0へ変更。
ATTR{address}はMAC address。

もう一つ、変更していた /etc/network/interfaces を編集。

tetsuo@Ubuntu:~$ sudo vi /etc/network/interfaces
[sudo] password for tetsuo:


auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual


#auto eth1
#iface eth1 inet manual

auto br0
iface br0 inet static
address 192.168.10.245
network 192.168.10.0
netmask 255.255.255.0
broadcast 192.168.10.255
gateway 192.168.10.1
bridge_ports eth0
bridge_stp off
bridge_fd 0
bridge_maxwait 0

[PR]
by tenten909 | 2011-11-17 10:44 | PC-Unix等