| |
Linux Internet connection to
NetVision
1. You need root permissions - run 'id'.
2. Check if pppd available on your system - run pppd, it should be in
/usr/sbin.
a. You don't have a ppp package: refer to "PPP downloading".
b. If you see the message "Sorry, pppd is not supported on
your system" or a like you need to reconfigure
your kernel:
add ppp support to a kernel or load ppp module.
Refer to "Kernel configuration".
c. If you see:
[root@sensei ~]# pppd
/etc/ppp/options: No such file or directory
use 'touch /etc/ppp/options' to create it, and try
again.
d. If you see something like this:
[root@sensei ~]# pppd
~?}#?!}!}!} }2}!}$}%?}%}&????}'}"}(
ppp is supported by your system. Move on.
3. Find your modem. You need to use one of the devices from your /dev
directory to access your modem.
a. If you know which COM port it is in dos, you can use one
of these devices:
COM1 - /dev/cua0 or /dev/ttyS0
COM2 - /dev/cua1 or /dev/ttyS0
COM3 - /dev/cua2 or /dev/ttyS0
COM4 - /dev/cua3 or /dev/ttyS0
b. If you don't know on what COM port your modem is, or your
modem has non-standard configuration, refer to
"Modems troubleshooting".
We'll suppose your modem is on [COM2 - /dev/cua1] in all our examples.
The simplest way to set a modem for most applications in Un*x system
is making a soft link to a modem device:
[root@sensei ~]# ln -s /dev/cua1 /dev/modem
Let's start the config for your internet connection
If everything goes OK, we need to do the next:
1. We'll put all our configuration files in /etc/ppp directory, so check
if you have one:
[root@sensei ~]# ls -al /etc/ppp
total 8
drwxr-xr-x 2 root root 1024 Oct 14 09:43 .
drwxr-xr-x 19 root root 2048 Oct 14 08:33 ..
-rw------- 1 root root 77 Oct 14 08:56 chat0
-rwx------ 1 root root 63 Oct 14 09:43 ppp-down
-rw------- 1 root root 380 Oct 14 09:38 options
-rw------- 1 root daemon 93 Oct 14 08:57 pap-secrets
-rwx------ 1 root root 58 Oct 14 08:57 ppp-up
If not, create it:
[root@sensei ppp]# mkdir /etc/ppp
2. Now we'll build 5 files we need for a connection. You can see the names
in the previous section. Choose your favorite editor and start to
write, or simple use:
[root@sensei ppp]# cat > /etc/ppp/options
/dev/modem
# modem device to use
38400
# baud rates can be:
9600,19200,38400,57600
defaultroute
# makes ppp to set default gateway on remote network
crtscts
# turns on
CTS/RTS flow control on modem line
lock
# locks modem device
when in use
name operator # gives the
username for PAP authentication
{ Everything after a '#' is a comment }
[root@sensei ppp]# cat > /etc/ppp/pap-secrets
# Secrets for authentication using PAP
# client server secret
IP addresses
operator *
YouWiSH
This file contain your username, * for servers, and your password after it.
Put in your username instead of 'operator' and the password instead of 'YouWish'.
WARNING: REMEMBER, YOU HAVE YOUR PASSWORD HERE IN CLEAR TEXT MODE. CHANGE THE PERMISSIONS
OF THIS FILE TO YOURS ONLY:
chmod 600 /etc/ppp/pap-secrets
[root@sensei ppp]# cat > /etc/ppp/chat0
'ABORT' 'BUSY'
'ABORT' 'NO CARRIER'
'' 'ATZ'
'OK' 'ATDT8550311'
'CONNECT' ''
This is a connection script for a modem. It built in "expect transmit" form.
The phone number you're dialing located in 4th line (8550311), so change it
appropriately (see: NetVision's phone numbers)
Script for bringing a ppp connection up:
[root@sensei ppp]# cat > /etc/ppp/ppp-up
#!/bin/sh
/usr/sbin/pppd connect 'chat -f /etc/ppp/chat0'
For terminating connection:
[root@sensei ppp]# cat > /etc/ppp/ppp-down
#!/bin/sh
kill ` ps -x | grep pppd | grep -v grep | cut -c -5`
Pay attention: ` sign located on same button as ~.
Those are executable scripts for a bringing a ppp up and down. Don't
forget to give it executable permissions:
[root@sensei ppp]# chmod 700 /etc/ppp/ppp-up
[root@sensei ppp]# chmod 700 /etc/ppp/ppp-down
3. Configure your system to work with a DNS servers of NetVision,
/etc/resolv.conf is a file that should contain all of this information:
[root@sensei ppp]# cat > /etc/resolv.conf
search NetVision.net.il
nameserver 194.90.1.5
nameserver 199.203.1.20
4. Now, all configured. If you want to connect you is simple running:
[root@sensei ppp]# /etc/ppp/ppp-up
and wait. You can run 'ifconfig' to see if ppp0 interface is up.
If it is, you're connected. When you wanna disconnect run:
[root@sensei ppp]# /etc/ppp/ppp-down
That's all, welcome to the internet.
PPP downloading
You can download the ppp package for the following systems (Linux, SunOS,
SVR4, NetBSD, AIX, Ultrix, OSF, NeXTStep) from:
ftp://sunsite.unc.edu/pub/Linux/system/network/serial/ppp/ppp-2.2.0g.tar.gz
Kernel configuration
You have three options for configuring ppp support on your system:
a. Recompile the kernel with [PPP Support] option enabled.
b. Compile ppp module on your system and after it load it depend
on the system. For example: Let's tell you've
compiled the
module and it's name is ppp.o - Linux use 'insmod
ppp.o',
SunOS 'modload ppp.o', etc.
c. Leave the idea to connect with a Un*x system to the net :).
Modems troubleshooting
If you have MS-DOS on your computer, boot it in MS-DOS mode and run MSD.EXE,
regularly located in C:\DOS. Press "COM Ports" button. You'll get the list
of COM ports available on your system. Look at CD, DSR and CTS. It should
be "Yes" for a modem. "UART Chip Used" should begin with 16550 or
larger
number. Yea, that's the modem. Write down the "Port address" for it.
Go back to Linux and type 'cat /proc/ioports'. Look for a port with a number
you have. If you do not see this port number, that mean you have no support
for serial lines in your kernel or autoprobe doesn't work. You can use
'cat /proc/interrupts' for looking on an interrupts used by your system.
Now, we need to find out what device we can use for a modem. Regularly,
here is the settings accordingly to port address:
03f8 - /dev/cua0 or /dev/ttyS0
02f8 - /dev/cua1 or /dev/ttyS1
03e8 - /dev/cua2 or /dev/ttyS2
02e8 - /dev/cua3 or /dev/ttyS3
In a case of non-standard serial port settings like an Irq or Port Address
you'll need to use the Linux tool: setserial, usually placed in /usr/sbin.
[root@sensei ppp]# setserial /dev/cua1
/dev/cua1, UART: 16550A, Port: 0x02f8, IRQ: 3
[root@sensei ppp]# setserial /dev/cua1 irq 5
[root@sensei ppp]# setserial /dev/cua1
/dev/cua1, UART: 16550A, Port: 0x02f8, IRQ: 5
As you can see, we changed the IRQ settings for /dev/cua1 from 3 to 5.
Usually you would like to run it from one of bootstrap config files.
Use 'man setserial' for more options.
|