народ скрипт не работает.... довёл до вида
#set variables
:local pingcount 3;
:local ipA [/ip address get [find interface="inet1"] address];
:local GatewayA [192.168.5.1];
:local ipB [/ip address get [find interface="inet2"] address];
:local GatewayB [192.168.8.1];
#ping gateways with src
:local pingresultYAA [/ping 213.180.204.8 src-address=$ipA count=$pingcount];
:local pingresultYAB [/ping 213.180.204.8 src-address=$ipB count=$pingcount];
#if link_A is DOWN and link_B is UP then:
:if (($pingresultYAA=0) && ($pingresultYAB=$pingcount)) do={
/ip route set [find comment="Default Gateway"] gateway=$GatewayB;
:log info "if link_A is DOWN and link_B is UP";
}
#if link_A is UP and link_B is DOWN then:
:if (($pingresultYAA=$pingcount) && ($pingresultYAB=0)) do={
/ip route set [find comment="Default Gateway"] gateway=$GatewayA;
:log info "link_A is UP and link_B is DOWN";
}
#if both link DOWN:
:if (($pingresultYAA=0) && ($pingresultYAB=0)) do={
/ip route set [find comment="Default Gateway"] gateway=$GatewayA;
:log info "if both link DOWN";
}
# Link A or Link B both are UP:
:if (($pingresultYAA!=0) && ($pingresultYAB!=0)) do={
:log info "Link A or Link B both are UP";
/ip route set [find comment="Default Gateway"] gateway=$GatewayA,$GatewayB,$GatewayA;
}
где затык? помогите плиз очень надо