OpenWrt 如何修改Mac地址

首先使用ifconfig命令查看现有的地址:
root@OpenWrt_SLboat_Mod:/# ifconfig 
br-lan    Link encap:Ethernet  HWaddr 8C:21:0A:EE:F4:51  
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:68 errors:0 dropped:0 overruns:0 frame:0
          TX packets:74 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:9338 (9.1 KiB) TX bytes:26622 (25.9 KiB) eth0      Link encap:Ethernet  HWaddr 8C:21:0A:EE:F4:50  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:446 errors:0 dropped:0 overruns:0 frame:0
          TX packets:456 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:64429 (62.9 KiB) TX bytes:202839 (198.0 KiB) Interrupt:4 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3168 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3168 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:215424 (210.3 KiB) TX bytes:215424 (210.3 KiB) wlan0     Link encap:Ethernet  HWaddr 8C:21:0A:EE:F4:50  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:32 
          RX bytes:0 (0.0 B) TX bytes:128 (128.0 B) 其实对应的MAC地址在/etc/config/network中,使用uci命令或者vi就可以修改



root@OpenWrt_SLboat_Mod:/# cat /etc/config/network 

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config interface 'lan'
        option ifname 'eth0'
        option type 'bridge'
        option proto 'static'
        option netmask '255.255.255.0'
        option ipaddr '192.168.2.1'
        option macaddr '8C:21:0A:EE:F4:51'



本文章由作者:佐须之男 整理编辑,原文地址: OpenWrt 如何修改Mac地址
本站的文章和资源来自互联网或者站长的原创,按照 CC BY -NC -SA 3.0 CN协议发布和共享,转载或引用本站文章应遵循相同协议。如果有侵犯版权的资 源请尽快联系站长,我们会在24h内删除有争议的资源。欢迎大家多多交流,期待共同学习进步。
分享到:更多

相关推荐

网友评论(0)