差異處
這裏顯示兩個版本的差異處。
tech:udev [2011/09/20 16:23] – 建立 jonathan | tech:udev [2013/05/09 14:28] (目前版本) – jonathan | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== CentOS6 udev 更改 nic 名稱的狀況 ====== | ||
+ | * 因為透過 virt-clone 複製 vm 後, 新啟動 vm 內的 nic 就會變成 eth1 而不是原本的 eth0< | ||
+ | ifconfig -a | ||
+ | </ | ||
+ | eth1 Link encap: | ||
+ | UP BROADCAST MULTICAST | ||
+ | RX packets:0 errors:0 dropped:0 overruns:0 frame:0 | ||
+ | TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 | ||
+ | collisions: | ||
+ | RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) | ||
+ | |||
+ | lo Link encap:Local Loopback | ||
+ | inet addr: | ||
+ | inet6 addr: ::1/128 Scope:Host | ||
+ | UP LOOPBACK RUNNING | ||
+ | RX packets: | ||
+ | TX packets: | ||
+ | collisions: | ||
+ | RX bytes: | ||
+ | </ | ||
+ | |||
+ | * 這個問題可以經過開機的紀錄發現是由 udev 所更改< | ||
+ | dmesg | grep eth | ||
+ | </ | ||
+ | udev: renamed network interface eth0 to eth1 | ||
+ | </ | ||
+ | * 原來是 nic 的 MAC 改變時, 會在 / | ||
+ | * 編輯前的 / | ||
+ | # This file was automatically generated by the / | ||
+ | # 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. | ||
+ | |||
+ | # net device () | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | # net device () | ||
+ | SUBSYSTEM==" | ||
+ | </ | ||
+ | * 編輯後的 / | ||
+ | # This file was automatically generated by the / | ||
+ | # 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. | ||
+ | |||
+ | # net device () | ||
+ | SUBSYSTEM==" | ||
+ | </ | ||
+ | * 修改之後, | ||
+ | |||
+ | < | ||
+ | **如果要使用在 VM Image Template** | ||
+ | - 去除 / | ||
+ | : | ||
+ | # | ||
+ | # | ||
+ | : | ||
+ | </ | ||
+ | - 刪除 / | ||
+ | rm -f / | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== 參考網址 ===== | ||
+ | * http:// | ||
+ | * http:// | ||
+ | |||
+ | {{tag> |