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

熱點內容
windows拷貝到linux 瀏覽:751
mdr軟體解壓和別人不一樣 瀏覽:884
單片機串列通信有什麼好處 瀏覽:320
游戲開發程序員書籍 瀏覽:843
pdf中圖片修改 瀏覽:269
匯編編譯後 瀏覽:474
php和java整合 瀏覽:829
js中執行php代碼 瀏覽:442
國產單片機廠商 瀏覽:57
蘋果手機怎麼設置不更新app軟體 瀏覽:284
轉行當程序員如何 瀏覽:493
蘋果id怎麼驗證app 瀏覽:864
查看手機命令 瀏覽:953
抖音反編譯地址 瀏覽:227
如何加密軟體oppoa5 瀏覽:234
java從入門到精通明日科技 瀏覽:97
拆解汽車解壓視頻 瀏覽:598
新版百度雲解壓縮 瀏覽:593
android上下拉刷新 瀏覽:880
centos可執行文件反編譯 瀏覽:839