Page 1 of 1

Script for down & up interfaces

Posted: Wed Jan 26, 2022 7:47 am
by mazinsaeed
Hi , I want to do a script if interface sfp-sfpplus1 down , enable ether10 and vice versa

My main interface is sfp-sfpplus1 and the backup interface is ether10 , the ( sfp-sfpplus1 coming from fiber optic and ether10 is a backup line from same service provider )

ether10 is disabled and the service is up from sfp-sfpplus1

So I want to do a script if interface sfp-sfpplus1 down , enable ether10 & if sfp-sfpplus1 is up back disable ether10

sfp-sfpplus1 & ether10 are in same bridge1

Best Regards

Re: Script for down & up interfaces

Posted: Wed Jan 26, 2022 8:25 am
by Jotne
Here you go:

Disable sfp-sfpplus1, enable ether10
{
/interface/ethernet/disable [find where name=sfp-sfpplus1]
/interface/ethernet/enable [find where name=ether10]
}
Disable ether10, enable sfp-sfpplus1
{
/interface/ethernet/disable [find where name=ether10]
/interface/ethernet/enable [find where name=sfp-sfpplus1]
}

Re: Script for down & up interfaces

Posted: Thu Jan 27, 2022 7:26 am
by mazinsaeed
Here you go:

Disable sfp-sfpplus1, enable ether10
{
/interface/ethernet/disable [find where name=sfp-sfpplus1]
/interface/ethernet/enable [find where name=ether10]
}
Disable ether10, enable sfp-sfpplus1
{
/interface/ethernet/disable [find where name=sfp-sfpplus1]
/interface/ethernet/enable [find where name=ether10]
}

Hi , both of them have same code ???

Re: Script for down & up interfaces

Posted: Thu Jan 27, 2022 8:20 am
by Jotne
Fixed in above post.

Re: Script for down & up interfaces

Posted: Thu Jan 27, 2022 10:06 am
by mazinsaeed
Fixed in above post.
is it working like Sisco switch as Add Ethernet Flex I/O ?

when spf interface down , enabling ether10 and vice versa ??

Re: Script for down & up interfaces

Posted: Thu Jan 27, 2022 12:43 pm
by Jotne
Not sure what you mean.
What I posted was a manual change.

Do you like a script that automatically change port? Try Netwatch