openwrt系统下如何直接访问光猫

OpenWrt · 2020-04-14

系统-启动项-本地启动脚本
将下方代码添加于exit 0之前

ifconfig eth0 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255
iptables -I forwarding_rule -d 192.168.1.1 -j ACCEPT
iptables -t nat -I postrouting_rule -d 192.168.1.1 -j MASQUERADE

其中eht0是wan口网卡,根据自己实际情况修改,光猫ip也是一样
其实添加到防火期的自定义规则里面,也是一样的效果

Theme Jasmine by Kent Liao