Junos OS

last person joined: 6 days ago 

Ask questions and share experiences about Junos OS.
  • 1.  Port Enable/Disable by time

    Posted 07-14-2015 08:49

    I have an access point at a remote site that I need to disable/enable based on time of day.  Basically, the local kids are using the GUEST network from the AP at night and are leaving a mess in the parking lot.  The AP is pretty dumb and it seems that a timed enable/disable would be my easiest route.  The AP does use POE from the switch, maybe that could be an option.  The switch is a EX-2200-48p running 12.3R6

     

    I half started working on a python script from my computer to login via putty to run the commands but I see a lot of room for error with that idea.  Is there anything built into the switch that could do this?  Or do you have any better ideas?

     

    Thanks,

    Todd



  • 2.  RE: Port Enable/Disable by time

    Posted 07-14-2015 08:59

    Hey Tod

     

    does the Guest network have a staic password  ? could you not just put dynamic authentication on the Guest network from the controller ?  Guests normally sign in at reception and can be given their access token for the day ? 

     

    give me a bit more info on the wifi controller if posible ? 

     

    Rgds

    Ian

     

     

     

     



  • 3.  RE: Port Enable/Disable by time
    Best Answer

    Posted 07-14-2015 09:54

    Can you use apply-groups with 'when' option? e.g.

     

    groups {

       test {

         when {  time 9 to 5; }

         interfaces { ge-x/x/x { disable; }  }

         }

    }

     

    http://www.juniper.net/documentation/en_US/junos12.3/topics/example/junos-cli-using-conditions-config-groups.html



  • 4.  RE: Port Enable/Disable by time

    Posted 07-14-2015 13:55

    Ian,

    No wireless controller, its some 'business' class single AP that was there before I started.  It's a small clinic up in the hills.  Per the Docs I can't put a password on the Guest SSID.  Basically I have been shot down all other routes and I don't want to drive all the way out there and 'hope' I find a time of day command in the unit.  The management port was turned off so I will need to use a serial cable to get in.

     

    Anuparp,

    That looks pretty much exactly like what I am trying to do.  I will be testing this on a sample switch to see if I can get the code right tonight.  

    set groups TEST when time 1900 to 2359

    set groups TEST when time 0000 to 0500

    set groups TEST interfaces ge-0/0/2 disable

    set apply-groups TEST

     

    This would be pretty slick if it is really that easy.

     

    Thanks, Todd

     



  • 5.  RE: Port Enable/Disable by time

    Posted 07-14-2015 14:21

    FYI,

    You can not apply two time ranges to a group.  Time is limited to 0-24 with no overlap, so for my scenario to work I went with the following code.  

     

    set groups WIFI-OFF-AM when time 0000 to 0500

    set groups WIFI-OFF-AM interfaces ge-0/0/2 disable

    set groups WIFI-OFF-PM when time 1900 to 2359
    set groups WIFI-OFF-PM interfaces ge-0/0/2 disable

    set apply-groups WIFI-OFF-AM

    set apply-groups WIFI-OFF-PM

     

    I tried a basic two minute outage test, which worked fine.  POE is still provided to the port but traffic is stopped in case anyone is curious.

     

    Thanks for the help,

    Todd