Tuesday, June 19, 2012

Modify Linux MAC Address

方法一

使用 ifconfig 指令的 hw class address 參數:
$ /sbin/ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx

其中 xx:xx:xx:xx:xx:xx 為欲使用的 MAC address。

方法二

修改 /etc/sysconfig/network-scripts/ifcfg-eth0 檔案,使用 MACADDR 以增加欲使用的 MAC address:
MACADDR=xx:xx:xx:xx:xx:xx

執行指令:
$ sudo /sbin/ifdown eth0
$ sudo /sbin/ifup eth0
$ sudo /sbin/service network restart

參考資料 Red Hat Enterprise Linux Deployment Guide: 13.2. Interface Configuration Files

HWADDR=MAC-address where MAC-address is the hardware address of the Ethernet device in the form AA:BB:CC:DD:EE:FF. This directive must be used in machines containing more than one NIC to ensure that the interfaces are assigned the correct device names regardless of the configured load order for each NIC's module. This directive should not be used in conjunction with MACADDR.

MACADDR=MAC-address where MAC-address is the hardware address of the Ethernet device in the form AA:BB:CC:DD:EE:FF. This directive is used to assign a MAC address to an interface, overriding the one assigned to the physical NIC. This directive should not be used in conjunction with HWADDR.


CentOS 6
/etc/udev/rules.d/70-persistent-net.rules 在開機時判斷 network interface 資訊。


參考資料

Sunday, June 17, 2012

Linux Booting Tips

顯示開機過程的詳細資訊

在 GRUB 選單中,刪除 kernel command line 中的 quiet 和 rhgb。

參考資料 http://blog.nexcess.net/2011/08/22/making-the-centos-6-boot-splash-screen-more-verbose/


互動式開機

在 GRUB 選單中,增加 PROMPT=yes 至 kernel command line。或者新增 confirm,則不需要於出現 interactive startup 詢問時按 i。