Grabber Softwares : Enhance Your Computing

Online with Linux

online.gif (28689 bytes)Setting up and sharing a Net connection on your LAN

linux.JPG (9333 bytes)Connecting to the Internet via Linux is ridiculously easy. Once you are connected, you can do far more than you could with any other connection.

For the sake of simplicity, I’ll assume that you have the X Windowing system running, and have also installed KDE (from the PCQ CD).

Setting up

Make sure you are logged in as root, then do the following:

Run kppp (either by clicking the K button at the bottom left of your screen, or running "kppp &" from the command prompt.

  1. Click on "Setup".
  2. Click on "New".
  3. Type in a name for the connection (such as, "VSNL", "Satyam", etc).
  4. Type in the phone number (such as, 172222).
  5. Select the authentication type ("Script-based" for VSNL dial-up, "PAP" for Satyam or VSNL ISDN).
  6. Don’t enter any DNS data—your present DNS setup on your Linux machine as configured by "pcqupdt" will handle all that.
  7. If you are using PAP authentication then that’s all you need to configure for the account, and you can skip to the next point. If you are using VSNL dialup (not ISDN) then you also have to define the login script—click on the tab "Login Script", and enter the script as:
    Expect sername:
    ID
    Expect assword:
    Password
    Pause 1
    Send ppp
    Expect ~
  8. Click on OK.
  9. Click on "Device" and set it up for your modem. The defaults should be good enough. (Remember that ttyS0 is COM1, and ttyS1 is COM2)
    Modem Device: /dev/ttyS0
    Flow Control: CRTSCTS
    Line Termination: CR/LF
    Connection Speed: 115200
    Enable Lockfile and set the modem timeout to 30 or 60 seconds (30 is usually enough for tone dialing exchanges).
  10. Click on "Modem".
  11. Make sure that "Modem asserts CD line" is not enabled.
  12. Set "Busy Wait" to the number of seconds you want to wait between attempts (probably 0).
  13. Click on Modem Commands, and set your favorite initialization string; in most cases "AT&FX1L3S10=200" should be enough. If you have to dial Pulse instead of Tone, change the Dial String from ATDT to ATDP. Click on OK.
  14. Now to see if you modem is talking to the serial port, click on Query modem, after a few seconds you should see some results, and should also see the send or receive lights on your modem flashing. If they don’t (and if DTR doesn’t come on) then you have selected the wrong modem port, correct that in the Device setting. If the lights flash but you still get an error message, your port speed in Device is probably too high, change it to 57600 or lower.
  15. Finally, click on the PPP tab, and enable all settings except "Quit on Disconnect". Set pppd timeout to 30 seconds.
  16. Click on OK.
  17. Repeat this entire sequence for any other dialup accounts you want to define.
  18. Create the file /etc/ppp/ip-up.local, and put the following commands:

    #!/bin/sh
    /usr/bin/killall -9 named
    /usr/sbin/named /etc/named.conf.online
    grep -v pppconnection /etc/hosts >/tmp/hosts.tmp
    echo "$4 pppconnection" >>/tmp/hosts.tmp
    mv /tmp/hosts.tmp /etc/hosts
    ntpdate 128.175.1.3 &> /dev/null &
    wall "Internet connection established ($4)"
    echo `date` CONNECT $4 >> /var/log/ppplog
    Save the file.
  19. Create the file /etc/ppp/ip-down.local, and put the following commands:
    #!/bin/sh
    /usr/bin/killall -9 named
    /usr/sbin/named /etc/named.conf
    grep -v pppconnection /etc/hosts >/tmp/hosts.tmp
    mv /tmp/hosts.tmp /etc/hosts
    wall "Internet connection lost"
    echo `date` DISCONNECT >> /var/log/ppplog Save the file.
  20. Make both files executable:
    chmod +x /etc/ppp/*.local
  21. Copy the file "/etc/named.conf" to "/etc/named.conf.online". Then edit the file "/etc/named.conf" and remove the following 4 lines from it:
    zone "." {
    type hint;
    file "named.ca";
    };
    Save the file.

Dialing out

Set "Connect to" to the account you want to dial, enable "Show Log Window", and hit the Connect button.

The system will now start dialing. You can watch the progress in the log window. Once you are connected, the Connection window will minimize in the right bottom corner. To disconnect, click on the modem icon and choose Disconnect.

Fire up Netscape if you haven’t used the K>utilities>Menu Editor to add Netscape to the menu, just open a terminal window and type "netscape &". Point it at www.pcquest.com.

Voila!

Sharing the connection

If you want other people on a LAN to use the same connection, you need to configure a few things:

  1. Using pcqupdt from our CD, you’ll probably have already enabled Internet Gatewaying. If you haven’t, do so now.
  2. That’s about it. Now all that’s left is to configure your Windows and other machines on the LAN to use your system as a gateway. In Windows, go to the TCP/IP properties of your LAN card and set the gateway and DNS address to the address of your machine. Reboot the machine, and next time you are online they can surf too.
  3. To speed up surfing, make sure that the squid cache on your machine is enabled, by running the command "ntsysv" and enabling squid.
  4. Edit the file /etc/rc.d/init.d/squid, and remove the "#" mark from the beginning of the line. SQUID_OPTS="-D"
  5. Save the file.
  6. Edit the file /etc/squid.conf and remove "#" from the beginning of the line "http_port 3128", and change the value to 8000 instead (easier to remember). Save the file.
  7. Start squid (it will automatically start the next time you start the machine) with "/etc/rc.d/init.d/squid start"
    Now configure your browser to use the cache, instead of talking to the Internet everytime—go to
    View>InternetProperties>Conn- ection>Proxy (in Internet Explorer) or Edit>Preferences>Advances> Proxies>Manual>View (Netscape) and set them to talk to the IP address of your machine at port 8000.
  8. Watch your browsing speed accelerate.

Note: If after connecting to the Internet, you are still unable to browse or connect to any server on the Internet, check the file /etc/sysconfig/network and remove any references to "Gateway" from it. For this session, fix the problem by running "/sbin/route del default". The next time your machine boots, this correction will be done automatically.

 

arrowLtBG.gif (4889 bytes)