Re: How do I get fixed and dynamic ppp

Jon Lewis (jlewis@inorganic5.fdt.net)
Wed, 15 May 1996 22:55:11 -0400 (EDT)


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_______