導航:首頁 > 操作系統 > linux設置mac地址

linux設置mac地址

發布時間:2022-06-02 10:03:21

linux下怎麼綁定 網卡的 MAC地址即如何修改

長期更改即為綁定,真實mac是寫在網卡晶元里的,無法更改。

臨時更改
ifconfig eth0 down
ifconfig eth0 hw ether mac地址

ifconfig eth0 up

長期更改

/etc/sysconfig/network-scripts/ifcfg-eth0中加入下面一句話:
MACADDR=mac地址

② linux修改MAC地址文件是什麼

ifconfig

③ linux修改mac地址命令

1.臨時性的修改:

①依次輸入以下命令:

/sbin/ifconfig eth0 down/sbin/ifconfig eth0 hw ether 00:0C:29:36:97:20/sbin/ifconfig eth0 upservice network restart

2.永久性的修改:

方法①:

並把類似於1中的②腳本保存在/etc/rc.local中:這一步是起作用的關鍵步驟
腳本如下:

/sbin/ifconfig eth0 down/sbin/ifconfig eth0 hw ether 00:0C:29:36:97:20/sbin/ifconfig eth0 upservice network restart

方法②:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

添加

MACADDR=00:0C:29:36:97:20

④ 如何在linux中綁定一個ip地址192.168.0.49,mac地址00:00:39:b2:32:91

1、新建一個靜態的mac-->ip對應表文件:ip-mac,將要綁定的IP和MAC地下寫入此文件,格式為
ip
mac。
[root@ftpsvr
~]#
echo
'192.168.1.1
00:00:00:00:00:00
'
>
/etc/ip-mac
[root@ftpsvr
~]#
more
/etc/ip-mac
192.168.1.1
00:00:00:00:00:00
2、設置開機自動綁定
[root@ftpsvr
~]#
echo
'arp
-f
/etc/ip-mac
'
>>
/etc/rc.d/rc.local
3、手動執行一下綁定
[root@ftpsvr
~]#
arp
-f
/etc/ip-mac
4、確認綁定是否成功
[root@ftpsvr
~]#
arp

⑤ linux修改Mac地址

1、臨時性的修改:

依次輸入以下命令:

/sbin/ifconfig eth0 down

/sbin/ifconfig eth0 hw ether 00:0C:29:36:97:20

/sbin/ifconfig eth0 up

service network restart

2、永久性的修改:

vi /etc/sysconfig/network-scripts/ifcfg-eth0

添加MACADDR=00:0C:29:36:97:20

注釋掉原來的HWADDR

:wq 保存退出。

有危害,如果永久激活步驟錯誤則會造成無法聯網的問題。

(5)linux設置mac地址擴展閱讀:

誤區

#ifconfig eth0 down /*禁掉eth0網卡,這里以eth0網卡為例*/

#ifconfig eth0 hw ether 00:AA:BB:CC:DD:EE/*修改eth0網卡的MAC地址*/

#ifconfig eth0 up /*重新啟動eth0網卡*/

然後重新啟動主機。

結論:按照這種方法修改MAC地址,重新啟動主機系統後,MAC地址會自動還原。

⑥ 怎樣修改linux mac地址

方法一:
1.關閉網卡設備
ifconfig eth0 down
2.修改MAC地址
ifconfig eth0 hw ether MAC地址

⑦ Linux中MAC地址問題

linux想修改系統中的MAC地址(例如改為0004a2d2e212),操作方法是:用#ifconfig
eth0
down
先把網卡禁用,否則會報告系統忙,無法更改;然後再用ifconfig
eth0
hw
ether
0004a2d2e212即可。
(此方法只適用即時的,重啟後會恢復為默認的網卡MAC地址)
如果你想永久修改系統中的MAC地址,即讓linux重啟後也是修改後的MAC地址,可以這樣操作:在/etc/rc.d/rc.local中加入以下三行(也可在/etc/init.d/network中添加以下三行)
ifconfig
eth0
down
ifconfig
eth0
hw
ether
0004a2d2e212
ifconfig
eth0
up
★、查看Linux中MAC地址是否改好
方法:可以這樣操作:重啟電腦,在終端下,輸入IPconfig/all命令,於是Physical
Address就會顯示一個地址,你檢查一下即可得知MAC是否修改成功了。

閱讀全文

與linux設置mac地址相關的資料

熱點內容
安卓手機製表怎麼換行 瀏覽:204
牆柱搭接箍筋怎麼加密 瀏覽:445
怎麼加密不讓人打開 瀏覽:324
2g3g演算法 瀏覽:195
python可以在net開發 瀏覽:923
編程里的hr啥意思 瀏覽:400
上海php兼職 瀏覽:717
順豐app如何驗證學生 瀏覽:369
伺服器mac地址過濾器 瀏覽:930
程序員一年內被開除 瀏覽:452
福建文檔課件加密企業 瀏覽:778
appstore美國的界面怎麼看呀 瀏覽:522
hlt單片機 瀏覽:313
CA的命令 瀏覽:680
安卓怎麼傳王者應用給蘋果 瀏覽:911
aws雲伺服器自建 瀏覽:829
如何更換伺服器登錄網站 瀏覽:690
java修改ip地址 瀏覽:828
java操作cookie 瀏覽:688
ping命令2個ip 瀏覽:222