IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

HOWTOs

Search Howtos :Match :
Next Previous Contents

8. ISDN

I am including this although this has nothing to do with qmail or mh. But without a PPP line to your ISP there is no email at all. I had quite a bit of bother to get my ISDN working. The SusE distribution includes a configuration for ISDN, but I wanted something simpler. The stuff here was adapted from Bernhard Hailer's scripts. (Vielen, vielen dank!)

The following rc.config loads the necessary modules during initialisation:

#!/bin/bash
# This is adapted Bernhard Hailer's old script

LOCAL_NUMBER="91311234"        # tel no. 091311234
REMOTE_NUMBER="0911123456"     # ISP tel no.
LOCAL_IP="192.168.0.99"        # I have dynamic IP so this will do
REMOTE_IP="195.112.123.11"     # your ISP's gateway
DEVICE="ippp0"

SYSPATH="/sbin"
ISDNCTRL="$SYSPATH/isdnctrl"

case "$1" in
start)
        # turn on isdn
        insmod /lib/modules/2.0.33/net/slhc.o
        insmod /lib/modules/2.0.33/misc/isdn.o
        sleep 1
        # load the hisax module
        insmod /lib/modules/2.0.33/misc/hisax.o 
                                   id=Tel0 type=5 protocol=2 irq=10 io=0x300 
        echo "starting isdn4linux"
        # global
        $ISDNCTRL verbose 0

        $ISDNCTRL addif $DEVICE         # create new interface
        $ISDNCTRL addphone $DEVICE in $REMOTE_NUMBER
        $ISDNCTRL addphone $DEVICE out $REMOTE_NUMBER
        $ISDNCTRL eaz $DEVICE $LOCAL_NUMBER
        $ISDNCTRL l2_prot $DEVICE hdlc
        $ISDNCTRL l3_prot $DEVICE trans
        $ISDNCTRL encap $DEVICE syncppp
        $ISDNCTRL huptimeout $DEVICE 300 
        $ISDNCTRL chargehup  $DEVICE off
        $ISDNCTRL secure $DEVICE on

        $SYSPATH/ifconfig $DEVICE $LOCAL_IP pointopoint $REMOTE_IP metric 1
        $SYSPATH/route add default $DEVICE
        $SYSPATH/ipppd /dev/ippp0 file /etc/ppp/options.ipppd &
        $SYSPATH/route del default
        
        ;;
stop)
        #turn off isdn
        rmmod hisax.o  
        sleep 1
        rmmod isdn.o
        rmmod slhc.o
        echo "Shutting down isdn4linux"
        $ISDNCTRL delif ippp0
        ;;
*)
        echo "Usage: $0 (start|stop)"
        exit 1
        ;;
esac

I use the following script to dial out, it is called simply isdn on|off


#!/bin/bash
# This is based on an old script from Bernhard Hailer

IP_ADDRESS="195.112.123.11"

case "$1" in
on)
        
        
        echo "Calling ippp0"
        /sbin/isdnctrl dial ippp0
# the sleep is important as it gives the PPP time to settle down
        echo "Sleep for 8s for PPP handshake"
        sleep 8s
        /sbin/route add default ippp0
        echo "line open - checking...."
      
# check whether PPP negotiation was successful:
        set `ping -qc3 -i1 $IP_ADDRESS 2>/dev/null | grep transmitted`
        if [ $4 -gt 0 ];
        then
                echo "succeeded."
                echo "Starting fetchmail daemon"
                /usr/bin/fetchmail -d 600 -k -v -a -L /var/log/fetchmail
                echo "Flushing mail queue...."
                /usr/local/bin/serialmail/maildir2smtp 
                            ~alias/pppdir alias-ppp- mail.server.ip.no `hostname`
        else
                echo "failed!"
                /sbin/isdnctrl hangup ippp0
        fi
        
;;

off)
                echo -n "Shutting down fetchmail daemon"
                /usr/bin/fetchmail --quit
                
                /sbin/isdnctrl hangup ippp0
                /sbin/route del default         # and delete route
                echo "You're off line"
;;

*)
        echo -e "\aUsage:"
        echo "isdn on"
        echo "isdn off"
;;

esac
The next lot is the ipppd options file /etc/ppp/options.ipppd

# Based on:
# Klaus Franken, kfr at suse.de
# Version: 27.08.97 (5.1)
# 
# This file is copy by YaST from /etc/ppp/ioptions.YaST 
#   to options.<device>

user "myuserid"

# my system name (only for CHAP!)
# name my_system_name

# accept IP addresses from peer
# use with dynamic IP
ipcp-accept-local
ipcp-accept-remote
noipdefault

# try to get IP address from interface
# option specific to ipppd (as opposed to pppd)
# use only with static IP
#useifip

# disable all header-compression
-vj
-vjccomp
-ac
-pc
-bsdcomp

# sometimes you need this:
#noccp

# max receive unit
mru 1524
# max transmit unit
mtu 1500

# If this machine is a server, force authentication by uncommenting one
# of the following. However, if this machine is a client, doing this will
# prevent a succesful connection! (message "peer refused to authenticate").
# So, only uncomment on a server.
# "+pap" / "+chap" NUR AKTIVIEREN, WENN DIES EIN SERVER IST!!!
#+pap
#+chap

# if you have problems with handshaking (no response for first
# lcp-package) try to decrease the retry-cycle. Default is 3 sec,
# try for example 2 sec:
# lcp-restart 2


Next Previous Contents
Search Howtos :Match :
PhpMyAdmin 3.1.2 rc1
Php front-end to MySQL administration
Xine 1.1.6
Free video player
Glade 3.5.5
User interface builder for GTK+ and Gnome
Evolution 2.25.4
GNOME mailer, calendar, contact manager and communications tool
GEdit 2.25.4
Small but powerful text editor
Mutt 1.5.19
Small but very powerful text-based mail client.
Galculator 1.3.2
GTK 2 based scientific calculator
GTK2 2.14.7
GUI Toolkit
WebGUI 7.5.38
A fully featured content management system.
Brasero 0.9.0
Application to burn CD/DVD
Free IT Magazines, White Papers, eBooks, and more !
Dr. Dobb's Journal

Dr. Dobb's Journal enables programmers to write the most efficient and sophisticated programs and help in daily programming quandaries.

The 7 Things that IT Security Professionals MUST KNOW!

Gain key insight into security problem and find the safest means to protect your technological assets.

Database Trends and Applications

Provides timely coverage of the technology, intelligence and insight needed to plan, implement and manage information-rich projects.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info