Confused by mpd and ipnat

2002-12-09 Thread leafy
I run -current and decided to try kernel PPPoE. I installed mpd from ports
which ran fine. After installing ipnat, I setup the following rule in
ipnat.rules:

map ng0 192.168.0.0/24 - 0/32

When I reboot, this line (along with ipnat stuff) got executed before mpd
fiinishes PPPoE negotiation, and ipnat -l shows that the ng0 ip was 0.0.0.0/32.
Is there anyway I can ensure that ipnat -f /etc/ipnat.rules get executed
only after mpd has obtained proper ip settings?

Thank you,

JY

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Confused by mpd and ipnat

2002-12-09 Thread Michael Bretterklieber
Hi,

leafy schrieb:
 I run -current and decided to try kernel PPPoE. I installed mpd from ports
 which ran fine. After installing ipnat, I setup the following rule in
 ipnat.rules:
 
 map ng0 192.168.0.0/24 - 0/32
 
 When I reboot, this line (along with ipnat stuff) got executed before mpd
 fiinishes PPPoE negotiation, and ipnat -l shows that the ng0 ip was 0.0.0.0/32.
 Is there anyway I can ensure that ipnat -f /etc/ipnat.rules get executed
 only after mpd has obtained proper ip settings?
 
You can set this rule in an iface up-script:
set iface up-script script
set iface down-script script

bye,
-- 
--- --
Michael Bretterklieber  - [EMAIL PROTECTED]
JAWA Management Software GmbH   - http://www.jawa.at
Liebenauer Hauptstr. 200-- privat 
A-8041 GRAZ GSM: ++43-(0)676-93 96 698  
Tel: ++43-(0)316-403274-12  E-mail:   [EMAIL PROTECTED]
Fax: ++43-(0)316-403274-10  http://www.inode.at/mbretter
--- --
...the number of UNIX installations has grown to 10, with more expected...
   - Dennis Ritchie and Ken Thompson, June 1972


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Confused by mpd and ipnat

2002-12-09 Thread Mike Makonnen
On Tue, Dec 10, 2002 at 12:06:21AM +0800, leafy wrote:

 map ng0 192.168.0.0/24 - 0/32

 When I reboot, this line (along with ipnat stuff) got executed before mpd
 fiinishes PPPoE negotiation, and ipnat -l shows that the ng0 ip was 0.0.0.0/32.
 Is there anyway I can ensure that ipnat -f /etc/ipnat.rules get executed
 only after mpd has obtained proper ip settings?

Does mpd install a startup script in /usr/local/etc/rc.d ? Does it get started
in the background? If it's script is in /usr/local/etc/rc.d then it gets
run by the /etc/rc.d/local script which runs after /etc/rc.d/ipnat. In this
case you can simply re-apply the rules after the negotiation is completed:
/etc/rc.d/ipnat reload

Cheers.
-- 
Mike Makonnen  | GPG-KEY: http://www.identd.net/~mtm/mtm.asc
[EMAIL PROTECTED] | Fingerprint: D228 1A6F C64E 120A A1C9  A3AA DAE1 E2AF DBCC 68B9



msg48442/pgp0.pgp
Description: PGP signature


Re: Confused by mpd and ipnat

2002-12-09 Thread leafy
On Mon, Dec 09, 2002 at 06:17:27PM -0800, Mike Makonnen wrote:
 Does mpd install a startup script in /usr/local/etc/rc.d ? Does it get started
 in the background? If it's script is in /usr/local/etc/rc.d then it gets
 run by the /etc/rc.d/local script which runs after /etc/rc.d/ipnat. In this
 case you can simply re-apply the rules after the negotiation is completed:
 /etc/rc.d/ipnat reload
 
 Cheers.
 -- 
 Mike Makonnen  | GPG-KEY: http://www.identd.net/~mtm/mtm.asc
I finally got over this one. The problem is that mpd needs a very long time
for PPPoE negotiation, thus if we run ipnat reload before it's settled, that
will be totally useless. So I moved the mpd startup script to
PREFIX/etc/rc.d/000.mpd.sh and the ipnat reload in zzz.ipnat_reload.sh and
VIOLA!

Putting them in the same script does not work, maybe this could be improved?

JY
 



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Confused by mpd and ipnat

2002-12-09 Thread Mike Makonnen
On Tue, Dec 10, 2002 at 11:24:59AM +0800, leafy wrote:
 I finally got over this one. The problem is that mpd needs a very long time
 for PPPoE negotiation, thus if we run ipnat reload before it's settled, that
 will be totally useless. So I moved the mpd startup script to
 PREFIX/etc/rc.d/000.mpd.sh and the ipnat reload in zzz.ipnat_reload.sh and
 VIOLA!
 
 Putting them in the same script does not work, maybe this could be improved?

How could this not work? Are you starting it in the background? Must be.
I'm assuming that you don't want to run them serially
because it would take too long to startup your system so you use some sort
of mechanism (like the -background option to ppp(8)) to run it in the background.
I would suggest that you do something like this:
( mpd -foreground; /etc/rc.d/ipnat reload ) 

... unless it is not possible for some reason.

Cheers.
-- 
Mike Makonnen  | GPG-KEY: http://www.identd.net/~mtm/mtm.asc
[EMAIL PROTECTED] | Fingerprint: D228 1A6F C64E 120A A1C9  A3AA DAE1 E2AF DBCC 68B9



msg48446/pgp0.pgp
Description: PGP signature


Re: Confused by mpd and ipnat

2002-12-09 Thread Julian Elischer


On Mon, 9 Dec 2002, Mike Makonnen wrote:

 On Tue, Dec 10, 2002 at 11:24:59AM +0800, leafy wrote:
  I finally got over this one. The problem is that mpd needs a very long time
  for PPPoE negotiation, thus if we run ipnat reload before it's settled, that

That's interesting. mpd uses the same kernel module that ppp does, to 
do the negotiation. A tcpdump of the ethernet interface (with timing)
would be instructive.




To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message