LPI 101 - Configure Modem and Sound Cards (2) : (Linux Professional Institute Certification)

Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

LPI 101 Congure Modem and Sound cards [2]

(Linux Professional Institute Certication)


a .. /V\ // \\ @._.@ by: Andrew Eager [email protected]

$Id: gl1.101.3.slides.tex,v 1.3 2003/05/30 04:57:25 waratah Exp $

c 2002 Andrew Eager, Geoffrey Robertson. Permission is granted to make and distribute verbatim copies or modied versions of this document provided that this copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundationeither version 2 of the License or (at your option) any later version.

a Copyright

Setting Up a Shell Dialup Service . . . . . . . . . . Inbound Shell Login - Server . . . . . . . . . . . . Outbound Shell login - Client . . . . . . . . . . . . Setting Up a PPP Dialup Service . . . . . . . . . . . Inbound Dialup ppp - Server . . . . . . . . . . . . Outbound Dialup ppp - Client . . . . . . . . . . . . Adding Automatic DNS setup . . . . . . . . . . . .

5 6 7 8 9 12 17

Congure Modem and Sound card [1]


Objective
Ensure devices meet compatibility requirements (particularly that the modem is NOT a win-modem), verify that both the modem and sound card are using unique and correct IRQs, I/O, and DMA addresses, if the sound card is PnP install and run sndcong and isapnp, congure modem for outbound dial-up, congure modem for outbound PPP SLIP CSLIP connection, set serial port for 115.2 Kbps

Setting Up a Shell Dialup Service

Modem

Server

Client

Modem

Internet

Inbound Shell Login - Server

Inbound Shell Login - Server


1. Edit /etc/inittab to automatically spawn mgetty. $ tail -1 /etc/inittab T0:2345:respawn:/sbin/mgetty -x0 -s 57600 -D ttyS0 (Change ttyS0 to whatever device your modem is connected to)
 

5-a

Inbound Shell Login - Server


1. Edit /etc/inittab to automatically spawn mgetty. $ tail -1 /etc/inittab T0:2345:respawn:/sbin/mgetty -x0 -s 57600 -D ttyS0 (Change ttyS0 to whatever device your modem is connected to) 2. Connect the modem and phone line.
 

5-b

Inbound Shell Login - Server


1. Edit /etc/inittab to automatically spawn mgetty. $ tail -1 /etc/inittab T0:2345:respawn:/sbin/mgetty -x0 -s 57600 -D ttyS0 (Change ttyS0 to whatever device your modem is connected to) 2. Connect the modem and phone line. 3. Run # telinit q to reread /etc/inittab
   

5-c

Inbound Shell Login - Server


1. Edit /etc/inittab to automatically spawn mgetty. $ tail -1 /etc/inittab T0:2345:respawn:/sbin/mgetty -x0 -s 57600 -D ttyS0 (Change ttyS0 to whatever device your modem is connected to) 2. Connect the modem and phone line. 3. Run # telinit q to reread /etc/inittab
   

4. Check that the modems DTR indicator is on.

5-d

Inbound Shell Login - Server


1. Edit /etc/inittab to automatically spawn mgetty. $ tail -1 /etc/inittab T0:2345:respawn:/sbin/mgetty -x0 -s 57600 -D ttyS0 (Change ttyS0 to whatever device your modem is connected to) 2. Connect the modem and phone line. 3. Run # telinit q to reread /etc/inittab
   

4. Check that the modems DTR indicator is on. 5. Check mgetty is there: $ ps aux |grep mgetty root ...... /sbin/mgetty -x0 -s 57600 ttyS0
 
5-e

Outbound Shell login - Client

Outbound Shell login - Client


1. Run # minicom -s (as root) and setup the serial port to the desired tty and linespeed.


6-a

Outbound Shell login - Client


1. Run # minicom -s (as root) and setup the serial port to the desired tty and linespeed. 2. Give normal users access to the modem device.


6-b

Outbound Shell login - Client


1. Run # minicom -s (as root) and setup the serial port to the desired tty and linespeed. 2. Give normal users access to the modem device. 3. Run minicom as a normal user. Once the modem has initialised typing AT at the minicom terminal will prompt the modem to return OK: AT OK
 
6-c



and dial your server: OK ATDT12345678

Outbound Shell login - Client


1. Run # minicom -s (as root) and setup the serial port to the desired tty and linespeed. 2. Give normal users access to the modem device. 3. Run minicom as a normal user. Once the modem has initialised typing AT at the minicom terminal will prompt the modem to return OK: AT OK
 
6-d



and dial your server: OK ATDT12345678 4. When the modem answers and trains, you should be presented with a login prompt. Login as you normally would.

Setting Up a PPP Dialup Service

Modem

Server

         



   

Client

         

Modem

Internet

Inbound Dialup ppp - Server


1. Edit /etc/inittab to run mgetty. $ tail -1 /etc/inittab T0:2345:respawn:/sbin/mgetty -x0 -s 57600 -D ttyS0 Change ttyS0 to whatever device your modem is connected to. 2. Add the following line (if not already there) to /etc/modules.conf alias ppp0 ppp generic 3. Connect modem and phone line. 4. Run # telinit q to reread /etc/inittab
   

5. Edit /etc/mgetty/login.config and uncomment the line

/AutoPPP/ - a_ppp /usr/sbin/pppd auth -chap +pap login de

6. Edit the le /etc/ppp/options and uncomment or add the lines: asyncmap 0 #auth crtscts lock modem -detach proxyarp 7. Edit the le /etc/ppp/options.ttyS0 and uncomment or add the line: 192.168.0.253:192.168.0.10 The format of this line is Server IP:Client IP. Note that these addresses should be on the same network as your server unless you are prepared to setup routing for a new network. However, they should not clash with previously allocated IP addresses.
9

8. Edit /etc/ppp/pap-secrets and add: #user <username> interface * password <password>

allowed-ip-addre *

This line says: Let user <username> with password <password> use any ppp interface with any IP address. The username and password can be anything you like and do not have to be in /etc/passwd. You will need the username and password pair when you come to set up the client.

10

Outbound Dialup ppp - Client


NOTE: If your client & server machines are already connected via a LAN you will probably need to bring down the LAN on your client machine. (Or at least remove any route associated with the LAN from the client). To do and this: ifconfig eth0 down Type $ /sbin/route -n make sure it looks like the line below before conguring ppp on the client:
 

Kernel IP routing table Destination Gateway Genmask 127.0.0.0 * 255.0.0.0

Flags Metric Ref Use Iface U 0 0 0 lo

Common to both methods: Edit /etc/modules.conf and add the following line: alias ppp0 ppp generic

11

From within X:
1. Run kppp and create an entry for your server, just as you would do for an ISP. The only items that need to be added are: The telephone number of the server The userid you selected in the server pap-secrets le The password you selected in the server pap-secrets le
  

2. Click the Connect button and you should be away!.

12

From a terminal using wvdial:


Run # wvdialconf /etc/wvdial.conf . You should end up with a le called /etc/wvdial.conf that looks something like: [Dialer Defaults] Modem = /dev/ttyS0 Baud = 115200 Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 S11=55 +FCLASS=0 ; Phone = <Target Phone Number> ; Username = <Your Login Name> ; Password = <Your Password>


13

From a terminal using wvdial:


Now edit this le and add the following to the end of the le: [Dialer <server-name>] Username = username #just as you entered into pap-secrets Password = passwd #just as you entered into pap-secrets Phone = <telephone number> Inherits = Dialer Defaults Stupid mode = 1 New PPPD = 1 Stupid mode tells wvdial to start pppd as soon as it sees the login prompt and not to log into the server as a normal user rst.

14

From a terminal using wvdial:


Now you can dial your server by doing the following: $ wvdial <server-name> Where above. server-name
!  
15

is the name you gave to the second dialer stanza

Note that wvdial will add an entry into /etc/ppp/pap-secrets containing the username and password pair automatically.

Adding Automatic DNS setup


You can have the server pass a pair of DNS IP addresses to the client which the client can use to resolve dns queries. If you do this, you should be able to use Windows as a client just like any other ISP.

16

Server Side:
Add the following line to /etc/ppp/options ms-dns <DNS-IPADDR1> ms-dns <DNS-IPADDR2> The DNS ip addresses should be whatever your server is using ($ cat to see). If your server is using the local /etc/resolv.conf interface (127.0.0.1) then you should set the address to that of eth0 and make sure that bind is congured to listen on that interface. The following line should be in /etc/named.conf listen-on <ip-address>


17

Client Side:
Add the following line to /etc/ppp/options usepeerdns Now create a le called /etc/ppp/ip-up.local which contains: cp /etc/resolv.conf /etc/ppp/resolv.conf.orig echo "nameserver $DNS1" > /etc/resolv.conf echo "nameserver $DNS2" >> /etc/resolv.conf Create another le called /etc/ppp/ip-down.local which contains: cp /etc/ppp/resolv.conf.orig /etc/resolv.conf Congratulations. You now have a server which behaves just like an ISP!

18

The End Setting Up a Shell Dialup Service . . . . . . . . . . Inbound Shell Login - Server . . . . . . . . . . . . Outbound Shell login - Client . . . . . . . . . . . . Setting Up a PPP Dialup Service . . . . . . . . . . . Inbound Dialup ppp - Server . . . . . . . . . . . . Outbound Dialup ppp - Client . . . . . . . . . . . . Adding Automatic DNS setup . . . . . . . . . . . . 5 6 7 8 9 12 17

19

You might also like