Loading

openwrt,给不同的设备使用不同的网关

编辑配置文件:/etc/dnsmasq.conf

添加以下内容

dhcp-host=F0:57:A6:53:1E:66,set:altdnsgw,192.168.2.20,jack-rog,12h
dhcp-option=tag:altdnsgw,option:dns-server,192.168.2.9
dhcp-option=tag:altdnsgw,option:router,192.168.2.9

 

第一行,根据mac地址,设置使用规则 altdnsgw 设置ip地址,计算机名,dhcp时间

第二行,规则altdnsgw,使用dns地址:192.168.2.9

第三行,规则altdnsgw,使用网关:192.168.2.9

经测试,不给IP,计算机名也可以的。

dhcp-host=F0:57:A6:53:1E:66,set:altdnsgw,12h
dhcp-option=tag:altdnsgw,option:dns-server,192.168.2.9
dhcp-option=tag:altdnsgw,option:router,192.168.2.9

posted @ 2023-03-04 15:09  上官飞鸿  阅读(1381)  评论(0)    收藏  举报