script resolve address to activat backup

my company use icmp drop i cant ping yahoo or any site

i want script depend it on resolve address like here…

yahoo.com [98.137.149.56] with 32 bytes of data:
timed out.
timed out.

if address can be resolve it accpet as internet ok if address not resolved use backup conection

any idea any commant D:
script to enabel pppoe5 if case B true eles disable pppoe5

case (A)
kaza@MikroTik] > ping yahoo.com
98.137.149.56 ping timeout
98.137.149.56 ping timeout
98.137.149.56 ping timeout

case(B)
kaza@MikroTik] > ping yahoo.com
no route to host
no route to host

I have no idea what you are trying to do. Please describe the problem you’re trying to solve (and leave out what you think is the right solution - just describe the problem) as detailed as possible.

just create default with higher distance and gateway=pppoe5…

lol i see no one get my problem sorry sure it my fult i will try my best

i have 2 provider pppoe 1 and dsl 2

sure i wnat to use dsl as backup only when my 1st provider down (pppoe)

my pppoe drop ping on all site like google yahoo i can ping only my dns

problem is some time even there is ping on my dns there no internet

but 90% when i have internet i can resolve the ip of each site
ping yahoo.com
98.137.149.56 ping timeout
98.137.149.56 ping timeout

but when no interner i can;t reslove the ip of any site (ping to my dns alive)

for me, this works… a bit… on v4.2 =)

{
  :global var "failure";
  :execute ":set var [:resolve \"somesite.com\"];";
  :delay 3;
  :if ($var = "failure") do={ :put "down" } else={ :put "up" }
}

i have MT 3.30 (and some other RB but later than 3.30)
do u think it will work with 3.30

plz i want this scprit to enable pppoe20 if (down{no resolve}) and disable if (up {reslove})


i had read sometime in try to learn script but not hope :smiley: from where i should start to learn scripting


thx

try to run the script with existent and non-existent names =)

bad idea is underlined %) as soon as you enable backup link, addresses are resolvable again

opppps
righte… any idea
what about test form pppoe1 since pppoe20 is backup

???

can i force the tese of reslove use pppoe1

if not

what best idea to use backup line only when real line down ???

use specific Ethernet port to make the resolve (Ethernet 1)

Ethernet1 for main line
Ethernet2 for back up
Ethernet3 for client

help in modify this scripte
{
:global var “failure”;
:execute “:set var [:resolve "somesite.com"];”; form Ethernet1
:delay 3;
:if ($var = “failure”) do={ :put “down” change client gateway form gateway1 to gateway2 for client not for resolving } else={ :put “up” }
}

well, if your user’s do NOT use your router as DNS, then it will work

just create new routing table with two default routes (gateway=pppoe-main with distance=10 and gateway=pppoe20 with distance=1), and leave your main routing table with 1 default route - via your main uplink. then mark all users’ traffic with necessary mark, so even if pppoe20 is up, it’s used only by your users, not by your router

what you mean here ???

and here users you mean ???

iam work this pcc

pcc with one line?.. I’m not sure I understand your setup…

yes pcc with one interface
cuz my company support only account 512

so i have

interface clinet
interface pcc (main conection)
interface dsl (backup)

need script work with resolve address

for what do you use pcc?.. (O_o)

2o pppoe account used on it

omg!.. 2 pppoe accounts are two interfaces. in case of failure of what of them do you want to use your backup line?..

interface 1 pppoe 20 account (main line)
interface 2 dsl 1 account (back up)
interface 3 client

in case of fail interface 1 use back up interface 2