|-----------------------| | I/O Buss | |-----------------------| | | |-----------------------| | Serial Port | |-----------------------| | | |-----------------------| | Modem | |-----------------------|
PC's have four standard ports, ttyS0-ttyS3 and cua0-cua3. These are device numbers (major:minor) 4:64,65,66,67 and 5:64,65,66,67.
MAKEDEV ttyS0 or mknod -m 666 /dev/ttyS0 c 4 64 chown root.root /dev/ttyS0
ttyS0 "/usr/etc/getty
m0:234:respawn:/sbin/uugetty -r -t 60 tty00 9600
setserial [options] device [parameters] - set port parameters setserial -g [options] device [parameters] - display port settings
stty crtscts < /dev/cua1 - for example stty -a < /dev/cua1 - displays current flags (-crtscts = not set)
|-----------------------------| | Networking Applications | |-----------------------------| | | |-----------------------------| | IP via PPP | |-----------------------------| | | |-----------------------------| | Serial Line Driver | |-----------------------------|
ogin:-BREAK-ogin: ppp ssword: OpenSesame
(expect "ogin:" if not seen, send a break and wait, send "ppp",
expect "ssword" send "OpenSesame")
ABORT BUSY ABORT 'NO CARRIER' '' ATZ OK ATDT5551234 CONNECT
(Abort is a BUSY or 'NO CARRIER' string is found. Expect
nothing, send ATZ, expect OK, send dial string, expect CONNECT)
ABORT BUSY ECHO OFF SAY "Dialing into CampusCWIX\n" '' ATDT5551234 TIMEOUT 120 SAY "Waiting for connect" CONNECT '' SAY "Loggin in - I hope" ogin:--ogin: myaccount ssword: mypassword SAY "Done"
#! /bin/csh exec /usr/sbin/pppd connect \ 'chat -v -s -f /etc/ppp/chatscript' \ -detach crtscts modem defaultroute \ /dev/modem 57600
TIMEOUT 5 "" ATZ OK ATDT5824120 ABORT "NO CARRIER" ABORT BUSY ABORT "NO DIALTONE" ABORT WAITING TIMEOUT 45 CONNECT "" TIMEOUT 5 "ogin:" harkin "assword:" Its$A#Secret # "ption:" P
Script started on Wed Nov 10 19:19:16 1999 [root@rainbow ppp]# ifconfig -a lo Link encap:Local Loopback inet addr:127.0.0.1 Bcast:127.255.255.255 Mask:255.0.0.0 UP BROADCAST LOOPBACK RUNNING MTU:3584 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 TX packets:0 errors:0 dropped:0 overruns:0 ppp0 Link encap:Point-to-Point Protocol inet addr:207.0.103.63 P-t-P:207.0.103.13 Mask:255.255.255.0 UP POINTOPOINT RUNNING MTU:1500 Metric:1 RX packets:6 errors:0 dropped:0 overruns:0 TX packets:6 errors:0 dropped:0 overruns:0 [root@rainbow ppp]# netstat -r Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface pm02-montana.ca * 255.255.255.255 UH 1500 0 0 ppp0 127.0.0.0 * 255.0.0.0 U 3584 0 0 lo default pm02-montana.ca 0.0.0.0 UG 1500 0 0 ppp0 [root@rainbow ppp]# traceroute esus.cs.montana.edu traceroute to esus.cs.montana.edu (153.90.192.1), 30 hops max, 40 byte packets 1 pm02-montana.campuscwix.net (207.0.103.13) 132.578 ms 139.826 ms 138.877 ms 2 gw01-montana.campuscwix.net (207.0.103.1) 129.574 ms 139.465 ms 139.725 ms 3 3gateway.msu.montana.edu (153.90.3.254) 129.618 ms 129.474 ms 129.732 ms 4 esus.cs.montana.edu (153.90.192.1) 129.641 ms 129.186 ms 129.752 ms [root@rainbow ppp]#
chmod o+srx /etc/ppp chmod 4755 /etc/ppp chmod o+sx /etc/ppp/ppp.script chmod 4755 /etc/ppp/ppp.script chmod o+r /etc/ppp/chatscript
demand idle 300 # number of idle seconds to disconnect ipcp-accept-remote # accept peers idea of remote address ipcp-accept-local # accepts peers idea of local address lock # one user at a time noauth # no PAP or CHAP default route # set up a default route through the PPP server user myaccount # if using PAP or CHAP remotename myisp # if using PAP or CHAP modem 57600 crtscts # speed and handshaking connect '/usr/sbin/chatscript -v -f /etc/ppp/call-isp'
myaccount mylisp mypassword
pppd :where is the address of your provider. Actually, it could be anything, because the ipcp-accept-remote option tells pppd to accept the remote servers suggestion for its IP. For example, you could enter pppd :1.2.3.4 and it would probably work.
daemon.* /var/log/ppplog local2.* /var/log/chatlog
tail -f /var/log/messages ppp-on
you will get to see the system messages as they happen.
There are a number of products that will help you configure your dial-up access. These typically have a user-friendly interface to get the data and a command-line or GUI to do the actual dial-in. Four of these are rp3 (Red Hat PPP), wvdial, kppp (installed with KDE) and linuxconf.
Virtually all these work the same. They provide an interface that allows you to select the modem device (if there is more than one), specify the telephone number, user name and password. They also allow you to specify such things as the IP address (or that it is provided by the ISP when you dial-in), gateway IP and DNS server IP's. The best documentation can be found at the Linux Doc PPP HOWTO
rp3 consists of two parts; rp3-config and rp3. When you run rp3-config it configures the PPP connection. When you run rp3, it runs a gui that allows you to connect and disconnect easily as needed.
wvdial also has two parts; wvdialconf and wvdial. As with rp3, wvdialconf elicits the necessary information and builds a configuration file (/etc/wvdial.conf). You run wvdial to connect and halt to program to disconnect.
When you run kppp, you are presented with a tab style interface that allows you to enter all of the perinent data. The Accounts tab also has a Connect button that is used to connect when you need to do that, and to disconnect when ready.
If you are familiar with linuxconf, you will have no problem with the configuration. You will find it under
Config > Networking > Client Tasks > PPP/SLIP/PLIP
As with the others, fill in the fields and save the changes. The command to use to manage the connection is netconf.
The diald configuration is /etc/diald/diald.options. This file controls how diald will behave on the system. diald must be started and that is normally done at startup. When diald is installed, it should be configured to start in the /etc/rc.d/rcX.d files. If not, you will have to do that manually. If you change /etc/diald/diald.options you will have to restart diald in order for it to process the new configuration.
# CHAP secrets example # # client server secret addrs #----------------------------------------------------------- batman.comic.org ppp.isp.net "Whos There?" batman.comic.org ppp.isp.net batman.comic.org "The Shadow Knows" ppp.isp.net * batman.comic.org "Ive Got A Secret" *.comic.org
mesg n stty -echo exec pppd -detach silent modem crtscts
Identifier Iflags Fflags login_message Next_identifier
57600# B57600 HUPCL CS8 CLOCAL # B57600 SANE IXANY TAB3 CLOCAL #login: #38400
/sbin/getty -c gettydefs_file /sbin/getty [options] line
/sbin/getty ttyS0
/sbin/getty -c /etc/gettydefs.ttyS1
/sbin/getty -t 10 ttyS2 57600 # hold line during init, drop after
# 10 seconds if nothing typed