Advertisement
Guest User

Untitled

a guest
Apr 20th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Many cable modems will accept web GUI connections on 192.168.100.1, so we can
  4. # give the WAN interface an IP on that subnet, add some routing, and be able to
  5. # access the modem's config from the LAN.
  6. #
  7.  
  8. [ ! -f /jffs/scripts/wan-start ] && echo '#!/bin/sh' > /jffs/scripts/wan-start
  9. cat << 'EOF' >> /jffs/scripts/wan-start
  10.  
  11. # add IP to WAN interface on cable modem's subnet
  12. ifconfig `nvram get wan0_ifname`:0 192.168.100.2 netmask 255.255.255.0
  13. EOF
  14. chmod +x /jffs/scripts/wan-start
  15.  
  16. [ ! -f /jffs/scripts/nat-start ] && echo '#!/bin/sh' > /jffs/scripts/nat-start
  17. cat << 'EOF' >> /jffs/scripts/nat-start
  18.  
  19. # routing for cable modem's subnet
  20. iptables -t nat -I POSTROUTING -o `nvram get wan0_ifname` -j MASQUERADE
  21. EOF
  22. chmod +x /jffs/scripts/nat-start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement