我爸菜园子怕别人偷菜让我帮忙给装一个监控,这样有人进入就会报警,并且实时可以看到菜园子情况。 平房没有网络我打算给那里放一个CPE,插一张副卡用来给监控提供网络。手头有一个之前帮忙测评用的工程版CPE,想着物尽其用,设置了一下发现不能改变SSID,可能是工程版原因软件还不完善,也凑合着能用可是特别挑战我的强迫症。由于我知道这个CPE的固件是通过OpenWrt魔改过来的,于是我尝试能不能通过命令的方式来改一下SSID,结果还真做到了。这里简单记录一下步骤:
首先打开NRadio的ssh开关,浏览器打开:
http://192.168.66.1/cgi-bin/luci/admin/system/security
然后使用uci命令来修改OpenWrt的网络设置。可以先用uci show network 和uci show wireless来看下当前设置:
root@nradiowifi:~# uci show network
network.loopback=interface
network.loopback.ifname=lo
network.loopback.proto=static
network.loopback.ipaddr=127.0.0.1
network.loopback.netmask=255.0.0.0
network.globals=globals
network.globals.ula_prefix=fd10:edcc:41cb::/48
network.lan=interface
network.lan.def_ifname=eth0.1
network.lan.force_link=1
network.lan.type=bridge
network.lan.proto=static
network.lan.igmp_snooping=0
network.lan.netmask=255.255.255.0
network.lan.ip6assign=60
network.lan.ipaddr=192.168.1.1
network.lan.def_ipaddr=192.168.1.1
network.lan.ifname=eth0
network.wan=interface
network.wan.def_ifname=eth0.2
network.wan.proto=wwan
network.nrswitch=nrswitch
network.nrswitch.ovlan=WNNNLNC
network.nrswitch.nvlan=LNNNLNC
root@nradiowifi:~# uci show wireless
wireless.radio1=wifi-device
wireless.radio1.type=mac80211
wireless.radio1.vendor=ralink
wireless.radio1.hwmode=11a
wireless.radio1.channel=auto
wireless.radio1.devidx=1
wireless.radio1.phyname=mt7612e
wireless.radio1.mcastenhance=1
wireless.radio1.mcsrate=-1
wireless.radio1.igmpsn=1
wireless.radio1.mcast_rate=3
wireless.radio1.sniffer=0
wireless.radio1.htmode=VHT80
wireless.radio1.txpower=100
wireless.radio1.disall=0
wireless.wlan1=wifi-iface
wireless.wlan1.device=radio1
wireless.wlan1.network=lan
wireless.wlan1.mode=ap
wireless.wlan1.encryption=none
wireless.wlan1.ifname=rai0
wireless.wlan1.disabled=0
wireless.wlan1.ssid=NRadio-0CBE
wireless.wlan1_0=wifi-iface
wireless.wlan1_0.device=radio1
wireless.wlan1_0.network=lan
wireless.wlan1_0.mode=ap
wireless.wlan1_0.ssid=SSID_0
wireless.wlan1_0.encryption=none
wireless.wlan1_0.disabled=1
wireless.wlan1_0.ifname=rai0_1
wireless.wlan1_1=wifi-iface
wireless.wlan1_1.device=radio1
wireless.wlan1_1.network=lan
wireless.wlan1_1.mode=ap
wireless.wlan1_1.ssid=SSID_1
wireless.wlan1_1.encryption=none
wireless.wlan1_1.disabled=1
wireless.wlan1_1.ifname=rai0_2
wireless.wlan1_2=wifi-iface
wireless.wlan1_2.device=radio1
wireless.wlan1_2.network=lan
wireless.wlan1_2.mode=ap
wireless.wlan1_2.ssid=SSID_2
wireless.wlan1_2.encryption=none
wireless.wlan1_2.disabled=1
wireless.wlan1_2.ifname=rai0_3
wireless.radio0=wifi-device
wireless.radio0.type=mac80211
wireless.radio0.vendor=ralink
wireless.radio0.hwmode=11g
wireless.radio0.channel=auto
wireless.radio0.phyname=mt7620
wireless.radio0.mcastenhance=1
wireless.radio0.mcsrate=-1
wireless.radio0.igmpsn=1
wireless.radio0.mcast_rate=3
wireless.radio0.sniffer=0
wireless.radio0.htmode=HT40
wireless.radio0.txpower=100
wireless.radio0.disall=0
wireless.wlan0=wifi-iface
wireless.wlan0.device=radio0
wireless.wlan0.network=lan
wireless.wlan0.mode=ap
wireless.wlan0.encryption=none
wireless.wlan0.ifname=ra0
wireless.wlan0.disabled=0
wireless.wlan0.ssid=NRadio-0CBE-2.4G
wireless.wlan0_0=wifi-iface
wireless.wlan0_0.device=radio0
wireless.wlan0_0.network=lan
wireless.wlan0_0.mode=ap
wireless.wlan0_0.ssid=SSID_0-2
wireless.wlan0_0.encryption=none
wireless.wlan0_0.disabled=1
wireless.wlan0_0.ifname=ra1
wireless.wlan0_1=wifi-iface
wireless.wlan0_1.device=radio0
wireless.wlan0_1.network=lan
wireless.wlan0_1.mode=ap
wireless.wlan0_1.ssid=SSID_1-2
wireless.wlan0_1.encryption=none
wireless.wlan0_1.disabled=1
wireless.wlan0_1.ifname=ra2
wireless.wlan0_2=wifi-iface
wireless.wlan0_2.device=radio0
wireless.wlan0_2.network=lan
wireless.wlan0_2.mode=ap
wireless.wlan0_2.ssid=SSID_2-2
wireless.wlan0_2.encryption=none
wireless.wlan0_2.disabled=1
wireless.wlan0_2.ifname=ra3
wireless.apcli=wifi-iface
wireless.apcli.disabled=1
wireless.apcli.device=radio0
wireless.apcli.mode=sta
wireless.apcli.ifname=apcli0
root@nradiowifi:~#
从中可以看到我们比较关心的是wireless.wlan0.ssid=NRadio-0CBE-2.4G 和wireless.wlan1.ssid=NRadio-0CBE这两项,这和网页里看到的内容是相同的,但是网页配置端由于未知bug修改不了。我在这里尝试用uci命令修改:
uci set wireless.wlan0.ssid=NRadio-0CBE-2.4G
uci set wireless.wlan1.ssid=NRadio-0CBE
然后保存更改:
uci commit wireless
uci commit network
重启后生效。
/etc/init.d/network restart
Reference:
https://blog.csdn.net/qq_35718410/article/details/53113894