導航:首頁 > 操作系統 > 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地址相關的資料

熱點內容
java資料庫建表 瀏覽:166
linux本地埠 瀏覽:36
郵票目錄pdf 瀏覽:378
解壓筆真的有用嗎 瀏覽:538
plc語法和編程語句 瀏覽:115
南航app學生旅行產品在哪裡 瀏覽:240
漫畫pdf網盤 瀏覽:495
手機pdf字太小 瀏覽:892
解壓縮安裝圖解 瀏覽:257
安卓如何查看運行伺服器 瀏覽:681
土質學pdf 瀏覽:993
郵箱收發伺服器地址 瀏覽:143
web前端和python 瀏覽:639
定址演算法 瀏覽:783
車床編程ijk之間的關系 瀏覽:493
安卓什麼app可以訪問smb 瀏覽:205
籠統概括程序員 瀏覽:853
linuxfdiskdf 瀏覽:299
iic編程注意事項 瀏覽:53
預定命令的英語 瀏覽:999