歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux服務器 >> VMware虛擬機中修改Linux MAC地址的方法

VMware虛擬機中修改Linux MAC地址的方法

日期:2017/3/2 16:53:20   编辑:Linux服務器
1、修改虛擬機的*.vmx文件。
 
  這種方法最值得推薦,因為這樣就類似於重新“燒錄”了VMware虛擬機的“物理網卡ROM”。方法是:
 
  分兩種情況:
 
  a:
 
  ethernet0.addressType = "static"
 
  ethernet0.Address = "00:50:56:0A:0B:0C"
 
  "static"說明VM的"物理網卡"的MAC是靜態設定的,你可以改成一個以005056開頭的另外一個MAC即可。改完啟動VM時如果問你SSID的話,選擇“Keep Always”。
 
  b:
 
  ethernet0.addressType = "generated"
 
  uuid.location = "56 4d dc f1 ff aa 75 ea-f1 b9 ee 0d 68 9c 65 5c"
 
  uuid.bios = "56 4d ed 23 13 8c 96 91-7c 68 b2 09 8b aa bb cc"
 
  ethernet0.generatedAddress = "00:0c:29:aa:bb:cc"
 
  "generated"說明VM的"物理網卡"的MAC是系統隨機動態設定的,你可以通過將uuid.bios後六位及ethernet0.generatedAddress後六位改成你想要改成的以000c29開頭的MAC即可。
 
  2、修改Linux系統裡相關 /etc/sysconfig/network-scripts/ifcfg-eth0文件MAC值。
 
  vi /etc/sysconfig/network-scripts/ifcfg-eth0
 
  MACADDR=xx:xx:xx:xx:xx:xx
 
  :wq 保存退出
 
  reboot
 
  3、修改Linux系統裡相關rc.local文件MAC值。
 
  可以通過改啟動腳本/etc/rc.d/rc.local:
 
  ifconfig eth0 down
 
  ifconfig eth0 hw ether xxxxxxxxxxxx
 
  ifconfig eth0 up
 
  /sbin/route add default gw x.x.x.x eth0
 
  :wq 保存退出
 
  reboot

Copyright © Linux教程網 All Rights Reserved