- MAC地址取自/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 globals 'globals'
option ula_prefix 'fd06:4a10:ba39::/48'
config interface 'lan'
option ifname 'eth0'
option force_link '1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
option macaddr '00:0c:43:28:80:ed'
config interface 'wan'
option ifname 'eth1'
option proto 'dhcp'
option macaddr '00:0c:43:28:80:ee'—MAC地址
config interface 'wan6'
option ifname '@wan'
option proto 'dhcpv6'
- Override Mac address(MAC地址的克隆):
MAC地址克隆的用處:
mac地址克隆就是把自己電腦的mac地址複製到路由器上,讓運營商誤識別是用戶使用電腦上網,而通過認證。這樣就可以防止用戶的賬號在別的電腦登錄了。
設置頁面如下
三、How to change the Ethernet MAC address
The MediaTek Ethernet uses Factory MTD block to save its LAN/WAN MAC address. If the
setting is empty, it will generate a random MAC address instead.
The following tools can help to modify the MAC address setting in the flash.
1. eth_mac
2. flash
For example, Set the LAN (eth2.1) MAC address of MT7620 as 00:0c:43:76:21:01
1. # eth_mac w lan 00 0c 43 76 21 01
2. # flash -w 40028 -o 00
# flash -w 40029 -o 0c
# flash -w 4002A -o 43
# flash -w 4002B -o 76
# flash -w 4002C -o 21
# flash -w 4002D -o 01
四、
五、修改如下代碼:
Openwrt
文件target/linux/ramips/base-files/etc/uci-defaults/02_network
函數ramips_setup_macs()
lan_mac=$(eth_mac r lan)
wan_mac=$(eth_mac r wan)