1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Easiest way to switch between two different configuratons

Discussion in 'Tomato Firmware' started by CraziFuzzy, May 29, 2014.

  1. CraziFuzzy

    CraziFuzzy Network Newbie Member

    So, here's my situation/fun challenge. I am installing a netgear WNR3500L/v2 in my travel trailer. It currently has shibby's AIO 117 on it. It will serve a couple purposes.

    First, when away from home:
    - DHCP to the family's mobile devices
    - sharing a 750GB HDD with media on it
    - providing a wired connection point to a Rasbperry Pi that drives the RV's TV
    - when needed, tethering my android phone to it as it's wan interface.

    Second, when home, and the trailer is parked in the back yard:
    - operate as a WDS repeater on the home wifi network, to increase coverage in the back yard, repeating from the router in my garage.
    - bridge the hardwired R-Pi and shared HDD onto the home network so media can be synced to it before trips (and allow streaming from home media server when guests are using the RV as guest quarters).
    - DHCP would need to be off in this mode to prevent conflicts with home setup.

    So, what is the best way to have two rather disparate configurations with the same hardware? Any way to script it to be configured via button press, or better yet, on power up detect the presence of the home wifi net and choose a configuration appropriately (meaning just needing to power cycle the thing to get it in home or away mode). Also, would there be a decent way to update the DHCP static leases between the home DHCP server (pfsense) and the router's away more, so that mobile devices tend to keep the same IP (not sure this is all that important, just a thought).

    Bonus points to figure out a way to connect the router to a campground's wifi, and NAT it to the mobile devices, instead of using the cell phone's tether (unfortunately, android's USB tether disables the phone's wifi connection, so it can't be used as the second wifi adapter for the router) - are there any usb wifi dongles that would work as the WAN interface for the router?
  2. ntest7

    ntest7 Network Guru Member

    Use the Administration -> Buttons/LED page to trigger the right script based on how long you hold the WPS button. The "Custom Script" section of that page will look something like:
    [ $1 -ge 20 ] && telnetd -p 233 -l /bin/sh
    [ $1 -ge 12 ] && /path/to/home-script
    [ $1 -ge 4 ] &&   /path/to/travel-script
    where you travel and home scripts will contain a bunch of nvram set statements, with a reboot at the end.

    You can find the proper nvram statements by setting the router as you like it then using "nvram show" and/or "nvram get" to see what's being changed.

    And be sure to stick a label on the router with instructions something like "press 5 seconds for travel use, 10 seconds for home use" so you don't have to remember.

    Good luck. Sounds like a cool exercise.

Share This Page