Configuring pppd in Linux, Part II
The next step is to test whether the connection actually works. The best way to see if the link is up is to run ifconfig (see Listing 1). This command shows you the active kernel network interfaces. In my case, I have lo, the standard loopback interface I will use if I want to connect to myself, and ppp0, which is the modem PPP interface.
To see if you actually are routing to the Internet, you can run the traceroute command, followed by any IP address. For now you should use the -n option in order to disable the DNS name resolution (that hasn't been configured yet). For example:
traceroute -n 126.96.36.199 traceroute to 188.8.131.52 (184.108.40.206), 30 hops max, 38 byte packets 1 220.127.116.11 (18.104.22.168) 181.518 ms 139.473 ms 149.822 ms 2 22.214.171.124 (126.96.36.199) 129.540 ms 139.739 ms 139.821 ms
19 188.8.131.52 (184.108.40.206) 479.696 ms 479.653 ms * 20 220.127.116.11 (18.104.22.168) 489.711 ms 479.644 ms 479.874 msThe IP 22.214.171.124 is the server for www.linux.org. The program traceroute will tell you about the path followed by the packets you send to the Internet. Now, you should make sure that you tell your system the IP of your DNS, through the file /etc/resolv.conf. My resolv.conf file looks like this:
nameserver 126.96.36.199 nameserver 188.8.131.52Some ISPs don't provide a DNS server address, as your computer is given one once the PPP handshake is completed. If that is the case, you simply can disconnect and reconnect using the usepeerdns option when you run pppd:
pppd /dev/modem 38400 modem lock connect /etc/ppp/chat-connect user your_username_here defaultroute usepeerdnsNow, you can try to see if your DNS is working, using, for example, the Telnet program. The Telnet program is only an excuse to see if the system was able to translate the name www.linux.org into an IP address.
telnet www.linux.org 80 Trying 184.108.40.206... Connected to www.linux.org. Escape character is '^]'.It worked! Now, you can start your browser (Netscape, Mozilla, Opera, Galeon, Lynx, etc.) and browse the Net as you like.
By now, everything should work well; the internet connection is up, and you can connect to the Internet whenever you want. There is, of course, room for improvement. The first thing to do would be to increase the speed of the serial port and see if everything still works. To do that, just substitute 38400 with 115200 in the pppd command line.
Also, after a couple of weeks you probably will start noticing that there is a high number of parameters that have to be typed for the command pppd. In fact, every time you want to connect you have to type:
pppd /dev/modem 115200 modem lock connect /etc/ppp/chat-connect user your_username_here defaultroute
The good news is that you can, of course, put all those parameters in a configuration file, /etc/ppp/options. So, in your case, the options file would look like this:
/dev/modem 115200 modem lock connect /etc/ppp/chat-connect user defaultrouteIn this file the order of the parameters really doesn't matter. From this point on, you will be able to connect to the Internet simply by typing the command pppd. What happens if you have several providers you might want to call? In this case, you can create several options files and then place them in /etc/ppp/peers. The output below shows what my peers directory looks like:
ls -l /etc/ppp/peers total 4 -rw-r--r-- 1 root root 197 Aug 4 15:41 main_net -rw-r--r-- 1 root root 189 Mar 11 2000 primusMy file /etc/ppp/options is empty; when I run pppd, I always run:
pppd call main_netThis way, the file /etc/ppp/peers/main_net will be used as well as my /etc/ppp/options file (which happens to be empty). If my main provider (Main Net) is down for some reason, I still can use some of my time-limited account with Primus.
Now, the best thing you can do is to read the man page for pppd (just type man pppd) and see if any of the esoteric options can somehow improve your connection. In Listing 2 you will find a very rich options file written by my friend and Linux guru Pancrazio De Mauro. Can you do better than that?
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- Paranoid Penguin - Building a Secure Squid Web Proxy, Part IV
- SUSE LLC's SUSE Manager
- Google's SwiftShader Released
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- My +1 Sword of Productivity
- Managing Linux Using Puppet
- Non-Linux FOSS: Caffeine!
- SuperTuxKart 0.9.2 Released
- Parsing an RSS News Feed with a Bash Script
- Rogue Wave Software's Zend Server
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide