Abstract: Laurent LaBrie explains how to use RedHat Linux /bin/bash commands to make your ISDN dial through the ippp0 interface you created. The /etc/ppp/ip-up.local script brings up the IP connection. Routes must be established to direct ISDN traffic. PAP secrets hold password and user information to make connections.

Laurent J. LaBrie, management and financial consultant

Who is he?

Resumé

Bio (basically the same, just more personal detail)

Awards

Recommendations

How can he benefit me as a financial advisor?

Moneywatch Advisors, Inc.

What is his perspective on investing?

Investment portfolios beating the market (.pdf format)

How we are swimming in a sinking US dollar.

His stock picks and pans.

What articles has he published on management?

Investigating problems in the workplace (.pdf format)

Mentoring, correcting, and disciplining employees

An inside look at a peer evaluation system

Examples of Websites created, maintained, and promoted:


Casa Biblica: #4 Italian bookstore in its market segment


Romania's #1 site about HIV
Romania's #1 site about HIV
(Logo by LJ LaBrie)

Global Assistance
for Medical Equipment, Kosovo
Global Assistance for Medical Equipment, Kosovo (Logo by LJ LaBrie)

Romania's #3 site in its market segmentRomania's #3 site in its market segment (Logo by LJ LaBrie)

navigator for the writings of Laurent J. LaBrie

ISDN Setup using RedHat Linux 9.0


Password files

Contents of the 

5 page series:

Introduction
Configuration files
Execution & options files
Password files
"Bells, whistles" & Troubleshooting
Understanding your debug file
Your donations are valued. This site is advertizement-free.  We depend on your donations to continue to provide high quality information.   If I have helped you resolve your problem, please support our work.     Use check or credit card secured by PayPal.

/etc/ppp/pap-secrets

This gives the computer the user names and passwords for your ISDN ISPs.

/etc/ppp/pap-secrets

#
# Secrets for authentication using PAP
# client server secret IP addresses
####### redhat-config-network will overwrite this part!!! (begin) ##########
"internet@expressnet.de" * "internet"
"arcor" * "internet"
####### redhat-config-network will overwrite this part!!! (end) ############

/etc/ppp/chap-secrets

This gives the computer the user names and passwords for your ISDN ISPs.  CHAP authentication is used by some ISPs like, I understand, British Telecom.

/etc/ppp/chap-secrets

# Secrets for authentication using CHAP
# client server secret IP addresses
####### redhat-config-network will overwrite this part!!! (begin) ##########
"internet@expressnet.de" * "internet"
"arcor" * "internet"
####### redhat-config-network will overwrite this part!!! (end) ############


We have now created -
1) a script to load the hisax driver - `loadhisax'
2) a script to setup the ippp0 interface and isdnctrl parameters for ippp0 - `isdnup'
3) the option files to be used by `ipppd' - `/etc/ppp/ioptions' and `/etc/ppp/ioptions.ippp0'
4) and a script to remove this set-up - `isdndown'

Fiddly bits

It seems that some part of the system does not create routes correctly. On a RedHat 5.2 system with a 2.0.36 kernel and ISDN patches applied there are less problems with spurious routes being created than with the 2.2.12 & 2.2.13 kernels and ISDN4linux.

The routes direct the IP traffic to the correct place. For `dial-on-demand' you must have the default route set to ippp0 before the link comes up or nothing happens. We have added a default route as the last line of the `isdnup' script. However, once the link is up, this route goes away and other routes are added!!. Make sure you have only one default route. You can see this problem being discussed frequently on the isdn4linux newsgroup `de.alt.comp.isdn4linux', and in the FAQ that comes with isdn4linux.

My solution is to use /etc/ppp/ip-up.local, and /etc/ppp/ip-down.local. The ip-up.local script should be called from ip-up after the link to your ISP is brought up, whereas the ip-down.local script is called by ip-down when the link dies.

These files don't always exist, so create them. They must be executable, and have #!/bin/bash as the first line. (Yes, you must include the #)


/etc/ppp/ip-up.local:


ip-up.local is only under RedHat the correct file name; all of the other distributions use only one file: ip-up.


/etc/ppp/ip-up.local:

#!/bin/bash
/bin/echo $1 > /var/log/dial-up.interface
/bin/echo $5 > /var/log/dial-up.gateway
###/sbin/route add default gw $5
/bin/echo $MS_DNS1 > /tmp/MS_DNS1
/bin/echo $MS_DNS2 > /tmp/MS_DNS2
/bin/mv -f /etc/resolv.conf /etc/resolv.conf.vorher
(
/bin/echo -e "options timeout 5"
/bin/cat /etc/ppp/resolv.conf
) > /etc/resolv.conf
/bin/chmod a+rx /etc/resolv.conf
/usr/sbin/setleds -L +scroll < /dev/console
/usr/bin/fetchmail -v > /var/log/dial-up.fetchmail1 2> /var/log/dial-up.fetchmail2 ;
/usr/sbin/sendmail -q -v > /var/log/dial-up.sendmail1 2> /var/log/dial-up.sendmail2 &
/usr/lib/news/suck/bin/scripts/get.news.inn > /var/log/dial-up.suck1 2> /var/log/dial-up.suck2 &
exit 0

Edit /etc/ppp/ip-up.local to include -

#!/bin/bash
INTERFACE_NAME=$1
if [ "$INTERFACE_NAME" = "ippp0" ] ; then
/sbin/route add default ippp0
fi

Make this file executable.

Because this script is run whenever the link is brought up using any of the interfaces, it is important to only add the default route for the interface that requires it. The ip-up.local and ip-down.local scripts are passed certain parameters when they are called. The first parameter is the interface. This script tests for ippp0 and only adds a default route if that is true. Make sure there are spaces either side of the square brackets and the = sign. These scripts do not have any knowledge of your path, so include the full path to the command. See `man ipppd' for more details.

When the link is disconnected you must remove the routes that were added when the link came up, otherwise the system will not be in the correct state to initiate the link again.

/etc/ppp/ip-down.local:


ip-down.local is the RedHat specific location; if you have a different distribution use ip-down instead.


/etc/ppp/ip-down.local:

#!/bin/sh
# Datei: ip-down.local
# Wird aufgerufen mit folgenden Parametern:
# $1 = Interface name
# $5 = Peer IP number
mv -f /etc/resolv.conf /etc/resolv.conf.online
mv -f /etc/resolv.conf.vorher /etc/resolv.conf
route add default gw $5
/usr/bin/setleds -L -scroll < /dev/console
exit 0

Edit /etc/ppp/ip-down.local to include -

#!/bin/bash
INTERFACE_NAME=$1
# Try to fix the routes for ISDN
if [ "$INTERFACE_NAME" = "ippp0" ] ; then
/sbin/ifconfig ippp0 down
/sbin/ifconfig ippp0 up
/sbin/route add default ippp0
fi

Make this file executable.

NOTE: Do make sure that when the link comes up you have only one default route.

To initiate the link

To start the link - load the driver with `loadhisax'. Once this is loaded it is not usually necessary to unload it.
Set-up the ippp0 interface by running `isdnup'. The ippp0 interface will be added, and if you have 'isdnctrl dialmode ippp0' set to auto, then opening a browser and selecting a webpage should cause the link to be created.

If `isdnctrl dialmode ippp0' is set to manual, type `isdnctrl dial ippp0', and the system will dial the number defined in the `isdnctrl addphone' statement.
To bring the link down use `isdnctrl hangup ippp0'.

Do make sure you have the IP numbers for your ISP's nameservers in /etc/resolv.conf.

Other pages:




e-mail:  e-mail address   Y!messenger ID: laurent_labrie



"A good manager is a man who isn't worried about his own career but rather the careers of those who work for him... Don't worry about yourself! Take care of those who work for you and you'll float to greatness on their achievements."---HSM Burns

Copyright Laurent J. LaBrie 2004-2006