ppp and ip-up
Does ppp run the ip-up and ip-down scripts for incoming connections as well as outgoing? I added some commands to my ip-up on the server to set up extra routes when I dial in, but they don't seem to get run. #!/bin/sh # # $Id: ip-up,v 1.1 1996/01/31 21:25:59 alvar Exp $ # # This script is run by the pppd after the link is established. # It should be used to add routes, set IP address, run the mailq # etc. # # This script is called with the following arguments: #Arg Name Example #$1 Interface name ppp0 #$2 The ttyttyS1 #$3 The link speed 38400 #$4 Local IP number12.34.56.78 #$5 Peer IP number12.34.56.99 # # The environment is cleared before executing this script # so the path must be reset # PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin export PATH USERNAME=`w | grep $2 | perl -e '$_ = STDIN; s/(.+?) .+/\$1/; print;'` # if it's hamish, add a route to his half of the subnet if [ $USERNAME = hamish ]; then route add -net 203.14.18.0 netmask 255.255.255.128 $1 fi # last line I understand that $2 could include /dev/ as well, which would break my script; I haven't checked this out yet. Or is ip-up not run at all for incoming connections? Hamish -- Hamish Moffatt, [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] Latest Debian packages at ftp://ftp.rising.com.au/pub/hamish. PGP#EFA6B9D5 CCs of replies from mailing lists are welcome. http://hamish.home.ml.org -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: ppp and ip-up
Does ppp run the ip-up and ip-down scripts for incoming connections as well as outgoing? I added some commands to my ip-up on the server to set up extra routes when I dial in, but they don't seem to get run. Hi. They DO run here. As for ttyS? or /dev/ttyS? you'd better find this out experimentally: put echo $2 /tmp/pppdev into ip-up script and check /tmp/pppdev after connection being established. Alex Y. -- _ _( )_ ( (o___ +---+ | _ 7 |Alexander Yukhimets| \()| http://pages.nyu.edu/~aqy6633/ | / \ \ +---+ -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: ppp and ip-up
On Tue, Jan 06, 1998 at 09:03:39AM -0500, Alex Yukhimets wrote: Does ppp run the ip-up and ip-down scripts for incoming connections as well as outgoing? I added some commands to my ip-up on the server to set up extra routes when I dial in, but they don't seem to get run. They DO run here. As for ttyS? or /dev/ttyS? you'd better find this out experimentally: put echo $2 /tmp/pppdev into ip-up script and check /tmp/pppdev after connection being established. Thanks Alex, I will try this out and modify my script if I need to. It would be nice if ppp could provide the incoming username, so I didn't have to go hunting for it with w. Hamish -- Hamish Moffatt Mobile: +61 412 011 176 [EMAIL PROTECTED] Rising Software Australia Pty. Ltd. Developers of music education software including Auralia Musition. 31 Elmhurst Road, Blackburn, Victoria Australia, 3130 Phone: +61 3 9894 4788 Fax: +61 3 9894 3362 USA Toll Free: 1-888-667-7839 Internet: http://www.rising.com.au/ -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: ppp and ip-up
Hamish Moffatt writes: Does ppp run the ip-up and ip-down scripts for incoming connections as well as outgoing? I can't see how it can do otherwise. The last thing that ipcp_up() does after successfully configuring the interface is call ipcp_script(). It just passes pppd's arguments to /etc/ppp/ip-up and runs it. I understand that $2 could include /dev/ as well,... The tty-device is passed to ip-up exactly as received by pppd (this is a bug, IMHO). Use basename to scrape off the '/dev/'. Or is ip-up not run at all for incoming connections? PPP is a peer to peer protocol. Once the serial link is up there is no incoming or outgoing. -- John Hasler [EMAIL PROTECTED] (John Hasler) Dancing Horse Hill Elmwood, WI -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: ppp and ip-up
Hamish Moffatt [EMAIL PROTECTED] writes: On Tue, Jan 06, 1998 at 09:03:39AM -0500, Alex Yukhimets wrote: Does ppp run the ip-up and ip-down scripts for incoming connections as well as outgoing? I added some commands to my ip-up on the server to set up extra routes when I dial in, but they don't seem to get run. They DO run here. As for ttyS? or /dev/ttyS? you'd better find this out experimentally: put echo $2 /tmp/pppdev into ip-up script and check /tmp/pppdev after connection being established. Thanks Alex, I will try this out and modify my script if I need to. It would be nice if ppp could provide the incoming username, so I didn't have to go hunting for it with w. Hamish Um, just how are you starting up ppp? If it's being done with a script, you might try using the ipparam option for pppd to pass another parameter to /etc/ip-up. You'd probably want to be very careful security-wise if you did this, though, to make certain that malicious things couldn't be passed in via ipparam. -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: ppp and ip-up
Hamish Moffatt [EMAIL PROTECTED] writes: break my script; I haven't checked this out yet. Or is ip-up not run at all for incoming connections? Don't know. Why don't you check it out ? Put something like touch /tmp/ip-up.on.incoming.has.been.executed in ip-up and dial in. Ciao, Martin -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: ppp and ip-up
On Tue, Jan 06, 1998 at 12:48:16PM -0500, Daniel Martin at cush wrote: Um, just how are you starting up ppp? If it's being done with a script, you might try using the ipparam option for pppd to pass another parameter to /etc/ip-up. You'd probably want to be very careful security-wise if you did this, though, to make certain that malicious things couldn't be passed in via ipparam. I am using AutoPPP from mgetty with PAP, so I don't think this is practical. thanks, Hamish -- Hamish Moffatt, [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] Latest Debian packages at ftp://ftp.rising.com.au/pub/hamish. PGP#EFA6B9D5 CCs of replies from mailing lists are welcome. http://hamish.home.ml.org -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .
Re: ppp and ip-up
On Tue, Jan 06, 1998 at 10:24:56AM -0600, [EMAIL PROTECTED] wrote: I understand that $2 could include /dev/ as well,... The tty-device is passed to ip-up exactly as received by pppd (this is a bug, IMHO). Use basename to scrape off the '/dev/'. A simple fix. Thanks. Or is ip-up not run at all for incoming connections? PPP is a peer to peer protocol. Once the serial link is up there is no incoming or outgoing. Good point. Hamish -- Hamish Moffatt, [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] Latest Debian packages at ftp://ftp.rising.com.au/pub/hamish. PGP#EFA6B9D5 CCs of replies from mailing lists are welcome. http://hamish.home.ml.org -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] .