Last time I checked there were approximately 2,862 ways to connect to the internet with Linux. I just wanted to use PPP to connect to my ISP in a way that was easy to do and idiot proof.  Unfortunately no one  seems to want to explain how to do this.   Below I describe two ways of connecting  to your ISP, one by using minicom and the pppd command,  which will make sure everything is working right. Next  I will use RedHat's Network Configuration tool to set up a ppp connection that can be activated and deactivated with the touch of a button. Later on I will explain how to share the connection with other machines with the  ipfwadm utility.

About Modems

Linux will work with almost any modem except for WinModems. I cannot strongly enough recommend you buy a decent external modem to use with Linux. It should have a power switch and a volume control and will probably cost around $100 or so.  This will save you  time and is easy than using a $50 internal modem. It is in fact easy to set up an internal modem as well but I do not own one so it is not explained here. One note about internal modems is it is my experience that you do not need to use isapnp.conf as serial devices do not require this. For reference I use a Motorola Modem Surfr 56k.

Letting Linux know you have a modem

To tell Linux about your modem you need to make a symbolic link from the com port you modem is on to /dev/modem. In my case I type ln -s /dev/cua0 /dev/modem at a terminal.  Cua0 is com 1 while Cua1 is com 2. While this works in RedHat 5.x in 6.0 you need to use ttyS0 for com 1 ttyS1 for com 2, Please choose the appropriate port. Note this this can also be done with RedHat's modem tool but you might as well understand what's happening.

Minicom

Minicom is a communications program that will allow you dial to your ISP. Type minicom -s to tell minicom about your serial port setup, i.e. increase the line rate to 57,000 or so. After that save the setup as dfl.

Time to create  /etc/ppp/options and /etc/resolvf.conf

IMPORTANT NOTE FOR REDHAT 6.0 USERS!

The etc/ppp/options file listed here will not work with RedHat 6.0. For whatever reason I could not connect with a newly installed not upgraded RedHat 6.0 machine with this options file. I have used this method several times on different linux machines and have had no problems but for some reason it does not work with RedHat 6.0.  You can still create the /etc/resolv.conf file but then should skip to the section called an even easier way.

What are these files? Well /etc/ppp/options contains connection options for PPP and /etc/resolv.conf contains the name of your isp and your nameserver. Now type emacs /etc/ppp/options and enter the information exactly as shown below. Note # means a comment and does not have to be typed!

0.0.0.0:
#  where X is the port you use for your modem remember com1 =cua0 etc
/dev/cuaX
lock
crtscts
defaultroute
asyncmap 0
mtu 552
mru 552

Now control x, control c, y to this file.

Now emacs /etc/resolv.conf

# where earthlink.net is your isp's domain. Do not put www.
search earthlink.net
# the number below is you isp's dns server you may need 2 lines for 2 dns servers.
nameserver 123.456.789.000

Now control x, control c, y to this file.

Lets Connect!

As root type minicom and your modem will initialize.  Now inside minicom type ATDT xxx-xxxx where the x's represent your dialup number. After you connect your ISP will prompt you for your name and password. Enter them. Then you need to hit ALT-A or CNTRL -A  then Q for quit without reset. You will now be at a command prompt where as root you will type pppd. You should now be connected. Launch netscape are enjoy.  What this all does is launch the pppd daemon. You can also type ps x | grep pppd to find out the process number that pppd is running under. Lets say its 543. You can type kill 543 and soon you modem should hang up. Note  if  the pppd daemon won't die you can type kill -s 9 543 which will definitely kill the pppd daemon but this in not the preferred way.

An even easier way

On the Administration menu click Network Configuration.  Click on interfaces and add ppp. Fill in your logon name and password and then customize it.  It should be extremely obvious how to fill in the rest of the options since you really only need to change the phone number, the mru and mtu to 552 and I also recommend unchecking the box which says "Restart PPP when connection fails" unless you don't mind it restarting automatically. Save your settings and your now done. If you notice you now have an entry for ppp0 which you can active and connect to your ISP. Please note that the Names section of your Network Configuration should already be filled out because you already created /etc/resolv.conf. If you are wondering how to do this from the command line as root you can type ifup ppp0 and then ifdown ppp0 to close the connection. You can also type usernet for just a small button to activate ppp. To see what's happening type less /etc/sysconfig/network-scripts/ifup-ppp.I also wanted to mention that to make life easier you should click the allow any user to (de)activate box in RedHat's Network Configurator. The security implication for this is that any user on your system and start and stop a ppp connection. The reality is that if someone other than yourself has without your knowledge gained access to your system this is the last of your problems. Since you should not always be logged in as root, this like I said makes life easier. On my KDE desktop I have two icons one for pppup and the other for pppdown. The command line for the icon pppup up is exec ifup ppp0, the command line for pppdown is exec ifdown ppp0. Its nice and fast and keeps you from having to launch the Network Configurator program all the time.

 About KDE
 

 Main
 
 
 
 

Hosted by www.Geocities.ws

1