http://www.mandrakeuser.org/docs/connect/cppp4.html

MandrakeUser.Org - Your Mandrake-Linux Knowledge Base!

 
 

*DocIndex - Connectivity

Dial-up Networking IV

* Connecting A LAN Via Dial-up
* Getting the Software
* Dialer Setup
* DNS Cache Setup

Related Resources:

Speeding Up Your Net Browsing with PDNSD Domain Name Caching
Lightweight Caching Nameserver

Revision / Modified: June 07, 2002
Author: Kevin McCormick, edited by Tom Berger

 

* Connecting A LAN Via Dial-up

Mandrake Linux 8.0 and later offer an easy way to configure connection sharing via the Mandrake Control Center. Mandrake Linux user Kevin McCormick however wasn't content with this basic setup. In this article he describes how to connect a small home network via a Mandrake Linux machine using a dialer and a DNS cache.

The network consists of three machines, two of them running Mandrake Linux and one MS Windows 95. They are connected via a hub, the uplink is established via an ISDN Terminal Adapter (TA). The machine to which this adapter is connected to is referred to as the server. It has the IP 192.168.1.1. This IP is configured as the DNS server address on the clients. Make sure that FORWARD_IPV4 is set to true in '/etc/sysconfig/network' on the machine which act as the Internet gateway.

The article assumes that the local network is up and running. If it isn't, refer to the article on Establishing A Local TCP/IP Network. It also assumes that PPP dial-up is working on the machine which is connected to the Internet.

* section index * top

* Getting the Software

The "feature" of this configuration is the dialer and DNS cache. The dialer program is called dwun ('Dialer Without Useful Name'), and the DNS cache is called pdnsd (Proxy DNS Daemon). These programs allow any computer on the network to dial the ISP for web surfing or e-mail, as long as the server is running.

Both projects offer source archives or precompiled RPM archives which should work fine on every Mandrake Linux 8.x system.

* section index * top

* Dialer Setup

For 'dwun', the preliminary details that must be resolved are the serial port and modem device file. In my case, the ISDN TA is attached to the first serial port '/dev/ttyS1', but that device will often be identified by a symlink, '/dev/modem'. Once that is verified, the proper modem initialization commands must be determined. This can be discovered by reading the modem user manual, and perhaps with minicom, a terminal communications program that comes with Mandrake and many other distributions.

For my setup, 'dwun' uses 'pppd' (Point to Point Protocol daemon) and 'chat', which establishes the connection between the local pppd and that of your provider.
The directions are found in the README file in the 'examples/chatscripts' directory.
The basic sequence of events in activating dwun is 1) read the '/etc/dwunrc' file at startup, 2) when requested, execute 'pppd' using a 'chat' script, and 3) when no computer in the network is asking for the Internet connection, disconnect and shut down 'pppd'.

The options for pppd are typically found in a file called '/etc/ppp/options'. For 'dwun', however, you should back up that file and delete all lines from the original file.
According to man pppd, if 'pppd' is called with the argument call name, then 'pppd' will read the options from '/etc/ppp/peers/name'. This is the method used by 'dwun' in my setup. Thus, the '/etc/dwunrc' file contains the line:

commandon /usr/sbin/pppd call dwun

and the file '/etc/ppp/peers/dwun' contains all the options for the 'pppd' daemon. The '/etc/ppp/peers/dwun' file in turn contains the line:

connect "/etc/dwun.chatscript /etc/ppp/phonelist"

which directs 'pppd' to initialize by using the chat script found in '/etc/dwun.chatscript', which takes the argument '/etc/ppp/phonelist'.

Once the initialization commands for the modem are known, the '/etc/dwun.chatscript' file (the former 'chat.pap-chap' template from 'examples/chatscripts') must be edited to include these in the expect/send pairs, as well as the proper CONNECT message to expect. An excerpt from my 'dwun.chatscript', which is contained in the dial() function shows what works for me:

      "" "AT &F S60=64"        \
      OK ATD\\T         \
      "CONNECT 115200" \d\c

Note the ATD\\T. The \\T is actually a placeholder for the ISP telephone number, placed in the '/etc/ppp/phonelist' file (so the phonelist file should not have blank or comment lines). This does allow one to have several ISP telephone numbers for 'dwun' to try in sequence until one actually works. The CONNECT 115200 argument is probably a feature of my 3ComImpactIQ ISDN TA.

Then, following the directions provided by the 'dwun' author, the '/etc/ppp/ip-up.local' and '/etc/ppp/ip-down.local' files are edited. All of the suggested changes have worked fine for me without touching the ip-up or ip-down scripts.

This completes the server discussion regarding dwun.
The client programs for dwun are really quite simple. Install 'gcdial' either from source or RPM. WinDWUN is for MS Windows 9x and 2000 machines and comes as an .exe which unpacks and installs itself.
Both have a very simple setup and work reliably. To use the clients, simply click on the client icon, click the connect button, and start your webbrowser.
For MS Windows, Netscape should be set to "direct connection to internet" and not to a proxy.

* section index * top

* DNS Cache Setup

Now on to the setup of 'pdnsd'. There is one relevant point regarding the '/etc/ppp/peers/dwun' file. Do not include the option 'usepeerdns' if you intend to use 'pdnsd' or your own caching nameserver.

The 'pdnsd' program has the benefits of providing name resolution without the overhead of BIND DNS. Also, it uses a cache file, so the name/address lookup results are not totally lost every time the server is restarted. My experience has shown an improvement is apparent server performance.

After installation, the '/etc' directory will contain a file called 'pdnsd.conf.sample'. Copy that file and rename it to 'pdnsd.conf'.
'pdnsd.conf' consists of two section which are of interest, 'global' and 'server'. Each option=value line ends with a semi-colon. In the 'global' section, I set perm-cache=2048, paranoid=on, daemon=on, and server_ip="192.168.1.1".

The 'ip' entry in the 'server' section should point to your service provider's DNS address as listed in '/etc/resolv.conf'. If provider offers more than one DNS address, duplicate the 'server' section and enter the second DNS address in the 'ip' field of the duplicated 'server' section.

Back up '/etc/resolv.conf' next. Replace all content in the original file with the line

nameserver 127.0.0.1

Restart the network as 'root' with

service network restart

Now start 'pdnsd' as 'root' with

service pdnsd start

Notice that 'pdnsd' opens port 53 on the server.

* section index * top

* Conclusion

Both dwun and pdnsd should show up in DrakConf | System | Services

Well, that does it for the How-To. I have no idea how secure these programs are, but I have not detected any problems. I have found this setup to be reliable and trouble free, and it seems that web surfing is faster. Everyone can learn to click on the dwun client icon and then the browser icon, so I do not have to assist with web-surfing very much. I hope this commentary has been helpful.

* section index * top

 
Legal: All texts on this site are covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB (Tom Berger) and Mandrakesoft 1999-2002.