Re: ppp question

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

 



Davy Leon wrote:
> I have a question. Every time I dialup to the internet pppd executes an
> script called ip-up. My question is, everytime someone dials in it's
> executed too?

Yes.  It's executed every time an IP interface is brought up by PPP.

Note that PPP itself knows nothing about dialing in or out; those are
attributes of the lower layer -- the chat script and modems or other
communications gear involved.  PPP is symmetric and peer-to-peer.
There's no "client" or "server."

> If the answer is yes, how can I handle the script to
> execute one part when dianing out and another part when dialing in. I
> meant something like

The man page has a number of environment variables documented that you
could use for this task.  $PEERNAME is fairly useful -- it will be set
only if you have an authenticated peer name.

If you have different devices for dialing in and out (it's often a good
idea to do this, but not always done), then $DEVICE might tell you what
you want to know.

If you want to get fancier, you can use $LINKNAME with the "linkname"
option.

The simple answer would be:

	if [[ -n ${PEERNAME:+I_am_server} ]]; then
		# the peer probably called me
	else
		# I'm probably dialing out
	fi

But note that this is making a big assumption about authentication
configuration: that you always authenticate people calling you, and you
never authenticate people you call.  That's how PPP is commonly used,
but there's nothing in the standards that _requires_ it to be used that way.

-- 
James Carlson         42.703N 71.076W         <carlsonj@xxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Audio Users]     [Linux for Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux