可编程路由 - openwrt 实现命令行修改wifi环境

路由器 tp-link ac 1750

已经烧录openwrt 组件
博主使用的 路由器 型号 且已经烧录好了 openwrt 组件 以及 Luci 插件

页面配置展示

在这里插入图片描述

手动修改 wifi 环境

Network -> Wireless
在这里插入图片描述
博主的路由器配置
在这里插入图片描述

以修改2.4G为例

> Edit ->


接下里展示命令行切换

登录

  • ssh 方式
coco@cocodeMBP ~ % ssh root@192.168.1.1
root@192.168.1.1's password: 
# 输入烧录openwrt是的 登录密码

修改配置

将wifi环境修改至如下配置
热点名字 coco is handhome 2G
密码 12345678
加密方式 WPA2-PSK

uci set wireless.@wifi-iface[1].ssid='coco is handsome 2G'
uci set wireless.@wifi-iface[1].key='12345678'	
uci set wireless.@wifi-iface[1].encryption=psk2

# 提交配置
uci commit
/etc/init.d/network restart

参数获取

uci set wireless.@wifi-iface[1].encryption=psk2 中的参数 psk2 可从页面源码中获取
在这里插入图片描述

其他命令

查看配置信息

uci show
dhcp.@dnsmasq[0]=dnsmasq
dhcp.@dnsmasq[0].domainneeded='1'
dhcp.@dnsmasq[0].boguspriv='1'
dhcp.@dnsmasq[0].filterwin2k='0'
dhcp.@dnsmasq[0].localise_queries='1'
dhcp.@dnsmasq[0].rebind_protection='1'
dhcp.@dnsmasq[0].rebind_localhost='1'
dhcp.@dnsmasq[0].local='/lan/'
dhcp.@dnsmasq[0].domain='lan'
dhcp.@dnsmasq[0].expandhosts='1'
dhcp.@dnsmasq[0].nonegcache='0'
dhcp.@dnsmasq[0].authoritative='1'
...

查看节点信息

uci get wireless.wifinet2.ssid
coco is handsome 2G
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值