(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version



PPP up and down scripts


What is this stuff?

If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):



From - Sat Oct  2 12:15:08 1999
Xref: world comp.unix.sco.misc:106575
Path: world!newsfeed.mathworks.com!remarQ-easT!rQdQ!supernews.com!remarQ.com!corp.supernews.com!not-for-mail
From: "Brian K. White" <linut@squonk.net>
Newsgroups: comp.unix.sco.misc
Subject: Re: Help in configuring "simple" DNS on SCO OSR 5.0.4
Date: Sat, 02 Oct 1999 09:00:09 -0400
Organization: Albany Burner Control
Lines: 106
Message-ID: <37F601D9.9AD4B955@squonk.net> 
References: <37f59992.776138@news.concentric.net> <37F5F171.8BFFE59F@squonk.net> 
X-Complaints-To: newsabuse@supernews.com
X-Mailer: Mozilla 4.6 [en] (X11; I; SCO_SV 3.2 i386)
X-Accept-Language: en
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cache-Post-Path: firth.squonk.net!unknown@dialup-115.squonk.net
X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/)
X-Mozilla-Status: 8011

"Brian K. White" wrote:
> 
> RP wrote:
> >
> > Running SCO Open Server 5.0.4p on  a single IBM PC.  Have used Tony
> > Lawrence's sample scripts "up," and "down" to establish dial-up PPP
> > connection to my ISP (concentric.net DNS 207.155.184.72 and
> > 206.173.119.72, local and host address assigned dynamically by ISP).
> > The connection is fine, I can ping the ISP using the numeric host
> > address, but cannot figure out how to use the ISP DNS servers, so I
> > can browse with Netscape Navigator.
> > I don't have or need any networking other than this WAN connection to
> > the ISP, and therefore don't need DNS on my computer.
> >
> > My /etc/resolv.conf file contains:
> > domain concentric.net
> > nameserver 207.155.184.72
> > nameserver 206.173.119.72
> > (Yes, the DNS addresses are correct.)
> >
> > My /etc/hosts file contains:
> > localhost 127.0.0.1
> > (I don't know how to reference concentric.net, since this is assigned
> > dynamically, after the connection is established.)
> >
> > I don't use named.boot, since there is no DNS on my box.
> >
> > Any help, other than "man ifconfig, routed, named, resolv.conf,
> > gated,"  etc appreciated. I have tried making sense of the above "man"
> > entries  repeatedly without success.
> >
> > Thanks,
> >
> > --Ray Petkus <rpetkus@ibm.net>
> 
> I added the following to my up/down script for ppp:
> 
>  route add default `ifconfig $PPP 2>/dev/null |grep inet |cut -d" " -f2
> `
> just after the connection test succeeds, and
>  route flush >/dev/null
> just after bringing the connection down
> 
> here is my whole script. I call it "isp up" or "isp down" and it prints
> the most basic of status info while it's working, and you know it's done
> when the prompt comes back. (whereas pppattach doesn't inform you of
> it's success or failure)
> It's basically Tony's up & down scripts combined and with an automatic
> default route maker inserted
> 
> you may need to change the -f2 in the "defgate" function to -f4, I have
> my default gateway set to the other end of my PPP connection, but I've
> also seen references and tested it myself, where the default gateway
> should be whatever own IP is after connection. I think it depends on
> your ISP, their implementation of PPP, and probably 23 things about your
> own box that I don't know enough to talk about :)
> 
> btw, if you do the math re: WAIT x RETRY in this script you will see I
> have it set to a very long time, this is becaues pppattach or uucp
> underneath it, redials automatically and invisibly at least for me when
> it fails to connect, so I made the testing phase long enough to account
> for 2 or three Busy signal / retry cycles. but it checks every 5
> seconds, so the script completes and exits as soon as a connection is
> up.
> 
> --
> Brian~
> 
>   ------------------------------------------------------------------------
> #!/bin/sh
> # isp - raises and lowers PPP connection to ISP. linut@squonk.net
> # usage: isp up    - connects to ISP
> #        isp down  _ disconnects from ISP
> # Derived from  /Unixart/quickppp.html
> 
> ISPNAME=squonk          # connection name used in cu and uucp config files
> GATEWAY=                # default gateway address (blank for auto)

I forgot to say, replace "squonk" here with whatever you type for <name>
in "pppattach <name>"
also, leave GATEWAY blank like it is here.



actually, the script I really use is this one, with more stuff added in
to update my home page with a button that links back to my box at it's
current IP. It derives the current IP, edits a local template copy of my
home page adding a button/hyperlink, and uploads it to my ISP as soon as
the connection is up. then the "down" invocation edits the same template
of my home page, removing the button, and uploads that just before
bringing down the connection. it also generates new versions of my
top-level web page one the local machine based on the same idea of
reading a template, so that while connected, the same page works for
outsiders and for local users (top-level links use current IP instead of
localhost), and when disconnected it continues to work for local users
(top-level links use localhost instead of the now defunct IP)

It works very nice and the only glitch is if the connection gets broken
by other means than "isp down" then my home page on the ISP will have a
broken link on it untill I connect again.

if anyone is interested I can post that script. I'd be kind of
interested to hear what perl or awk one-liners can replace whole
sections of the script too, since that's always what seems to happen
every time I show someone a script I thought I was clever coming up
with. :) but I won't post it just for that :)
--
Brian~




Click here to add your comments



Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar



ad

/Bofcusm/111.html copyright 1997-2004 (various authors) All Rights Reserved

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.



More:
       - OSR5
       - Bofcusm


Unix/Linux Consultants

Skills Tests

Guest Post Here











My Favorites

Change Congress