Adding Static Routes - Tricky situation

Odhiambo Washington odhiambo at
Sun Dec 7 01:10:11 PST 2008

Hello list,

I have a situation where I am connecting two sites using mpd. mpd5 is
running at site A on server mode while mpd5 is also running on site B but on
initiator mode. Site B establishes a connection to site B to complete the
tunnel. This works so far, and users on the LAN on site B are able to reach
site A. Now I'd like to enable users on site A to also reach site B side of
the LAN, but I don't see where in mpd I can do it. After some little
thinking, I have noticed that I can add a static route definition to site A
from site A, but this route can only be added when the tunnel interface is

So far, I have assumed that in 120secs after (re)booting the server on site
A, and assuming server on site B is up, it will be able to (re)establish the
vpn connection to site A, and thus ng0 will be up.
With that in mind, I am running a small primitive script in
/usr/local/etc/rc.d/ that:

sleep 120
/sbin/route add -net a.b.c.d/24 -iface ng0

This is working, but it is quote primitive for me.
I'd like this script to run based on the following conditions:

1. That mpd is started successfully
2. That ng0 is up

Site A is FreeBSD 5.5-STABLE (yeah, I will soon upgrade it) while site B is
FreeBSD-7.1-PRE, so both sides should support rcNG type scripts.

Appreciate your help on how I can check for the two conditions.

Best regards,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
"Okay guys. This is Kenya. You pay taxes because you feel philanthropic,
unlike our MPs!"
                    -- Kenneth Marende, Speaker, 10th Parilament.

More information about the freebsd-questions mailing list