Community discussions

MikroTik App
 
arsagor
just joined
Topic Author
Posts: 1
Joined: Mon Jan 23, 2023 12:24 pm

how to disable and enable vlan when specific IP ping reachable /unreachable

Mon Jan 23, 2023 9:00 pm

How to disable one VLAN and enable another when a specific IP address becomes unreachable, and then reenable the previous VLAN and disable the running VLAN when the IP address becomes reachable again. Does anyone have such a script?
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3291
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: how to disable and enable vlan when specific IP ping reachable /unreachable

Tue Jan 24, 2023 7:58 am

Use Netwatch


----------------------------------------------------------------------------------------
Use Splunk> to log/monitor your MikroTik Router(s). See link below. :mrgreen:

MikroTik->Splunk
Last edited by Jotne on Sun Feb 12, 2023 9:58 pm, edited 1 time in total.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3291
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: how to disable and enable vlan when specific IP ping reachable /unreachable

Tue Jan 24, 2023 12:10 pm

In Tools->Netwatch add a new host +
Set the IP to monitor in the host field.
Under Down add the vlan to be down/uplike this:
interface/vlan/set vlan10 disabled=yes
interface/vlan/set vlan20 disabled=no
Under Up reverse the down
interface/vlan/set vlan10 disabled=no
interface/vlan/set vlan20 disabled=yes
NB, you can not use an IP that need the vlan to be monitored. How should it then ever enable the vlan.


----------------------------------------------------------------------------------------
Use Splunk> to log/monitor your MikroTik Router(s). See link below. :mrgreen:

MikroTik->Splunk

Who is online

Users browsing this forum: caldo85 and 21 guests