Hi,
i need a script that check wan connection (ping to gateway). if it is dead (Ping is unreachable) then all of my users get a message via my webserver. otherwise all of my http, goes to my proxy server.
But i don’t know how to write scripts.
situation like this:
if [ping my_gateway = unreachable] then
ip firewall nat set chain=dstnat in-interface=Public protocol=tcp dst-port=80 action=dst-nat
to-addresses=192.168.100.2 to-ports=80 comment=“” disabled=no
else
ip firewall nat set chain=dstnat in-interface=Public protocol=tcp dst-port=80 action=dst-nat
to-addresses=192.168.140.3 to-ports=8080 comment=“” disabled=no