ping interface=ether1-gateway 89.xx.xx.xx

Hi all.

I have 1 question.

There are 2 wan interface Main and reserve and script that switch them.
main - dhcp
reserve - adsl

When i’m on reserv channel i have
[admin1@pmr2-Office] > ping interface=ether1-gateway google.com
HOST SIZE TTL TIME STATUS
173.194.113.197 timeout
173.194.113.197 timeout
173.194.113.197 timeout


DNS works fine, routes too.

Then i’m om main channel

[admin1@pmr2-Office] > ping interface=pppoe-out1 orange.md
HOST SIZE TTL TIME STATUS
94.243.64.199 56 56 118ms
94.243.64.199 56 56 115ms
sent=2 received=2 packet-loss=0% min-rtt=115ms avg-rtt=116ms max-rtt=118ms

All looks fine.

What i do wrong ?

We need to see your config

Do not use interface param when pinging in ipv4 broadcast networks. It reliably works only with ipv6 and point to point interfaces.

But how can i get a satus of the WAN connection ?

Nowadays I do the same way.

:local isp2 [/ping interface=ether2 $CheckIp2 count=$PingCount];

FireWall all pass through.

[123@pmr2-Office] > ip route print
Flags: X - disabled, A - active, D - dynamic, 
C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, 
B - blackhole, U - unreachable, P - prohibit 
 #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
 0 A S  ;;; gw1
        0.0.0.0/0                          89.187.36.97              2
 1 X S  ;;; gw2
        0.0.0.0/0                          pppoe-out1                1
 2 ADC  89.187.36.96/27    89.18.36.15   ether1-gateway            0
 3 ADC  172.31.31.5/32     172.31.31.6     ToMD office               0
 4 A S  192.168.1.0/24     192.168.4.1     ToMD office               5
 5 ADC  192.168.4.0/24     192.168.4.1     bridge-local              0
 6 A S  192.168.15.0/24                    192.168.25.203            2
 7 A S  192.168.16.0/24                    192.168.25.200            2
 8 A S  192.168.17.0/24                    192.168.25.201            2
 9 ADC  192.168.25.200/32  192.168.25.1    <pptp-tir>                0
10 ADC  192.168.25.201/32  192.168.25.1    <pptp-ryb>                0
11 ADC  192.168.25.203/32  192.168.25.1    <pptp-ben>                0
12 A S  217.19.208.0/22                    pppoe-out1                1
13 ADC  217.19.208.34/32   31.3.12.15    pppoe-out1                0

Fix
I did like that

2 A S  ;;; pppoe ping test
        8.8.4.4/32                         pppoe-out1                1
 3 A S  ;;; Ethernet ping test
        8.8.8.8/32                         89.17.36.7              1

and script

:local PingCount 5

:local CheckIp1 8.8.8.8
:local CheckIp2 8.8.4.4

:local isp1 [/ping $CheckIp1 count=$PingCount]
:local isp2 [/ping $CheckIp2 count=$PingCount]
#/log warning $isp1
#/log warning $isp2
:local BackGw [/ip route get [find comment="gw2"] disable]

#if main ISP is DOWN and backup ISP is UP then:

:if (($isp1<=4) && ($isp2=$PingCount) && ($BackGw=true)) do={
:log error "Set routes to backup ISP"
/ip route disable [find comment="gw1"]
/ip route enable [find comment="gw2"]
/log error "Set routes to backup ISP"
}

:local MainGw [/ip route get [find comment="gw1"] disable]

#if main ISP is UP then:

:if (($isp1=$PingCount) && ($MainGw=true)) do={
:log error "Set routes to main ISP"
/ip route enable [find comment="gw1"]
/ip route disable [find comment="gw2"]
/log error "Set routes to main ISP"
}

Thx for your time!