The /dev directory in Linux is where we must begin for the correct setup of
the modem. Type the following command:
(lines beginning with ~# are command line arguments)
~# ls -la /dev/cua* crw-rw---- 1 root uucp 5, 64 Feb 23 08:20 cua0 crw-rw---- 1 root uucp 5, 65 Jul 17 1999 cua1 crw-r----- 1 root uucp 5, 66 Jul 17 1999 cua2 crw-r----- 1 root uucp 5, 67 Jul 17 1999 cua3
This shows the directory listing for the 4 serial ports.
Modem ports.
If your modem is: It will be in: DOS(Windows) Linux com1 cua0 com2 cua1 com3 cua2 com4 cua3If you don't know which port your modem is on type:
~# echo atdt5551212 > /dev/cua0
At this point you should hear the modem dial (First rule of thumb: make
sure everything is connected). Explore each port until you find the correct
port the modem is on. If none of the ports dial out, either you have a
winmodem or you should contact you modem vendor for any necessary drivers
for that modem.
Winmodems are very popular on Win@ows machines, but are not well
supported by Linux. A
list of supported Winmodems. And here are drivers for some of those modems.
In this example we will have cua0 as a v.90 modem.
Most Linux distributions suggest that you create a symbolic link for your modem. To create this link type:
~# ln -s /dev/cua0 /dev/modem
This command creates a file as listed below in the /dev directory
lrwxrwxrwx 1 root root 4 Apr 14 16:32 modem -> cua0
*NOTE* If you plan to have users start and stop this connection, change the permissions for /usr/sbin/pppd
You will need the following files setup.
/etc/HOSTNAME # /etc/host.conf # /etc/hosts # /etc/hosts.allow # /etc/hosts.deny # /etc/options # /etc/resolv.conf # /etc/ppp/pap-secrets # /etc/ppp/pppscript # /usr/local/sbin/dialppp #------------------------------------------------------------------------------ /etc/HOSTNAME ------------------------------------------------------------------------------ localhost # This will be the name of your machine and can be anything ------------------------------------------------------------------------------ /etc/host.conf ------------------------------------------------------------------------------ order hosts, bind multi on ------------------------------------------------------------------------------ /etc/hosts ------------------------------------------------------------------------------ 127.0.0.1 localhost localhost ------------------------------------------------------------------------------ /etc/hosts.allow ------------------------------------------------------------------------------ ALL: LOCAL ALL: ding. # If you uncomment the next 2 lines, any IP Block will be able # to "see" your system but not login. #ALL: xxx.xxx.xxx. #This allows all of a class C #ALL: xxx.xxx #This allows all of a class B ------------------------------------------------------------------------------ /etc/hosts.deny ------------------------------------------------------------------------------ # The following line blocks everyone not listed in /etc/hosts.allow from # being able to "see" your machine. ALL: ALL ------------------------------------------------------------------------------ /etc/resolv.conf ------------------------------------------------------------------------------ nameserver 209.102.32.6 # These are given by your isp, call them search isp.com # This setting allows you to just type www or # ftp to get specific services ------------------------------------------------------------------------------ /etc/ppp/options ------------------------------------------------------------------------------ lock defaultroute noipdefault # you will be assigned a random ip number modem /dev/modem 115200 # This will set the port speed of the modem # usually 115200 or 57600 for v.90 or X2 modems # 38400 for 28.8k or 33.6k modems # 19200 for 14.4k modems crtscts debug passive asyncmap 0 # name "loginname@isp.com" ------------------------------------------------------------------------------ /etc/ppp/pap-secrets ------------------------------------------------------------------------------ # PAP authentication file: /etc/ppp/pap-secrets # This file should have a permission of 600. # ~# chmod 600 /etc/ppp/pap-secrets # Username Server Password IP addresses "loginname@isp.com" * "password" # You should be prompted for a password if you leave "password" # blank ------------------------------------------------------------------------------ /etc/ppp/pppscript ------------------------------------------------------------------------------ TIMEOUT 60 ABORT ERROR ABORT BUSY ABORT "NO CARRIER" ABORT "NO DIALTONE" "" "AT&F1" OK "atdt9,4042873038" # Find your local access number from your isp TIMEOUT 75 CONNECT ------------------------------------------------------------------------------ /usr/local/sbin/dialppp ------------------------------------------------------------------------------ #!/bin/bash # kills other PPP processes killall -INT pppd 2>/dev/null # removes any PPP related lock rm -f /var/lock/lck* /var/run/ppp*.pid # this is the actual dialer command to isp /usr/sbin/pppd connect "/usr/sbin/chat -v -f /etc/ppp/pppscript" & ------------------------------------------------------------------------------ /usr/local/sbin/downppp ------------------------------------------------------------------------------ # I haven't figured out why this doesn't work yet # kill -INT `cat /var/run/$DEVICE.pid` # try this: #kill -15 `ps aux | grep -i pppd` kill -15 `cat /var/run/ppp0.pid` # This is assuming you have one dial # up session going.After creating these files issue the command:
~# chmod 711 /usr/sbin/dialppp ~# chmod 711 /usr/sbin/downppp