Last active
November 23, 2019 09:59
-
-
Save stupidloud/85dc014f467b03ed3dd6ceb78b8b8f6c to your computer and use it in GitHub Desktop.
openwrt路由器访问光猫设置
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MODEMIP=192.168.1.1 #光猫ip | |
| MODEM_NET=`echo $MODEMIP | cut -d "." -f 1-3` | |
| ROUTER_WAN_PORT_IP=192.168.1.100 #openwrt的ip地址 | |
| WAN_PORT=eth1 #修改为你自己的 | |
| ifconfig $WAN_PORT $ROUTER_WAN_PORT_IP netmask 255.255.255.0 broadcast $MODEM_NET.255 | |
| iptables -A forwarding_rule -d $MODEMIP -j ACCEPT | |
| iptables -t nat -A postrouting_rule -d $MODEMIP -o $WAN_PORT -j MASQUERADE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment