From owner-freebsd-isdn Wed Jun 17 10:38:22 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA29325 for freebsd-isdn-outgoing; Wed, 17 Jun 1998 10:38:22 -0700 (PDT) (envelope-from owner-freebsd-isdn@FreeBSD.ORG) Received: from maila.telia.com (root@maila.telia.com [194.236.189.4]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA29317 for ; Wed, 17 Jun 1998 10:38:20 -0700 (PDT) (envelope-from Arve.Ronning@ah.telia.no) Received: from d1o203.telia.com (root@d1o203.telia.com [195.204.220.241]) by maila.telia.com (8.8.8/8.8.8) with ESMTP id TAA10754; Wed, 17 Jun 1998 19:38:00 +0200 (CEST) Received: from DxCC.home.no (t8o202p58.telia.com [195.204.219.238]) by d1o203.telia.com (8.8.5/8.8.5) with SMTP id TAA06955; Wed, 17 Jun 1998 19:40:13 +0200 (CEST) Message-ID: <3587FED6.167EB0E7@ah.telia.no> Date: Wed, 17 Jun 1998 19:37:26 +0200 From: Arve Ronning X-Mailer: Mozilla 3.03Gold (X11; I; FreeBSD 2.2.5-RELEASE i386) MIME-Version: 1.0 To: Stefan Herrmann CC: freebsd-isdn@FreeBSD.ORG Subject: I4B & NAT (was : succeeded !) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-isdn@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Stefan wrote: > > Hi Arve, > > > Natd -dynamic in cooperation with sppp doesn't work the way people seem > > to think. Natd -dynamic opens a routing socket and waits for a routing message > > which is assumed to arrive when the interface gets a new IP-address. > > However, sppp doesn't supply a routing message for natd when the IP-address is > > changed during ppp address negotiation. > > > > The result is that the interface IP-address stored in natd doesn't get updated > > after a redial. > > > > However, (as always in the unix world:) there is a way around this problem. > > I use a script which does a kill -HUP on natd when i4b comes up after a > > (re)dial. This forces natd to (re)read the interface IP-address. The script > > is executed by isdnd. > > > > I don't have the details here (at work). If you are interested, I'll check the > > setup (at home). > > I have (naturally) the same problem and am interessted in your script. Thanks :-) > > Ciao > Stefan > -- The solution was originally provided by "D. Rock" and it's based on the regexpr/regprog facility in isdnd.rc . The following is an extract from my isdnd.rc: ---------------- in the "system" section, add this ------- regexpr = "call active" # look for matches in log regprog = isdn_up # execute program when match regexpr = "call disconnected" regprog = isdn_down ---------------------------------------------------------- which will make isdnd do the following: start: if ( "call active" is written to isdnd.log ) run isdn_up; if ( "call disconnected" is written to isdnd.log ) run isdn_down; goto start; So, to make it work, isdnd must be started with the -l option in order to generate /var/log/isdnd.log . The isdn_up & isdn_down scripts reside in /etc/isdn and both are executable and owned by root/wheel. The isdn_up script: ---------------------------------------------------------- #!/bin/sh cp /etc/isdn/isdnd.rc /dev/pcaudio pid=`cat /var/run/natd.pid` kill -HUP $pid sleep 1 kill -HUP $pid sleep 2 kill -HUP $pid sleep 5 kill -HUP $pid ---------------------------------------------------------- The isdn_down script: ---------------------------------------------------------- #!/bin/sh cp /etc/isdn/samples/answer /dev/pcaudio sleep 1 cp /etc/isdn/samples/answer /dev/pcaudio ---------------------------------------------------------- If you don't have /dev/pcaudio, just remove the line in isdn_up and the last pair of regexpr/regprog lines in isdnd.rc and omit the isdn_down script. The reason for using /dev/pcaudio is that I have a separate 386-box configured as an isdn gateway/router. This way I hear a long burst of noise when the isdn line connects and two shorter bursts when it disconnects. In short, the main point here is to be sure that natd receives at least one -HUP as soon as possible after the interface IP-address has changed. Regards -Arve To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isdn" in the body of the message