[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: New ip-up (Was: Re: REQ ip-up: run-parts /etc/ppp/up )



In article <Pine.LNX.3.96.971021141447.229B-100000@citytelprct59.citytel.net>,
	jwalther@citytel.net (Manong Dibos) writes:
> 
> Thanks Erv.  Good explanation.  One problem I see is, not a lot of ppp
> users have a static IP.  Our IP (and thus, hostname) is different every
> time we connect.
> 

I designed the setup I described for a dynamic ip, single ppp setup.
For people that have static ip, the situation is even simpler (but
they are probably in the minority).  My IP address changes every time
I connect, yes.  But my hostname, cne.not.for.mail, always stays the
same.  I am always cne.not.for.mail.  The key point is that every time
I connect with pppd, cne.not.for.mail points to a different IP address
(the correct one).  For example, say yesterday cne.not.for.mail was
listed as 123.123.123.123, today it might be cne.not.for.mail as
456.456.456.456.  I never have to change my hostname with the
'hostname' command.  I just have to do some /etc/hosts manipulation in
ip-up so that cne.not.for.mail always has a valid IP address in front
of it.

> Is there an easy way to check if the current hostname resolves to the IP
> of the first ppp interface that came up?

By DNS, use 'host'.  If you mean in the /etc/hosts file, use 'grep'.
In my senario, the hostname, cne.not.for.mail never resolves to the IP
address of my ppp interface on outside nameservers because the name
cne.not.for.mail does not exist in the outside world.  That doesn't
matter be cause the only time the phrase cne.not.for.mail is given out
to the outside world is in the headers of email and usenet posts (see
note at end), in which case, since my connection is intermitant, people
should not try to connect to my machine for email delivery anyway.  If
my hostname was ppp123.net.wisc.edu and people tried to connect to me
5 minutes after I am down, they may get someone elses computer all
together :)  For things like irc, ftp, etc...  remote computers can
still resolve my IP to ppp123.net.wisc.edu and connect to my identd.
Basically, it appears to the outside world (except partially in
email/usenet headers) that I am ppp123.net.wisc.edu.  My machine,
however, thinks it is cne.not.for.mail and that causes not trouble.

> 
> I think the correct behavior is to only modify the hostname when the first
> ppp interface comes up, and when the last ppp interface comes down.
> Anyone have any different thoughs?  Hints on implementation?
> 

I guess it is a question of why one wants to modify the hostname.  If
the goal of hostname modification is to make talk work, then only
modify the hostname when a ppp connection over which you will use talk
comes up.  If the goal is to have your hostname = what other people
think you are (ppp123.net.wisc.edu), then I can't think of a multiple
ppp solution.  For that matter, I would guess that multiple ppp
connections are fairly rare.

> I mean, how does one detect the presence of multiple ppp interfaces?

ifconfig | grep ppp[0-9] | wc | awk '{print $1}'

> Should be some simple way to abort ip-up and ip-down...

Like I said, I would think it would be rare.  Maybe a note in /usr/doc
stating that the default ip-up requires modification for multiple ppp
users. By multiple ppp, I have meant people who have more than one ppp
connection active at the same time = multiple modems/serial connections.

> Also, can't a box have multiple FQND's ?  Perhaps an awk solution is
> needed so they all work?  But then what is the relationship of `hostname`
> to /etc/hosts ?

I could be wrong here.  The kernel can have only one FQDN.  Each
outside world corresponding to each network interface (ethernet, ppp,
slip, etc) can think the computer has a different FQDN.  Maybe there
is a solution using IP aliasing or whatever.

You can have several IP addresses (for several interfaces), and each
can have an entry in /etc/hosts so that you have several identities in
that way.  However, as far as I know, there is no way to have
'hostname -f' return multiple answers.

===NOTE:

In all this discussion, I have said that my hostname is
cne.not.for.mail.  Let me add another complication.  Skip this if you
don't want furthur complication :)  If you check my headers you will
see that my hostname is actually cne.dyn.ml.org.  I am using the
dyndns service at ml.org.  Everything above is true and is the way I
do things except that my hostname DOES resolve to my IP address by DNS
because everytime I connect, I update the ml.org server with my new ip
address.  So a name lookup on cne.dyn.ml.org should give you either
the ip address I am currently using (If I'm up) or the IP address I
most recently used (If I'm down).  This allows me to easily connect to
my system without knowing what IP address I my computer has at the
time.  Note, however, that if my system has IP 123.123.123.123 and
some outside computer does a lookup on 123.123.123.123, they will get
ppp123.net.wisc.edu and not cne.dyn.ml.org (see ml.org for an
explanation).  This is the only catch.

Good Luck,
Erv

-- 
Graduate Student                                edwalter@iname.com
Department of Chemistry                       walter@chem.wisc.edu
Univ of Wisconsin-Madison               edwalter@students.wisc.edu
       <PGP Public Key: finger walter@fozzie.chem.wisc.edu>


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: