Ok folks. This quest is almost over. I've lost 4 days to find out that
there was a tiny bug inside.
Don't ask me why, but diald is unable to make both tap0 and then ppp0
the default gateway.
At compile i've changed config.h to read:
#undef PATH_ROUTE "/sbin/route"
and that's exactly where 'route' is.
I've also attached the config which has the 'defaultroute' enabled.
I'm just too lazy to see the diald code, but if there is someone else
with this problem this is how I resolved it:
look inside my diald starting script and notice the 'route ...' command
inside
it is possible that on slow machines the 'sleep' command should be
increased ...
You must also add these lines in a script that gets loaded after
ppp-up.
(the 'extip=...' is in a single line! ;)
extip="`/sbin/ifconfig ppp0 | grep 'inet addr' | awk '{print $2}' | sed
-e 's/.*://'`"
route add default gw $extip
This line should be added to some script after ip-down.
route add default gw 192.168.1.10
In every example 192.168.1.10 repesents the (fake) remote address from
diald.conf
Any comments?
Bye
Peter
#!/bin/sh
#
# (C) Copyright 1995-1999 Mike Jagdis <[EMAIL PROTECTED]>
#
#
# Configure the managed interfaces.
#
# This script would normally be installed as /etc/rc.ddiface,
# /etc/init.d/ddiface, /etc/rc[1-5].d/SXXddiface or similar
# depending on your system religion.
# CONFIGURABLE STUFF
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
config_dir=/etc/diald
# END OF CONFIGURABLE STUFF
action="$1"
shift
interfaces="$*"
if [ -n "$BASH_VERSION" ]; then
enable echo
enable kill
use_escapes='-e'
else
use_escapes=''
fi
case "${action}" in
start)
# Try and load compression modules before doing
# anything that might load SLIP/PPP modules.
modprobe bsd_comp ppp_deflate > /dev/null 2>&1
echo $use_escapes "Configuring managed interfaces:\c"
cd "$config_dir"
for link in ${interfaces:-*}
do
if [ -d "$link" -a -r "$link/config" ]; then
echo $use_escapes " $link\c"
diald -f "$config_dir/$link/config" \
pidfile "diald.$link"
fi
done
sleep 1
/sbin/route add default gw 192.168.1.10
echo
;;
stop)
if [ -z "$interfaces" ]; then
pids=`cat /var/run/diald.* 2> /dev/null`
else
# FIXME: If we take down all the interfaces using
# a single, generic ipppd we ought to take that
# down too. But how do we know?
pids=`for link in $interfaces; do
cat "/var/run/diald.$link"
done 2> /dev/null`
fi
if [ -z "$pids" ]; then
echo "No managed interfaces to stop"
exit 0
fi
kill $pids > /dev/null 2>&1
sleep 1
for retry in 1 2 3; do
if kill $pids > /dev/null 2>&1; then
: some still exist
sleep 2
else
echo "Managed interfaces stopped"
break
fi
done
;;
*) echo "usage: diald start|stop [link ...]"
exit 1
;;
esac
debug 24
linkname "fx"
linkdesc "FX Internet"
# Lock in use devices
lock
#device /dev/ttyS0
device /dev/ttyS1
modem
crtscts
speed 115200
mode ppp
authsimple "/etc/diald/fx/auth"
accounting-log "/var/log/diald.fx"
pidfile "/var/run/diald.fx"
fifo "/var/adm/diald/fx"
tcpport 10000
# Use fake addresses initially. Once FX has told us our real
# address we know it is static.
local 192.168.1.5
remote 192.168.1.10
# Subnet mask for the wan link
#netmask 255.255.255.0
#netmask 0.0.0.0
# The IP addresses will be asigned when connection starts.
dynamic
# If link goes down by remote end, start it again only if there is
# outgoing packets.
two-way
# When link is up, route directly to the real ppp interface, not the proxy
# interface. Not to do this is a performance lost of about 20 per cent.
# There are old kernels that do not support reroute. See diald manual for
# more information
reroute
#sticky
#pppd-options noipdefault
# We can reach the world via FX...
defaultroute
# More or less standard stuff.
redial-timeout 30
died-retry-count 0
connect-timeout 600
#retry-count 3
#dial-fail-limit 10
start-pppd-timeout 120
pppd-options noauth user [EMAIL PROTECTED]
connect "/usr/share/diald/connect"
include "/usr/share/diald/filter/standard"