有些特殊情况,需要为不同设备分配不同的网关与DNS服务器时,可以采用以下办法来实现(下文是基于AC86U来进行描述的):

1.新建并编辑文件dnsmasq.conf.add,保存于/jffs/configs/目录下。

vi /jffs/configs/dnsmasq.conf.add

2.dnsmasq.conf.add添加以下内容(设置标签为openwrt的网关与DNS服务器地址,另外,指定MAC地址的设备分配到openwrt标签的网关与DNS)

dhcp-option=tag:openwrt,option:router,192.168.50.2
dhcp-option=tag:openwrt,option:dns-server,192.168.50.2
dhcp-mac=set:openwrt,11:22:78:14:D3:0A   #要指定的设备1的MAC地址
dhcp-mac=set:openwrt,00:11:22:63:3C:7E   #要指定的设备2的MAC地址

3.保存重启dnsmasq

service restart_dnsmasq

参考文档

https://www.asuswrt-merlin.net/download
https://github.com/RMerl/asuswrt-merlin.ng/wiki
https://github.com/RMerl/asuswrt-merlin.ng/wiki/Custom-domains-with-dnsmasq
https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

最后修改:2021 年 08 月 10 日
如果觉得我的文章对你有用,请随意赞赏