[PLUTO-help] Connessione / Disconnessione automatica ;-)

Paolo Ornati ornati a fastwebnet.it
Ven 9 Lug 2004 17:36:58 CEST


On Thursday 08 July 2004 12:08, gigi quipo wrote:
> se non ricodo male c'era anche "diald" che attivava e disattivava la
> connessione

sembra che faccia al caso mio... perņ non sono riuscito a configurarlo a 
dovere ;-(

Cmq ho scritto i miei problemi sulla sua mailing-list 
(linux-diald a vger.kernel.org), tra l'altro in un Inglese alquanto scarno ;-)

Siccome č una mailing-list poco frequentata... riporto una copia della mail 
(sperando che qualcuno la capisca!):


-------------------------------------------------------------------------------
Hello,
I have a quite strange (unusual) Internet connection and I can't get DIALD do 
what I want.

PS = [ I really hope that this english is good enougth to be readable ;-]

Basically the situation is this:

1) I'm always in a network (through my Ethernet card) / my IP and GATEWAY are 
dinamically set up using DHCP

My routing table look like this:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
GATEW_NET     *               255.255.248.0   U     0      0        0 eth0
loopback        tux.homenet     255.0.0.0       UG    0      0        0 lo
default         GATEW_ADDR     0.0.0.0         UG    0      0        0 eth0


2) I have free access to some subnetworks/hosts on this netwok, but if I want 
to go out (on the real Internet) I must authenticate me (username + pass) 
through a Web page (that uses the POST method to communicate to the server) / 
the same thing to "Disconnect" me from Internet (obviously I pay for every 
sencond of this "connection")


3) To automate the connection / disconnection procedure I wrote a program that 
talks directly with the server sending Username & Password through the HTTP 
protocol / POST method


Now I want to set up DIALD to call my program when any packet wants to go out 
of my network (so when they want to go on Internet ;)... and to call my 
program also to close the connection (after the usual timeouts).

I have already installed DIALD and done some experiments with configuration 
files, now it is in an half-working state...


# CONFIGURATION #

To allow free access to the few subnetwoks that don't need the "Connection" I 
have done something like this:

route add -net aaa.bbb.ccc.0 netmask 255.255.255.0 gw MYGATEWAY eth0

for every subnetwork, of course.

( DIALD.CONF )
___________________________________________________________
mode dev                                                                # OK
connect "my_connection_program"         # OK
disconnect "my_disconnection_program"   # OK
device eth0                                                     # OK

local 10.0.0.2
remote 10.0.0.3 
dynamic                 # ???, I think this is right...
defaultroute
connect-timeout 5
redial-timeout 5
retry-count 3
include /etc/diald/diald.filter
fifo /var/cache/diald/diald.ctl
___________________________________________________________


(DIALD.FILTER) --> nothing of special


After that DIALD is started the routing table look like this:

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
...
free networks, for example:
213.140.2.0     MYGATEWAY     255.255.255.0   UG    0      0        0 eth0
...
10.0.0.3        *               255.255.255.255 UH    1      0        0 sl0
GATEW_NET    *               255.255.248.0   U     0      0        0 eth0
loopback        tux.homenet     255.0.0.0       UG    0      0        0 lo
default         *               0.0.0.0         U     1      0        0 sl0


When any packet wants to go out my program is correctly called... and the 
routing table corrected:

A) the two entries of the "sl0" device are REMOVED

B) default route is set through "eth0" device:
default         *               0.0.0.0         U     0      0        0 eth0


FIRST PROBLEM: the gatway of the default route is set to 0.0.0.0 but I really 
want my GATEWAY address here (that, unless DHCP, is a fixed IP), how can I do 
this?

SECOND PROBLEM: when connection go down due to timeout the Routing Table is 
revolutionized !!! (this happen just before that my "Disconnection" program 
is called) :

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.3        0.0.0.0         255.255.255.255 UH    1      0        0 sl0
10.0.0.0        0.0.0.0         255.255.248.0   U     0      0        0 sl0
127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo
0.0.0.0         0.0.0.0         0.0.0.0         U     1      0        0 sl0

As you can see every routing entry about eth0 is removed!!!

And doing "ifconfig eth0" I see that I have lost my connection to the network 
(no more "inet addr: ...") so I must restart my eth0 setup script 
(/etc/init.d/net.eth0) that does the DHCP setup again.

Please HELP me!

-------------------------------------------------------------------------------


CIAO

-- 
	Paolo Ornati
	Gentoo Linux (kernel 2.6.7-gentoo-r8)


More information about the pluto-help mailing list