-->

Previous | Table of Contents | Next

Page 291

  1. After you have the PPP information typed in, click the Customize button at the bottom of the Create PPP Interface window. The Create PPP Interface window closes, and the Edit PPP Interface window appears (see Figure 13.8).

Figure 13.8.
The Network
Configurator Edit PPP
Interface Hardware menu.

  1. Make sure that the Use hardware flow control and modem lines entry and the Abort connection on well-known errors entry are set and that Escape control characters and Allow any user to (de)activate interface are not set.
  2. In the Line speed: box, select the highest speed your computer can communicate with the modem, not the highest speed the modem can communicate with another modem. For most modems, this should be 115200.
  3. For the Modem Port: box, use /dev/modem. If you have not configured your modem with the modemtool program yet, this is the time to do it.

At this point, your hardware is configured. Now to tackle the network aspects of the configuration. Click the Networking button in the Edit PPP Interface window. The window will change to look something like Figure 13.9.


Figure 13.9.
The Network
Configurator Edit PPP
Interface Networking menu.

You now have to make some important decisions:

If you answer yes to the first question, you will be unable to drop the PPP connection until the system shuts down or you kill the pppd daemon with the kill command. For a flaky

Page 292

connection, this is a very useful option because it will keep you from having to constantly restart your connection.

Answering yes to the second question is useful only if your account with your ISP is a 24-hours-a-day connection.

To set your desired parameters, do the following:

  1. In the current Edit PPP Interface window, set the Activate interface at boot time option and Restart PPP when connection fails option to your preferences. Keep the second option, Set default route when making connection (defaultroute), set.
  2. The MRU box stands for Maximum Receive Unit, which is similar to the MTU of a network card. This option sets how much data is contained in a packet between you and your ISP within the range of 296 bytes and 1500 bytes. If your telephone lines are clear, set this number higher. Conversely, if your telephone line often has a lot of static, you will want to set it to a lower number.
  3. The last two options in the current Edit PPP Interface window let you specify your IP address and your server's IP address. In most instances, your IP address is dynamically assigned by your ISP; however, some ISPs offer a plan that gives you a static IP address for a higher monthly cost. (This is useful if you need to keep a continuous network connection going.) If you do have a static IP plan, your ISP will provide these two numbers for you. Otherwise, leave them blank.

To complete the PPP setup, click Done. Another window will come up asking if you want to save the current configuration. Click the Save button. The Edit PPP Interface window will disappear and your original Network Configurator window will show the PPP interface, as shown in Figure 13.10.

You are now ready to test your PPP connection. Click the Activate button at the bottom of the Network Configurator window to start your PPP connection. You should hear your modem dialing and connecting within a few moments. After it is connected, test the connection by pinging your ISP's nameserver. A valid connection should look something like this:


[root@technics /root]# ping -c 5 207.155.59.1

PING 207.155.59.1 (207.155.59.1): 56 data bytes

64 bytes from 207.155.59.1: icmp_seq=0 ttl=254 time=141.8 ms

64 bytes from 207.155.59.1: icmp_seq=1 ttl=254 time=140.4 ms

64 bytes from 207.155.59.1: icmp_seq=2 ttl=254 time=150.4 ms

64 bytes from 207.155.59.1: icmp_seq=3 ttl=254 time=140.3 ms

64 bytes from 207.155.59.1: icmp_seq=4 ttl=254 time=140.4 ms



--- 207.155.59.1 ping statistics ---

5 packets transmitted, 5 packets received, 0% packet loss

round-trip min/avg/max = 140.3/142.6/150.4 ms

When you are done with your connection, click the Deactivate button in the Network Configurator window. Be sure to click Save one last time before you click Quit.

Page 293


Figure 13.10.
The Network
Configurator Interfaces
menu with PPP
information.

To bring your connection back up, simply run netcfg, select Interfaces from the top menu, highlight the ppp interface, and click Activate.

TIP
Instead of having to start the netcfg program every time you want to activate your PPP connection, you can use command-line scripts in the /etc/sysconfig/network-scripts directory. The command for starting PPP is




./ifup-ppp ifcfg-ppp0 &





The command to shut down your PPP connection is


./ifdown-ppp ifcfg-ppp0 &


On-Demand Dialing

As you become more Net savvy, you might find it useful to have your machine automatically dial out to your ISP and log in whenever it detects a packet destined to a particular IP address, for example, your ISP's nameserver.

When the kernel tries to connect to an IP that it doesn't have a route for, it invokes the script /sbin/request-route with the destination IP address. request-route checks to see if it has a script corresponding to that address. If it does, the script is invoked, which presumably starts the necessary connection to establish the desired route. In most instances, this would be the PPP connection.

Page 294

There is, however, a slight limitation in the current setup. If you attempt to connect to an IP that requires the PPP connection be up, but was not specifically set with request-route so that the connection is started, the kernel will return an error to the calling program. To circumvent this, you can use a slightly modified script that establishes a default script to invoke for all IPs that cannot be reached. This feature is especially useful if you run your own nameserver.

Before using a new request-route script, make a backup copy of the original with the following command:


cp /sbin/request-route /sbin/request-route-orig

Should you decide to return back to the original script, you can simply copy the /sbin/request-route-orig script back to/sbin/request-route.

Next, add the following line


if [ ! -f $chatfile ] ; then chatfile=/etc/ppp/chat-default; fi

to request-route after the line that reads


chatfile=/etc/ppp/chat.$1

With request-route ready, you need to provide it the script files necessary to invoke the PPP connection. You've already configured PPP with the netcfg tool, so the script is already done and just needs to be copied to /etc/ppp like so:


cp /etc/sysconfig/network-scripts/chat-ppp0 /etc/ppp/chat-default

Doing this will set up your default PPP service. If for some reason you need to set up a different network connection for a particular IP address, you can create a specific chat script for that address and name it /etc/ppp/chat.xxx.xxx.xxx.xxx, where xxx.xxx.xxx.xxx is the IP address. The request-route script will automatically pick the IP-specific script over the default script.

By default, the PPP connection will automatically shut itself down after five minutes of inactivity. You can change this by editing the request-route script and changing the number after the string idle-disconnect to however many seconds you want it to wait for before automatically disconnecting.

If you want to force a disconnection before the idle out period, you can simply kill the pppd daemon. Do not use the -9 option on kill when doing so, however, because pppd intercepts the standard termination signal and does cleanup work before exiting.

Summary

As you've seen in this chapter, adding network access and networking tools to your system is a fantastic asset. And with Red Hat Linux, sharing data through these networking tools is relatively straightforward, which is impressive considering the power they add to your system.

Previous | Table of Contents | Next