Wilson,
I have a similar requirement to yours. I use two instances of
diald, one to access
the RAS at work and the other to access my ISP. For the record, I
am using Redhat
6.1, diald-0.99.4, pppd-2.3.11, and the 2.2.14 kernel. You could
use a script to
command the fifos make real time changes to which instance is
controlling the
connection, or use dctrl. I hope I got everything.
----------------------------------------------------------------------------------------
The ISP config file (/etc/diald/freeweb.conf) is as follows:
ignore tcp tcp.fin
accept any 300 any
# stuff to set up the diald connection
device /dev/ttyS1
speed 115200
lock
mode ppp
dynamic
local 10.0.0.1
remote 10.0.0.2
netmask 255.255.255.252
pppd-options asyncmap 0 user useratisp remotename fw
defaultroute
modem
crtscts
connect "/usr/sbin/chat -f /etc/ppp/chat.fw -r
/etc/ppp/connect-errors"
redial-timeout 10
fifo /etc/diald/fw.ctl
# go get my email each time the connection comes up
ip-up /etc/diald/ipup.gnc
----------------------------------------------------------------------------------------
The config for work (/etc/diald/kuda.conf):
accept any 300 any
device /dev/ttyS1
speed 115200
lock
mode ppp
dynamic
local 11.0.0.1
remote 11.0.0.2
netmask 255.255.255.252
pppd-options asyncmap 0 user useratwork remotename kuda
modem
crtscts
connect "/usr/sbin/chat -f /etc/ppp/kudachat -r
/etc/ppp/connect-errors"
redial-timeout 10
fifo /etc/diald/kuda.ctl
addroute /etc/diald/add.kuda.route
ip-up /etc/diald/ipup.kuda
----------------------------------------------------------------------------------------
The work config does not contian the "defaultroute" option. A
single route to a
subnet at work is added via the addroute option. The
/etc/diald/add.kuda.route
script is as follows:
----------------------------------------------------------------------------------------
#! /bin/bash
/sbin/route add -net 163.206.0.0 netmask 255.255.0.0 dev $1
----------------------------------------------------------------------------------------
So any time I access the 163.206.0.0 subnet the second instance of
diald will be
handle the dialup, calling the RAS at work. To accomodate
accessing the internet
while dialed into work, this ip-up script is used:
----------------------------------------------------------------------------------------
/etc/diald/ipup.kuda:
#! /bin/bash
/sbin/route add -net 0.0.0.0 dev $1
Ancillary data:
----------------------------------------------------------------------------------------
/etc/ppp/pap-secrets:
# PAP secrets file
# remotenames ppp<n> are reserved for netcfg
#
# Format:
#name remote secret
useratwork kuda passwordatwork
useridatisp fw passwordatisp
----------------------------------------------------------------------------------------
/etc/ppp/options:
noauth
----------------------------------------------------------------------------------------
I use the following (/etc/rc.d/init.d/diald) to start the two
instances of diald:
#!/bin/sh
#
# chkconfig: 345 92 34
# description: Starts and stops the diald daemons \
# used to provide dial on demand services.
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
# See how we were called.
case "$1" in
start)
# Turn on ip_dynaddr
echo "1" > /proc/sys/net/ipv4/ip_dynaddr
# Start daemons.
if [ -f /etc/diald/diald.conf ]
then
echo -n "Starting diald for freewwweb: "
diald -f /etc/diald/freeweb.conf
echo
fi
if [ -f /etc/diald/kuda.conf ]
then
echo -n "Starting diald for kuda: "
diald -f /etc/diald/kuda.conf
echo
fi
;;
stop)
# Stop daemons.
if [ -f /etc/diald/diald.conf ] || [ -f
/etc/diald/kuda.conf ]
then
echo -n "Stopping diald: "
killall diald
echo
fi
;;
status)
status diald
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: diald {start|stop|status|restart}"
exit 1
esac
Regards,
Bob...
Wilson Fletcher wrote:
> David, thanks for the interesting example.
>
> I think you misunderstood what the discussion was about however. What I
> and, I think, Tim Coleman also wanted to do was dial different host to
> allow the same routing.
>
> ie. Although in my case one target is Work and another is a general ISP
> there are times when I will choose to access the wider internet via my work
> server. Your technique appears to only cater for internet traffic going via
> your ISP OR work traffic going via work.
>
> Since the routing will be determined on some arbitrary basis I cannpt setup
> routing that says ALL work traffic should go through device X while ALL
> other traffic should go through device Y which I think is the purpose of
> your example. (correct me if I'm wrong).
>
> What I am wanting to do is to change the host ends of my link but once the
> link is up all routing and access will be the same regardless of the host.
> By achieving this I aim to be able to CHOOSE which host to dial when the
> kernel boots and then also to possibly be able to switch hosts even midway
> through a connection.
>
-
To unsubscribe from this list: send the line "unsubscribe linux-diald" in
the body of a message to [EMAIL PROTECTED]