Greetings friends:
I have the following script that disables an interface of my RB when it pings google DNS and they do not respond, I need that same interface to be enabled when google DNS respond to ping, someone can help me.
Very limited info you provide, but if my understanding is correct, then there is a problem with your logic.
i.e. you ping 8.8.8.8 from ether 2, if no response, you disable interface, with this interface disabled, you will not be able to ping from it.
If reasons for doing this is dual WAN purposes, then rather look at disabling routes or something instead of the interface
If I try my friend and it does not work, I need a script where I ping the DNS 8.8.8.8 and if it does not respond disable the route of that interface in IP ROUTE, and the script continues pinging the DNS 8.8.8.8, when answer re-enable the route of that interface wn IP ROUTE.
Greetings, I have a load balancing of 2 ISPs, what I need is for WAN 2 to constantly ping DNS 8.8.8.8, so that when the ping does not respond, it disables that route and that clients leaving through WAN 2 can hear to WAN 1 due to the failover, and when WAN 2 has internet again, the clients that go out there will return again, I don’t know if you understand me friend.
Then the following should work if you add the comment label “ISP2” to the route going to your second provider. ETHERT 2 is not disabled this way, this because you can never detect when it is active again because it is disabled by you.
Msatter, there is no way that they are not 2 script, but only one? I do not know if you understand me, it would be something like that where 8.8.8.8 is pinged and if it does not respond, disable the rule in IP ROUTE, and that same script follows pinging 8.8.8.8 and if it responds enable the rule. It is something like the 2 scripts in one, if you can.
Tank you.
You should try to use recursive routes.
It will automatically ping a specific destination but you will need to have a static ping address per route.
for one route you can use 8.8.8.8
and the other 1.1.1.1