mpd up script

From: Otto Kucera <ok(at)72pixel.at>
Date: Wed, 05 May 2004 13:07:36 +0200

hallo!

ich bau gerade an einen up und einen down script für einen mpd und häng
ein bischen ... :(

mein problem ist simple aber fundamental ... ich benutze ipf und will
für verschiedene user unterschiedliche ipf rules starten. fürn anfang
wärs ja schön wenn er irgendwas machen würde nur leider führt er mir die
ipf anweisungen nicht aus und ich steh jetzt eigentlich an.

meine config schaut so aus:

mpd.conf:

default:
         load pptp0

pptp0:
         new -i ng0 pptp0 pptp0
         set iface disable on-demand
         set iface up-script "/usr/local/etc/mpd/up_ng.sh"
         set iface down-script "/usr/local/etc/mpd/down_ng.sh"
         set iface enable proxy-arp
         set bundle disable multilink
         set link yes acfcomp protocomp
         set link no pap chap
         set link enable chap
         set ipcp yes vjcomp
         set ipcp ranges 192.xx.xx.3/32 192.xx.xx.250/29

         set ipcp dns 192.56.14.2
         set ipcp nbns 192.56.14.40

         set bundle enable compression
         set ccp yes mppc
         #set ccp yes mpp-e40
         set ccp no mpp-e40
         set ccp yes mpp-e128
         set ccp yes mpp-stateless
         set bundle yes crypt-reqd

mpd.links:
pptp0:
         set link type pptp
         set pptp self 0.0.0.0
         set pptp enable incoming
         set pptp disable originate

up_ng.sh:
#!/bin/sh
echo $1 > /usr/local/etc/mpd/log_up
echo "pass in quick on $1 all" | /sbin/ipf -v $2 -f - >>
/usr/local/etc/mpd/log_up
echo "pass out quick on $1 all" | /sbin/ipf -v $2 -f - >>
/usr/local/etc/mpd/log_up

down_ng.sh:
#!/bin/sh
echo $1 > /usr/local/etc/mpd/log_down
echo "block in quick on $1 all" | /sbin/ipf $2 -f - >>
/usr/local/etc/mpd/log_down
echo "block out quick on $1 all" | /sbin/ipf $2 -f - >>
/usr/local/etc/mpd/log_down

ja und sonst ...

/usr/local/etc/mpd# cat log_*
ng0
ng0

also die erste pipe wird eigentlich brav übergeben und ich kann die
scripten normal ausführen und dann tut die kistn auch was ich will
und der mpd schreibt auch das er den script ausführt ...??

debug von mpd:

[...]
[pptp0] IFACE: Up event
[pptp0] setting interface ng0 MTU to 1496 bytes
[pptp0] exec: /sbin/ifconfig ng0 192.xx.xx.3 192.xx.xx.250 netmask
0xffffffff -link0
[pptp0] exec: /usr/sbin/arp -s 192.xx.xx.250 0:e0:18:c1:da:29 pub
[pptp0] exec: /sbin/route add 192.xx.xx.3 -iface lo0
[pptp0] exec: /usr/local/etc/mpd/up_ng.sh ng0 inet 192.xx.xx.3
192.xx.xx.250 ok
[pptp0] IFACE: Up event
[...]

weiß jemand von euch wieso der mpd mir die ipf rules nicht setzt?

otto

-- 
-----------------------------------
Otto Kucera
A-1020 Wien Engerthstrasse 137/6/7
Tel: +43 699 1 942 30 91 [neue Nummer!]
Email: ok(at)72pixel.at
Icq: 65351173
-----------------------------------
And root said rm -rf /     ......and there was nothing
*BSD is like a wigwam: NO windows, NO gates and an Apache inside!
Your mailserver MUST resolve properly (Fully Qualified Domain Name) or 
the mail will not go through!
To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Wed 05 May 2004 - 13:08:09 CEST

search this site