Re: Set up PPP for two ISPs
My kludgy, but servicable and robust approach to this is to keep two sets of files. Mine are named *.isp1 and *.isp2. I then have two connect pre-scripts that simple copy all the correct files and then call the ppp-on script or whatever you use to start up ppp. The files of interest are: /etc/resolv.conf /etc/ppp/options (and any files referenced here, like chatscripts) /etc/ip-up(if you use them) /etc/ip-down Basically any file that you have to alter for the second ISP. As an example here is my ppp.aracnet script that I use to connect to aracnet.com: #!/bin/bash cp /etc/resolv.conf.aracnet /etc/resolv.conf cp /etc/ppp/options.aracnet /etc/ppp/options /etc/ppp/ppp.up I use an options file with chatscript built right in (Not much chatting to do with a PAP login), and ppp.up is basically just a loop that keeps trying to dial every 20 seconds or so until it finds the link up. It is sort of a poorman's redialler. I am sure that there are many fancy ways to this sort of thing, but this method has working steadily for me for about 3 years now. I suppose you could play tricks with some of the other files in /etc also. I am not sure how some programs like their hostname changing underneath them, so I leave HOSTNAME alone. Good Luck. D.L. / [EMAIL PROTECTED]Virtual .sig file #2342371. You are \ \ David Lutz viewer number #63. Have a nice Day! / On Mon, 30 Dec 1996, gli wrote: Dear Debian users, I am using Debian 1.2. I set up my box to connect to an ISP using PPP, I invoke the connection by the script pon, it all work out fine. Now I want to join another ISP. How do I set up my box, to connect to two ISP, one at a time? Please help. Godfrey -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED]
Re: Set up PPP for two ISPs
I have a dumb question... why is there a need for two ISP dialins? If they are in the same calling area, you don't need to log into both, just one, and you can grab all your email, etc, from both. A need for a second isp is understandable if you are traveling elsewhere, though. -- Daniel Stringfield mailto:[EMAIL PROTECTED] http://users.southeast.net/~servo Send email for more information on the Jacksonville Linux Users Group! -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED]
Re: Set up PPP for two ISPs
Well, to make a long story short. I am going to switch ISP. There may have other reasons why some folks need two or more different ISP, may be one of them is for work etc. On Mon, 30 Dec 1996, Daniel Stringfield wrote: I have a dumb question... why is there a need for two ISP dialins? If they are in the same calling area, you don't need to log into both, just one, and you can grab all your email, etc, from both. A need for a second isp is understandable if you are traveling elsewhere, though. -- Daniel Stringfield mailto:[EMAIL PROTECTED] http://users.southeast.net/~servo Send email for more information on the Jacksonville Linux Users Group! -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED] -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED]
Re: Set up PPP for two ISPs
My approach to two ISP's is a little different than the one David described. One of my ISP's is my employer (so I don't want my kids connecting there by mistake), the other is Together Networks (a Burlington, Vermont based ISP). I have duplicate sets of files for each ISP: /etc/sendmail.cf /etc/named.boot /etc/resolv.conf PPP options files In my ppp-on script, I verify the person is really me to connect to my employer (at least well enough that my kids can't get around it yet). Depending on whether ppp-on is connecting to IBM or to Together Networks, it will call pppd with different options (specifically the -file parameter to specify which options file to read). It is the job of my ip-up script to determine which network was connected to and put the correct /etc/resolv.conf, named.boot, and sendmail.cf files into place (with a stop/start for named and sendmail). On the flip side, when ip-down gets called, it puts back my local files so the name server won't hang me up forever when I send mail without being connected anywhere. I've also got a sendmail.cf file for when I'm not connected that just queues the mail (and since I don't run the queue if I'm not connected to one ISP or the other, it'll sit there until I do next connect). Here's my ip-up script (Warning: it's from a slackware distribution) #!/bin/sh # # ip-up: shell script hook called by pppd when the interface is brought up # # Parameters are: # $0: name of the script (ip-up or ip-down) # $1: name of the network device (such as ppp0) # $2: name of the tty device (such as /dev/ttyS0) # $3: speed of the tty device in Bits Per Second (such as 115200) # $4: the local IP address in dotted decimal notation # $5: the remote IP address in dotted decimal notation # # /tmp/local_name is a file with my local machine name # /etc/hosts.local is the default /etc/hosts file with # 127.0.0.1 localhost as the only entry # # This script handles: #1) getting the correct /etc/resolv.conf (either ibm or together.net) #2) making it possible to ping my own address #3) updating my /etc/hosts file to have the address and name # #echo ip-up parameters are: $* /dev/console LOGGER=/usr/bin/logger -t pppd $LOGGER ip-up parameters are: $* # 0) determine connect speed CSpeed=`/usr/bin/grep ARQ /etc/ppp/ppp.log | /usr/bin/tail -1 | \ /usr/bin/sed -e 's/.*: *//' -e 's|/.*||'` #echo Connected at $CSpeed /dev/console # 1) make it possible to ping my own address /sbin/route add -host $4 lo # # 2) Determine whether this is my internal network or not # # Determine the network connected to NETWORK=`/usr/local/bin/netmath -a $4 255.0.0.0` if [ x$NETWORK != x192.0.0.0 ]; then # 3) Set up /etc/resolv.conf and named.boot files based on #the network connected to. # if [ x$NETWORK = x9.0.0.0 ]; then /bin/cp -p /etc/resolv.ibm /etc/resolv.conf /bin/cp -p /etc/named.ibm /etc/named.boot else if [ x$NETWORK = x204.0.0.0 ]; then /bin/cp -p /etc/resolv.together.net /etc/resolv.conf /bin/cp -p /etc/named.together.net /etc/named.boot else if [ x$NETWORK = x207.0.0.0 ]; then /bin/cp -p /etc/resolv.together.net /etc/resolv.conf /bin/cp -p /etc/named.together.net /etc/named.boot else if [ x$NETWORK = x208.0.0.0 ]; then /bin/cp -p /etc/resolv.together.net /etc/resolv.conf /bin/cp -p /etc/named.together.net /etc/named.boot else echo Bad NETWORK value '$NETWORK' /dev/console fi fi fi fi # 4) Reload nameserver # -- Debian version #/etc/init.d/bind reload # -- Slackware version if [ -f /var/run/named.pid ]; then # echo Reloading nameserver /dev/console kill `cat /var/run/named.pid` /usr/sbin/named # echo Done... nameserver /dev/console fi # 5) update /etc/hosts file # # Put generic hosts file in place # Determine the name of my address /usr/bin/host $4 | fgrep Name | cut -c7- /tmp/ip_name # Put my address in a file echo $4 /tmp/ip # Build a new line for /etc/hosts /usr/bin/paste /tmp/ip /tmp/ip_name /etc/hostname /tmp/host_bottom # Build the new /etc/hosts file /bin/cat /tmp/host_bottom /etc/hosts.local /etc/hosts # Update hostname #hostname `cat /tmp/ip_name` # Update /etc/sendmail.cw file cat /tmp/ip_name /etc/sendmail.cw # clean up /bin/rm -f /tmp/ip /tmp/ip_name /tmp/host_bottom # 6) Recycle the sendmail daemon: # -- Debian version #/etc/init.d/sendmail stop #/etc/init.d/sendmail start # -- Slackware version /bin/ps ax | /usr/bin/grep sendmail | /usr/bin/grep -v grep /tmp/xx while read PID x; do if [ x$PID != x ]; then kill $PID fi done /tmp/xx /usr/sbin/sendmail -bd -q10m # Now get rid of /tmp/xx /bin/rm -f /tmp/xx fi # end of if [ x$NETWORK != x192.0.0.0 ] # Tell everyone it's up #echo PPP link on interface $1
Re: Set up PPP for two ISPs
gli [EMAIL PROTECTED] writes: I am using Debian 1.2. I set up my box to connect to an ISP using PPP, I invoke the connection by the script pon, it all work out fine. Now I want to join another ISP. How do I set up my box, to connect to two ISP, one at a time? Please help. What I did was use this script as /usr/local/bin/pon #!/bin/sh if [ $# = 0 ] ; then CHAT=/etc/ppp.chatscript elif [ $# = 1 ] ; then CHAT=/etc/ppp.chat.$1 else echo usage: pon [destination] exit 1 fi if [ ! -r $CHAT ] ; then echo pon: can not read $CHAT exit 1 fi if [ -r /etc/ppp.options_out ]; then /usr/sbin/pppd connect /usr/sbin/chat -v -f $CHAT `cat /etc/ppp.options_out` else echo You do not have permissions to access /etc/ppp.options_out fi exit 0 where /usr/local/bin/ comes before /usr/bin/ in my path. I then made an /etc/ppp.chatscript file for every ISP I wish to connect to: compute root: ls -lta /etc/ppp.chat* lrwxrwxrwx 1 root root 18 Dec 31 10:20 /etc/ppp.chatscript - ppp.chat.softsound -rw-r--r-- 1 root root 169 Dec 26 22:11 /etc/ppp.chat.softsound -rw-r--r-- 1 root root 167 Dec 4 07:44 /etc/ppp.chat.demon -rw-r--r-- 1 root root 169 Nov 27 18:19 /etc/ppp.chat.magpie [ N.B. I abbreviated chatscript to chat for readability ]. /etc/ppp.chatscript is a symbolic link to the default, and if you supply an argument to pon it uses that script instead. This works because non of the files in /etc/ppp/ are ISP specific. It works fine for me. I'm told (by the maintainers) that the next version of ppp will have it's own solution. Tony Robinson -- http://www.SoftSound.demon.co.uk/ email [EMAIL PROTECTED] Fax +44-1223-562588 -- TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word unsubscribe to [EMAIL PROTECTED] . Trouble? e-mail to [EMAIL PROTECTED]