[2921] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Re: How do I get fixed and dynamic ppp

daemon@ATHENA.MIT.EDU (Jon Lewis)
Thu May 16 00:36:15 1996

Date: 	Wed, 15 May 1996 22:55:11 -0400 (EDT)
From: Jon Lewis <jlewis@inorganic5.fdt.net>
To: root <root@gallifrey.taranaki.ac.nz>
cc: linux-net@vger.rutgers.edu
In-Reply-To: <199605140602.SAA04956@gallifrey>

On Tue, 14 May 1996, root wrote:

> We run a small internet service here and have provided dialin ppp with an
> assigned ip address based on the tty line one connects to using
> /etc/ppp/options.ttyCxx files to assign the ip address. We now have a 
> customer who want to have a fixed ip address but starting up pppd with a
> command line option 204.15.67.123:204.15.67.1 doesn't seem to override
> the equivalent in the options file. Has anyone got a clever solution?

This is a fragment of a perl script I wrote for reading the IP address 
from /etc/slip.tty.  We support SLIP and PPP.  You could use this, and 
then check for certain usernames, and assign a static address for those 
usernames.  

It should be rather obvious how it works.

sub getip {
local($userdev)=@_;
        $userdev = "/dev/$userdev";
        open(IN,'/etc/slip.tty');
        while (<IN>) {
                ($dev,$ip)=split(/\s+/,$_);
                if ($dev eq $userdev) {
                        close(IN);
                        return($ip);
                }
        }
}



------------------------------------------------------------------
 Jon Lewis                      |  Mime attachments are OK
 jlewis@inorganic5.fdt.net      |  But please ask before sending 
 http://inorganic5.fdt.net      |  unsolicited huge files.
________Finger jlewis@inorganic5.fdt.net for PGP public key_______


home help back first fref pref prev next nref lref last post