Setup guide

connection - netwatch, and a script, which runs the netwatch.
This is an example of how to make simple router backup system. In this example we'll use an ISDN
connection for purpose to backup a standard Ethernet connection. You can, however, use instead of
the ISDN connection anything you need - PPP, for example. When the Ethernet fail (the router nr.1
cannot ping the router nr.2 to 2.2.2.2 (see picture) the router nr.1 will establish an ISDN connection,
so-called backup link, to continue communicating with the nr. 2.
You must keep in mind, that in our case there are just two routers, but this system can be extended
to support more different networks.
The backup system example is shown in the following picture:
In this case the backup interface is an ISDN connection, but in real applications it can be
substituted by a particular connection. Follow the instructions below on how to set up the backup
link:
• At first, you need to set up ISDN connection. To use ISDN, the ISDN card driver must be
loaded:
[admin@Wandy] driver> add name=hfc
The PPP connection must have a new user added to the routers one and two:
[admin@Wandy] ppp secret> add name=backup password=backup service=isdn
An ISDN server and PPP profile must be set up on the second router:
[admin@Wandy] ppp profile> set default local-address=3.3.3.254
remote-address=3.3.3.1
[admin@Wandy] interface isdn-server> add name=backup msn=7801032
An ISDN client must be added to the first router:
[admin@Wandy] interface isdn-client>
add name=backup user="backup" password="backup" phone=7801032 msn=7542159
• Then, you have to set up static routes
Use the /ip route add command to add the required static routes and comments to them.
Comments are required for references in scripts.
The first router:
[admin@Wandy] ip route> add gateway 2.2.2.2 comment "route1"
The second router:
[admin@Wandy] ip route> add gateway 2.2.2.1 comment "route1" dst-address 1.1.1.0/24
• And finally, you have to add scripts.
Add scripts in the submenu /system script using the following commands:
The first router:
[admin@Wandy] system script> add name=connection_down \
\... source={/interface enable backup; /ip route set route1 gateway 3.3.3.254}
[admin@Wandy] system script> add name=connection_up \
\... source={/interface disable backup; /ip route set route1 gateway 2.2.2.2}
The second router:
[admin@Wandy] system script> add name=connection_down \
\... source={/ip route set route1 gateway 3.3.3.1}
[admin@Wandy] system script> add name=connection_up \
\... source={/ip route set route1 gateway 2.2.2.1}
• To get all above listed to work, set up Netwatch utility. To use netwatch, you need the
advanced tools feature package installed. Please upload it to the router and reboot. When
installed, the advanced-tools package should be listed under the /system package print list.
Add the following settings to the first router:
[admin@Wandy] tool netwatch> add host=2.2.2.1 interval=5s \
\... up-script=connection_up down-script=connection_down
Add the following settings to the second router:
[admin@Wandy] tool netwatch> add host=2.2.2.2 interval=5s \
\... up-script=connection_up down-script=connection_down