
Ubuntuで論理LANインターフェイス名(eth0,eth1)とハードウエア(MAC)との割付を変更する
こんにちは。匠技術研究所の谷山 亮治です。
Ubuntuでは、以下の手順で、論理LANインターフェイス名(eth0,eth1)とハードウエア(MAC)との割付を変更することができます。
一時的に使った論理LANインターフェース名を削除したり、LANポートの番号と論理LANインターフェイス名を揃えたりする場合に使います。
論理LANインターフェイス名とハードウエアの紐付けは、インストール時に自動生成する、以下の設定ファイルに設定があります。
/etc/udev/rules.d/70-persistent-net.rules
例えば、編集前が以下のとおりで、USBのLANインターフェイスeth0を外し、オンボードLANインターフェースeth1をeth0に変更する場合を紹介します。
■編集前
takumi@ubuntu:~$ cat /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.
# USB device 0x04bb:0x0913 (usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="64:01:b0:44:2a:49", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x197b:/sys/devices/pci0000:00/0000:00:1c.1/0000:02:00.5 (jme)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="80:ee:73:31:57:fa", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
takumi@ubuntu:~$
上記ファイルをroot権限でエディタで開き、以下の要領で変更します。
■編集後
USB認識しているeth0の設定部分を削除し、PCI deviceのNAME=”eth1"をNAME="eth0"に変更します。
takumi@ubuntu:~$ cat /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 0x197b:/sys/devices/pci0000:00/0000:00:1c.1/0000:02:00.5 (jme)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="80:ee:73:31:57:fa", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
takumi@ubuntu:~$
変更が完了したらOSごと再起動します。
匠技術研究所ではヤマハルーターの設定セミナーを開催しています。以下の案内をご参照下さい。皆様のお役に立てるよう、最新の情報を交えた設定技術セミナーです。
ヤマハルーターRTX810自力でVPNセミナーのご案内
ヤマハルーターRTX810を使って自力でVPNを構築する方向けのセミナーです。次回4月8日(月)、4月24日(水)の募集を始めました。セミナー後の個別相談も好評です!
匠技術研究所お問い合わせフォーム
![]() | ヤマハルーターで挑戦 企業ネットをじぶんで作ろう |
谷山 亮治 | |
日経BP社 |

「伝わる君 携帯会議」導入前お試しできます
企業・団体のオープンソース活用のご相談はこちら
匠技術研究所はこちら


この記事が決め手で、VMWare Fusion から Parallels Desktop への乗り換えでネットワークに繋がらなくなってしまった問題が解決しました。
http://blog.felt-life.info/it-gate/2015/07/17/parallels-network-resetting/
ありがとうございました。
お役にたてて、嬉しく思います。
貴方ブログ拝見しました。
仮想環境の引越しでもネットワーク インターフェイスの付け替えが必要ですね。
引き続き、宜しくお願いします。