Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Many cable modems will accept web GUI connections on 192.168.100.1, so we can
- # give the WAN interface an IP on that subnet, add some routing, and be able to
- # access the modem's config from the LAN.
- #
- [ ! -f /jffs/scripts/wan-start ] && echo '#!/bin/sh' > /jffs/scripts/wan-start
- cat << 'EOF' >> /jffs/scripts/wan-start
- # add IP to WAN interface on cable modem's subnet
- ifconfig `nvram get wan0_ifname`:0 192.168.100.2 netmask 255.255.255.0
- EOF
- chmod +x /jffs/scripts/wan-start
- [ ! -f /jffs/scripts/nat-start ] && echo '#!/bin/sh' > /jffs/scripts/nat-start
- cat << 'EOF' >> /jffs/scripts/nat-start
- # routing for cable modem's subnet
- iptables -t nat -I POSTROUTING -o `nvram get wan0_ifname` -j MASQUERADE
- EOF
- chmod +x /jffs/scripts/nat-start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement