zl程序教程

您现在的位置是:首页 >  硬件

当前栏目

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

设备 不同 网关 openwrt 使用
2023-09-27 14:22:22 时间

编辑配置文件:/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