Community discussions

MikroTik App
 
complexsplit
just joined
Topic Author
Posts: 2
Joined: Mon Oct 16, 2023 3:31 am

Run container on event - DHCP

Mon Oct 16, 2023 3:39 am

I'd like to configure my hAP ax lite to connect to a variety of access points/SSIDs (in a connect list), and then run a command (ideally a container) depending on which network it connected to. Can RouterOS do this?
 
holvoetn
Forum Guru
Forum Guru
Posts: 5523
Joined: Tue Apr 13, 2021 2:14 am
Location: Belgium

Re: Run container on event - DHCP

Mon Oct 16, 2023 5:48 am

Your title is not in accordance with the rest of your post ?

First part, yes. Connect list is standard ROS.

Run a command depending on which network it connected to, can be done as well but may require some scripting depending on what you will have to use as determining factor (not my cup of tea, rather complex).

Last part, not really IMHO.
hAP AX Lite can not run containers in a practical way since there is no local USB port to be used for storage. Theoretically you could use network storage (which then in turn also requires Rose package) or even RAM disk (also Rose package but bad idea since this is temp storage, gone at reboot) but that would make it a rather ... complex split. I'm not even sure those 2 packages will fit on AX Lite (I'm not going to try on one of my devices since it doesn't really make sense to do so).

What I wonder here, what is it you are actually trying to achieve ??
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3605
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: Run container on event - DHCP

Mon Oct 16, 2023 3:04 pm

Assuming there was DHCP client listening on the wifi interface, you can attach a script there that run upon connection & DHCP lease renewal as well. But these script are limited, so how will that works will depend on what your trying to do. There really isn't some binding between containers and script events – containers are kinda seperate.
 
complexsplit
just joined
Topic Author
Posts: 2
Joined: Mon Oct 16, 2023 3:31 am

Re: Run container on event - DHCP

Fri May 10, 2024 10:34 pm

I was thinking of creating the ultimate travel router, where it would automatically connect to various well-known hotel chain WiFi. But I guess RouterOS cannot do this.
 
User avatar
Larsa
Forum Guru
Forum Guru
Posts: 1092
Joined: Sat Aug 29, 2015 7:40 pm
Location: The North Pole, Santa's Workshop

Re: Run container on event - DHCP

Fri May 10, 2024 11:06 pm

But you can, although you need to use various tricks to identify the different hotel networks and create script to perform appropriate actions accordingly.

Additionally, check https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-LeaseScriptExampleLeasescriptexample. You can also schedule scripts to check various resources and perform arbitrary actions.

Who is online

Users browsing this forum: No registered users and 1 guest