●ABOUT2009年09月 アーカイブ
2009年09月03日
eth0とeth1を入れ替え(debian系)
LinuxではNICの認識順にeth0、eth1・・・と認識していきますがこれが意図した順番で認識しない場合があります。
これを入れ替える方法です。
最近のDebianやUbuntuはudevを利用しているのでudevを使って解決します。
udevの設定は『/etc/udev/rules.d』にあります。
# vi /etc/udev/rules.d/xx-persistent-net.rules
xxの部分はシステムによって変わります。
# 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 0x10ec:0x8168 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:00:00:00:00:0a", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"# PCI device 0x10ec:0x8136 (r8169)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:00:00:00:00:0b", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
NAMEの部分を書き換えればOKです。
またATTRはMACアドレスなのでここを書き換えることによってMACアドレスを変更することが出来ます。
日時: 2009年09月03日 09:38 | カテゴリ:Linux覚え書き| パーマリンク | トラックバック (0)
Copyright (C)堕落日記.