视频连接
本期向大家介绍一个UP主自用的软路由组网方案。
本方案采用硬路由做主路由,软路由做旁路由,并使用个性化的DHCP服务器配置,达到灵活的为不同设备分配不同网关的目的。
视频中用到的脚本
修改软路由lan口IP
1
|
nano /etc/config/network
|
修改dhcp服务配置
1
2
3
4
5
6
7
8
9
10
11
12
|
nano /etc/config/dhcp
#增加
config tag 'iot'
list dhcp_option '6,192.168.2.88'
list dhcp_option '3,192.168.2.88'
option force '1'
config host
option dns '1'
option name 'test'
option mac 'aa:7d:54:a4:f8:da'
option tag 'iot'
|
luci命令(可替代直接修改/etc/config/dhcp)
1
2
3
4
5
6
7
8
9
10
11
|
uci set dhcp.iot="tag"
uci add_list dhcp.iot.dhcp_option="3,192.168.2.88"
uci add_list dhcp.iot.dhcp_option="6,192.168.2.88"
uci set dhcp.iot.force=1
uci add dhcp host
uci set dhcp.@host[-1].name="test"
uci set dhcp.@host[-1].dns="1"
uci set dhcp.@host[-1].mac="aa:7d:54:a4:f8:da"
uci set dhcp.@host[-1].tag="iot"
uci commit dhcp
|
重启dhcp和dns服务
1
|
/etc/init.d/dnsmasq restart
|
网飞合租:https://d.126126.xyz/5
自用机场:https://d.126126.xyz/3
youtube:https://www.youtube.com/c/ericwang618
哔哩哔哩:https://space.bilibili.com/221010336
Telegram:https://t.me/first_sunlight
个人网站:https://www.126126.xyz
合作邮箱:fs104300@outlook.com
文章作者
最初的晨曦
上次更新
2021-06-04
许可协议
本文章采用 CC BY-NC-SA 4.0 许可协议