Maybe I wasn't real clear in my last post.... An easy way to do this
has been worked out. Here is the readme file from
ftp://gw.ko6ri.ampr.org/pub/dynamic_gate/dynamic_gate.tar.gz
This is limited to adding and dropping routes in nos but you can do just
about any thing you want in Linux. All you have to do is run the remote
script after doing the dialup.
<><><><><><><><><><><><><><><><><><><><><><><><><><>
Doing IPIP with a dynamically issued IP address is easy. To make the
tunnel work, each end of the tunnel needs to know the other ends IP
address. When one end of the tunnel gets a new address it must tell the
other end what its new address is and that host must make a change to
its routes. There are a number of ways to do this, but when Barry K2MF
added a method of doing this to MFnos, which was adopted by Jnos and
Tnos, that way, pretty much, became standard.
Remote
You need to add this line to your /etc/services file.
remote 1234/udp
You can install remote anywhere you like but you might want to do a
chown root.root and a chmod 770.
Usage is as follows....
remote -k <key> -r <destIPaddr>[/bits] <hostname> add|drop [gw address]
key is the password in Nos or the name of the script used in Linux.
destIPaddr is the host/network that you want routed.
hostname is the host you are sending the packet to
add or drop are the command use to add or drop a route
gw address is the address of the gateway host on the route command
The following command would have the host 192.168.0.1 add an encap route
for network 44.3.0.0 netmask 255.255.255.0 using the sending hosts
address
for the gateway. The result being
route add -net 44.3.0.0 netmask 255.255.255.0 gw <the host that send the
packet> dev tunl0
remote -k script_name -r 44.3.0.0/24 192.168.0.1 add
Remoted
Remoted listens on socket 1234 and attempts to run a script with the
same name as the password <key> send by the remote client. It it can't
find
that file it tries to run a script called 'default'.
I start remoted from /etc/rc.d/rc.local like this....
/usr/local/sbin/remoted >> /var/log/remoted &
This way I get a a log of all activities.
You will need to create the directory /etc/dyrouter. You can change
that to any directory you want by changing the variable $scriptdir on
line 11.
You can put the example script 'dygate' in that directory or write your
own. When the add command is received the current route is dropped and
the encap route is added. A host on the other side of the tunnel is
then pinged. The route remains until the ping fails or the drop or a
new add command is received. The host that is pinged shouldn't be the
same as the gateway, but should be a host on the other side of the
gate. If the dynamically issued address is used as the ping host and
and this address is reissued the route will not drop properly so be sure
to use a 44 address in the net you are setting up the tunnel for as the
ping host.
--
Later...
Bob
http://gw.ko6ri.ampr.org/bbs