CentOS linux 修改MAC位址

2021-05-24 01:46:07 字數 1680 閱讀 9019

1、首先檢視網絡卡資訊:

[root@localhost ~]# ifconfig

eth0      link encap:ethernet  hwaddr 00:0c:29:49:22:c8  

inet addr:10.65.7.182  bcast:10.65.7.255  mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe49:22c8/64 scope:link

上面顯示,裝置eth0的mac資訊,即硬體位址hwaddr 00:0c:29:49:22:c8  

2、關閉eth0,因為會關閉網路服務,所以這要求直接操作本地機器

[root@localhost ~]# ifconfig eth0 down

3、修改mac資訊為00:0c:29:49:22:c1

[root@localhost ~]# ifconfig eth0 hw ether 00:00:00:00:00:c1

4、啟動eth0

[root@localhost ~]# ifconfig eth0 up

5、檢視修改後的網絡卡資訊:

[root@localhost ~]# ifconfig

eth0      link encap:ethernet  hwaddr 00:00:00:00:00:c1

inet addr:10.65.7.182  bcast:10.65.7.255  mask:255.255.255.0

inet6 addr: fe80::20c:29ff:fe49:22c1/64 scope:link

up broadcast running multicast  mtu:1500  metric:1

rx packets:3470 errors:0 dropped:0 overruns:0 frame:0

tx packets:1509 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000 

rx bytes:907742 (886.4 kib)  tx bytes:182280 (178.0 kib)

interrupt:67 base address:0x2024 

lo        link encap:local loopback  

inet addr:127.0.0.1  mask:255.0.0.0

inet6 addr: ::1/128 scope:host

up loopback running  mtu:16436  metric:1

rx packets:1505 errors:0 dropped:0 overruns:0 frame:0

tx packets:1505 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0 

rx bytes:2414590 (2.3 mib)  tx bytes:2414590 (2.3 mib)

永久修改mac資訊:

開啟/etc/rc.d/rc.local ,追加三行內容:

ifconfig eth0 down

ifconfig eth0 hw ether 00:00:00:00:00:c1

ifconfig eth0 up

然後重啟

CentOS linux修改主機名

下面我們把centos系統的主機名字修改為myhost 系統運維 www.osyunwei.com 第一步 hostname myhost 第二步 修改 etc sysconfig network中的hostname vi etc sysconfig network hostname myhost ...

virtualbox上轉殖虛擬機器修改mac位址

在linux下使用virtualbox最小化安裝centos6.0,並轉殖了乙個相同的,聯網模式為橋接,修改配置檔案之後重啟網路發現二者的 網路資訊相同,所獲取的ip位址也相同,這樣以來從主機ssh過去就難以判斷 實際上有先後順序,可以分別連上兩個相同ip的虛擬機器 這時需要要修改其 中乙個mac位...

Golang遍歷map的同時併發修改map的值

通過複製map解決問題 後記如題,有個邏輯設計,在遍歷map的同時需要併發的修改map的值 先說下解決,那就是把map重新複製乙份,不是同乙個map自然也就不存在併發安全和死鎖的問題了,但是因為不是同乙個map了,自然是需要注意資料還是否有效的問題了。這個可以通過加鎖之後的再次判斷來解決。併發的讀寫...