Date: Wed, 7 Feb 1996 01:48:05 -0800 (PST) From: Donald Burr <d_burr@ix.netcom.com> To: Binh Do <binhdo@binhdo.home.cs.ubc.ca> Cc: questions@freebsd.org Subject: Re: How to disconnect phone in "on-demand" mode Message-ID: <Pine.BSF.3.91.960207013509.741A-101000@starfleet.gov> In-Reply-To: <199602070510.VAA00251@binhdo.home.cs.ubc.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Tue, 6 Feb 1996, Binh Do wrote:
> At last it seems that I can dial to my ISP on demand. Now one problem arises.
> If I want to just cjeck mail and right after that I want to disconnect
> and use phone. How should I do it gracefully (i.e. not just pick up the phone
> without doing anything with FreeBSD).
>
> Cheers,
There are two ways to do this. One way is to set the "timeout" value
really low, like 10 or 5 (disconnects after 10 or 5 seconds
(respectively) of inactivity). This is fine for when you just want to
read mail and disconnect, but may get in your way if you're trying to do
some "real" work, such as ftp or other internet stuff.
There is another way, whcih I use and like... but you may not...
I wrote a couple of shell scripts to toy with PPP, tell it to turn off
and turn on and etc. I create logins in /etc/passwd with no password,
called "ppp-off" and "ppp-on", so when I want to deactivate ppp, all I
have to do is switch to an empty VC and type "ppp-off". They can also be
run directly from a shell prompt (you must be root).
Attached is a copy of my scripts. Here are some notes concerning them,
since my system is probably different than yours and some tailoring will
be required.
1) I run a name server. When I have PPP turned on, I want the name
server to be able to answer queries for any host on the Internet,
which requires a valid root nameserver cache file with all of the
main Internet name servers on it. When PPP is OFF, I still want
the name server to be able to answer queries for my own "fake"
domain, since I have several machines around the house that depend
on a name server being available, and I don't want them to act
funny when PPP is off. So when PPP is off, I install a small
"fake" root server cache file, that refers all queries back to my
own name server. Sorta kludgy, but it works.
2) If you don't run named, or want to handle it differently, you WILL
need to edit the /usr/local/sbin/ppp-{off,on} scripts and change the
named handling stuff. It's pretty clearly set apart from the rest
of the scripts, and shouldn't be that hard to manage.
3) My auto-dialing ppp site is called "netcomd". Change it to the
name of your auto-dialing ppp site in the /etc/ppp/ppp.conf file.
4) My remote PPP server's IP address is 163.179.78.2. It needs a
"default" route set to it. My ppp-on script takes care of this.
You will have to change this to the default route you need to use.
5) You can use these shell scripts from a (root) shell prompt, or via
commands such as sudo, etc. Or you can add "fake" logins to the
/etc/passwd file so that you can control PPP from any VC with a
login prompt. Use vipw and add the following:
ppp::0:0::0:0:PPP Control login:/:/usr/local/sbin/pppsh
ppp-off::0:0::0:0:Turn PPP off:/:/usr/local/sbin/ppp-off
ppp-on::0:0::0:0:Turn PPP on:/:/usr/local/sbin/ppp-on
I know, I know, this is in bad form, and is bad for security, etc.
Since I am a single-user machine at home, security really doesn't
matter to me. If you are on a network, you might not want to take
this approach, or you may want to set passwords on the ppp-* logins.
6) The "ppp" login and /usr/local/sbin/pppsh command is a easy way to
control or query a running ppp daemon. All it does is runs telnet
to localhost port 3000, but "pppsh" is admittedly easier to type than
"telnet localhost 3000"
Enjoy...
Donald Burr [d_burr@ix.netcom.com], PO Box 91212, Santa Barbara CA 93190-1212
TEL (805)564-1871 / FAX 564-2315 / WWW http://www.geopages.com/WallStreet/2072
PGP Public Key available by request (send e-mail) or on Public Key Servers.
** Uphold your right to privacy - Use PGP. **
[-- Attachment #2 --]
[r۸_)Psh,%]qZ&NNwznU,T<4w? ul˹'f6D' PEaN]1N`8|QRj6 )J f (%bO@,rE< G>7={ڠyqX.|>%m1Г$C7Ch0?q
9_)s_8v.v.q#2}scP+I_]ϛ P
Qz&>j QƣGu0ḳ_!xk6s
EzҳZ. U#@g
ڛ):K
2ߞp !_v3;l3!u$@ҊB3aGpD$(5hy<F|'g,B &Ve J'6{E</jzG:f^=NZG\A>-4Bq0KC違Ьo]ike5Ŏ`XڠzPO 2ƅ-b@CZɂ$, - 8q(lh(vGx,YSCb6H\vF5uZ;fڪ_c7b{|كu~~lJ ,eV4tW_1
"oFe?d@,qŀ+ \i#%¯qz).|A,+]%\:zq#=qdŖLr4ikHp4N9P4g-<}OnVZd$B*$/9K-_#"f]3/(C(CJ%%'HGK]}{Ƚx2mRALbYOڽT[<e̿v3$e.0~z܂KkP>