Connecting to the Internet - Networking - Linux All-in-One For Dummies, 5th Edition (2014)

Linux All-in-One For Dummies, 5th Edition (2014)

Book III. Networking

 width=

webextras.eps Visit www.dummies.com/extras/linuxaio for great Dummies content online.

Contents at a Glance

Chapter 1: Connecting to the Internet

Chapter 2: Setting Up a Local Area Network

Chapter 3: Going Wireless

Chapter 4: Managing the Network

Chapter 1. Connecting to the Internet

In This Chapter

arrow Understanding the Internet

arrow Deciding how to connect to the Internet

arrow Connecting to the Internet with DSL

arrow Connecting to the Internet with a cable modem

Given the prevalence and popularity of the Internet, it’s a safe bet to assume that you want to connect your Linux system to the Internet. In this chapter, I show you how to connect to the Internet in several ways — depending on whether you have a DSL or cable modem. There are still some who connect using a dial-up network connection, but those are few and far between these days; most users aren’t comfortable with the slower performance of a dial-up connection.

Two of the options for connecting to the Internet — DSL and cable modem — involve attaching a special modem to an Ethernet card on your Linux system. In these cases, you have to set up Ethernet networking on your Linux system. (I explain networking in Chapter 2 of this minibook.) If your machine is nothing more than a client on a network that it connects to via a mobile/Wi-Fi connection, and not needing its own dedicated connection, then thinks couldn’t be easier and you’ll simply want to skim what is here before moving on to subsequent chapters.

Understanding the Internet

How you view the Internet depends on your perspective. Most people see the Internet in terms of the services they use. For example, as a user, you might think of the Internet as an information-exchange medium with features such as

· E-mail: Send e-mail to any other user on the Internet, using addresses such as mom@home.net.

· Web: Download and view documents from millions of servers throughout the Internet.

· Newsgroups: Read newsgroups and post news items to newsgroups with names such as comp.os.linux.networking or comp.os.linux.setup.

· Information sharing: Download software, music files, videos, and so on. Reciprocally, you may provide files that users on other systems can download.

· Remote access: Log in to another computer on the Internet, assuming that you have access to that remote computer.

The techies say that the Internet is a worldwide network of networks. The term internet (without capitalization) is a shortened form of internetworking — the interconnection of networks. The Internet Protocol (IP) was designed with the idea of connecting many separate networks.

technicalstuff.eps In terms of physical connections, the Internet is similar to a network of highways and roads. This similarity is what has prompted the popular press to dub the Internet “the Information Superhighway.” Just as the network of highways and roads includes some interstate highways, many state roads, and many more residential streets, the Internet has some very high-capacity networks (for example, a 10-Gbps backbone can handle 10 billion bits per second) and a large number of lower-capacity networks ranging from 56 Kbps dial-up connections to 45-Mbps T3 links. (Kbps is thousand-bits-per-second, and Mbps is million-bits-per-second.) The high-capacity network is the backbone of the Internet.

In terms of management, the Internet isn’t run by a single organization, nor is it managed by any central computer. You can view the physical Internet as a network of networks managed collectively by thousands of cooperating organizations. Yes, a collection of networks managed bythousands of organizations — sounds amazing, but it works!

Deciding How to Connect to the Internet

So you want to connect your Linux workstation to the Internet, but you don’t know how? Let me count the ways. Nowadays you have three popular options for connecting homes and small offices to the Internet (huge corporations and governments have many other ways to connect):

· Digital Subscriber Line (DSL): Your local telephone company, as well as other telecommunications companies, may offer DSL. DSL provides a way to send high-speed digital data over a regular phone line. Typically, DSL offers data transfer rates of between 128 Kbps and 3.0 Mbps (usually, the higher the speed, the more you pay). You can often download from the Internet at much higher rates than when you send data from your PC to the Internet (upload). One caveat with DSL is that your home must be between 15,000 and 20,000 feet from your local central office (the DSL provider’s facility where your phone lines end up). The distance limitation varies from provider to provider. In the United States, you can check out the distance limits for many providers at www.dslreports.com/distance.

· Cable modem: If the cable television company in your area offers Internet access over cable, you can use that service to hook up your Linux system to the Internet. Typically, cable modems offer higher data-transfer rates than DSL — for about the same cost. Downloading data from the Internet via cable modem is much faster than sending data from your PC to the Internet. You can expect routine download speeds of 12 Mbps and upload speeds of around 2 Mbps, but sometimes you may get even higher speeds than these.

DSL and cable modem services connect you to the Internet and also act as your Internet service provider (ISP). In addition to improved speed, what you’re paying for is an IP address and your e-mail accounts. Table 1-1 summarizes these options and compares/contrasts them to the dial-up connectivity you want to avoid wherever possible. You can consult that table and select the type of connection that’s available to you and that best suits your needs.

1101

remember.eps Besides the three options shown in Table 1-1, a few other less common options may be available to you. These include fiber-to-the-home (FTTH), broadband over power lines (BPL), fixed wireless broadband (called FWB or WiMAX), and satellite Internet access (for example, DIRECWAY and StarBand). If you have one or more of these options available in your geographic area and you want to use one of them for Internet access, follow the specific service provider’s instructions for setting up the Internet connection. Typically, satellite Internet access is available across large geographical regions (even places that don’t have phone or cable), but the initial equipment cost and monthly fees are higher than for DSL and cable.

Connecting with DSL

DSL stands for Digital Subscriber Line. DSL uses your existing phone line to send digital data in addition to the normal analog voice signals (analog means continuously varying, whereas digital data is represented by 1s and 0s). The phone line goes from your home to a central office, where the line connects to the DSL provider’s network. By the way, the connection from your home to the central office is called the local loop.

When you sign up for DSL service, the DSL provider hooks up your phone line to some special equipment at the central office. That equipment can separate the digital data from voice. From then on, your phone line can carry digital data that is then directly sent to an Internet connection at the central office.

How DSL works

A special box called a DSL modem takes care of sending digital data from your PC to the DSL provider’s central office over your phone line. Your PC can connect to the Internet with the same phone line that you use for your normal telephone calls — you can make voice calls even as the line is being used for DSL. Figure 1-1 shows a typical DSL connection to the Internet.

Figure 1-1: DSL provides a high-speed connection to the Internet over a regular phone line.

Your PC talks to the DSL modem through an Ethernet connection, which means that you need an Ethernet card in your Linux system.

Your PC sends digital data over the Ethernet connection to the DSL modem. The DSL modem sends the digital data at different frequencies than those used by the analog voice signals. The voice signals occupy a small portion of all the frequencies that the phone line can carry. DSL uses the higher frequencies to transfer digital data, so both voice and data can travel on the same phone line.

DSL alphabet soup: ADSL, IDSL, SDSL

warning.eps I have been using the term DSL as if there were only one kind of DSL, but DSL has three variants, each with different features. Take a look:

· ADSL: Asymmetric DSL is the most common form of DSL and has much higher download speeds (from the Internet to your PC) than upload speeds (from your PC to the Internet). ADSL can have download speeds of up to 8 Mbps and upload speeds of up to 1 Mbps. ADSL works best when your location is within about two to two-and-a-half miles (12,000 feet) of the central office. ADSL service is priced according to the download and upload speeds you want. A popular form of ADSL, called G.lite, has a maximum download speed of 1.5 Mbps and a maximum upload speed of 512 Kbps.

· IDSL: Short for ISDN DSL (ISDN is an older technology called Integrated Services Digital Network), IDSL is a special type of DSL that works at distances of up to five miles between your phone and the central office. The downside is that IDSL averages downstream (from the Internet to your PC) and upstream (from your PC to the Internet) speeds of around 144 Kbps — comparable to what an old-fashioned modem could do over a dial-up connection.

· SDSL: Symmetric DSL provides equal download and upload speeds of up to 2.0 Mbps. SDSL is priced according to the speed you want, with the higher speeds costing more. The closer your location is to the central office, the faster the connection you can get.

technicalstuff.eps DSL (and cable modem) speeds are typically specified by two numbers separated by a slash, such as 1500/384. The numbers refer to data-transfer speeds in kilobits per second (that is, thousands of bits per second, abbreviated Kbps). The first number is the download speed; the second, the upload. Thus, 1500/384 means you can expect to download from the Internet at a maximum rate of 1,500 Kbps (or 1.5 Mbps) and upload to the Internet at 384 Kbps. If your phone line’s condition isn’t perfect, you may not get these maximum rates — both ADSL and SDSL adjust the speeds to suit existing line conditions.

The price of DSL service depends on which variant — ADSL, IDSL, or SDSL — you select. For most home users, the primary choice is ADSL (or, more accurately, the G.lite form of ADSL) with transfer speed ratings of up to 9000/640.

Typical DSL setup

To get DSL for your home or business, you have to contact a DSL provider. You can find many other DSL providers in addition to your phone company. No matter who provides the DSL service, some work has to be done at the central office — the place where your phone lines connect to the rest of the phone network. The work involves connecting your phone line to equipment that can work with the DSL modem at your home or office. The central office equipment and the DSL modem at your location can then do whatever magic is needed to send and receive digital data over your phone line.

The distance between your home and the central office — the loop length — is a factor in DSL’s performance. Unfortunately, the phone line can reliably carry the DSL signals over only a limited distance — typically three miles or less, which means that you can get DSL service only if your home (or office) is located within about three miles of the central office. Contact your DSL provider to verify. You may be able to check this availability on the web. Try typing into Google (www.google.com) the words DSL availability and then your provider’s name. The search results will probably include a website where you can type in your phone number to find out if DSL is available for your home or office.

If DSL is available, you can look for the types of service — ADSL versus SDSL — and the pricing. The price depends on what download and upload speeds you want. Sometimes phone companies offer a simple residential DSL (basically the G.lite form of ADSL) with a 1500/128 speed rating — meaning you can download at up to 1,500 Kbps and upload at 128 Kbps. Of course, these are the maximums, and your mileage may vary.

After selecting the type of DSL service and provider you want, you can place an order and have the provider install the necessary equipment at your home or office. Figure 1-2 shows a sample connection diagram for typical residential DSL service.

Here are some key points to note in Figure 1-2:

· Connect your DSL modem’s data connection to the phone jack on a wall plate.

· Connect the DSL modem’s Ethernet connection to the Ethernet card on your PC.

· When you connect other telephones or fax machines on the same phone line, install a microfilter between the wall plate and each of these devices.

Because the same phone line carries both voice signals and DSL data, you need the microfilter to protect the DSL data from possible interference. You can buy these filters at electronics stores or from the DSL provider.

Figure 1-2: You can connect a PC’s Ethernet card directly to the DSL modem.

warning.eps When you connect your Linux PC to the Internet using DSL, the connection is always on, which means a greater potential for outsiders to break into the PC.

tip.eps You can protect your Linux system from intruders and, as a bonus, share the high-speed connection with other PCs in a local area network (LAN) by using a router that can perform Network Address Translation (NAT). A NAT router translates multiple private Internet Protocol (IP) addresses from an internal LAN into a single public IP address, which allows all the internal PCs to access the Internet. The NAT router acts as a gateway between your LAN and the Internet, and it isolates your LAN from the Internet — this makes it harder for intruders to reach the systems on your LAN.

If you also want to set up a local area network, you need an Ethernet hub or switch to connect the other PCs to the network. Figure 1-3 shows a typical setup that connects a LAN to the Internet through a NAT router and a DSL modem.

Figure 1-3: A NAT router isolates your PC from the Internet and also lets you share the DSL connection with other PCs in a local area network.

Here are the points to note when setting up a connection like the one shown in Figure 1-3:

· You need a NAT router with two 100BaseT or 10BaseT Ethernet ports (the 100BaseT and 10BaseT ports look like large phone jacks; they’re also known as RJ-45 jacks). Typically, one Ethernet port is labeled Internet (or External or WAN, for wide area network), and the other one is labeled Local or LAN (for local area network).

· You also need an Ethernet hub/switch. For a small home network, you can buy a 4- or 8-port Ethernet hub. Basically, you want a hub with as many ports as the number of PCs you intend to connect to your local area network. For a business, you’ll want to replace the hub with a switch.

· Connect the Ethernet port of the DSL modem to the Internet port of the NAT router, using a 100BaseT Ethernet cable. (These look like phone wires with bigger RJ-45 jacks and are often labeled Category 5 or Cat 5 wire.)

· Connect the Local Ethernet port of the NAT router to one of the ports on the Ethernet hub/switch, using a 100BaseT Ethernet cable.

· Now connect each of the PCs to the Ethernet hub/switch. (To do so, you must first have an Ethernet card installed and configured in each PC.)

tip.eps You can also buy a NAT router with a built-in 4-port or 8-port Ethernet hub. With such a combined router and hub, you need only one box to set up a LAN and connect it to the Internet via a DSL modem. These boxes are typically sold under the name Cable/DSL router because they work with both DSL and a cable modem.

Consult Chapter 2 of this minibook for information on how to configure networking on the Linux system so that your system can access the Internet.

remember.eps DSL providers typically use a protocol known as PPP over Ethernet (PPPoE) to establish a connection between your PC and the equipment at the provider’s central office. PPPoE requires you to provide a username and password to establish the network connection over Ethernet. To set up your system for a PPPoE DSL connection, all you have to do is run a utility program that configures the system for PPPoE. You can find the utility by searching in the main menu in the GUI desktop.

 width= In Ubuntu, you can set up a PPPoE DSL connection by choosing System⇒Administration⇒Network Tools, clicking the modem connection, and choosing Properties. Then go through the successive screens and provide the requested account information, such as username and password.

Connecting with a Cable Modem

Cable TV companies also offer high-speed Internet access over the same coaxial cable that carries television signals to your home. After the cable company installs the necessary equipment at its facility to send and receive digital data over the coaxial cables, customers can sign up for cable Internet service. You can then get high-speed Internet access over the same line that delivers cable TV signals to your home.

How a cable modem works

A box called a cable modem is at the heart of Internet access over the cable TV network. (See Figure 1-4.) The cable modem takes digital data from your PC’s Ethernet card and puts it in an unused block of frequency. (Think of this frequency as another TV channel, but instead of pictures and sound, this channel carries digital data.)

The cable modem places upstream data — data that’s being sent from your PC to the Internet — in a different channel from that of the downstream data that’s coming from the Internet to your PC. By design, the speed of downstream data transfers is much higher than that of upstream transfers. The assumption is that people download far more stuff from the Internet than they upload (which is probably true for most of us).

Figure 1-4: Cable modems provide high-speed Internet access over the cable TV network.

technicalstuff.eps The coaxial cable that carries all those hundreds of cable TV channels to your home is a very capable signal carrier. In particular, the coaxial cable can carry signals covering a huge range of frequencies — hundreds of megahertz (MHz). Each TV channel requires 6 MHz — and the coaxial cable can carry hundreds of such channels. The cable modem places the upstream data in a small frequency band and expects to receive the downstream data in another frequency band.

technicalstuff.eps At the other end of your cable connection to the Internet is the Cable Modem Termination System (CMTS) — also known as the head end — that your cable company installs at its central facility. (Refer to Figure 1-4.) The CMTS connects the cable TV network to the Internet. It also extracts the upstream digital data sent by your cable modem (and by those of your neighbors as well) and sends it to the Internet. The CMTS also puts digital data into the upstream channels so that your cable modem can extract that data and provide it to your PC via the Ethernet card.

Cable modems can receive downstream data at the rate of about 50 Mbps and send data upstream at around 10 Mbps. However, all the cable modems in a neighborhood share the same downstream capacity. Each cable modem filters out — separates — the data it needs from the stream of data that the CMTS sends out. Cable modems follow a modem standard called DOCSIS, which stands for Data Over Cable Service Interface. You can buy any DOCSIS-compliant modem and use it with your cable Internet service; all you have to do is call the people at the cable company and give them the modem’s identifying information so that the CMTS can recognize and initialize the modem.

remember.eps In practice, with a cable modem, you’ll most likely get downstream transfer rates of around 12 Mbps and upstream rates of 2 Mbps. These are maximum rates; your actual transfer rate is typically lower, depending on how many people in your neighborhood are using cable modems at the same time.

tip.eps If you want to check your downstream transfer speed, go to http://bandwidthplace.com/speedtest and click the link to start the test. For my cable modem connection, for example, a recent test reported a downstream transfer rate of about 2.2 Mbps, but at other times the rate has been as high as 5.2 Mbps.

Typical cable modem setup

To set up cable modem access, your cable TV provider must offer high-speed Internet access. If the service is available, you can call to sign up. The cable companies often have promotional offers, such as no installation fee or a reduced rate for three months. If you’re lucky, a local cable company may have a promotion going on just when you want to sign up.

The installation is typically performed by a technician, who splits your incoming cable into two — one side goes to the TV and the other to the cable modem. The technician provides information about the cable modem to the cable company’s head end for setup at its end. When that work is completed, you can plug in your PC’s Ethernet card to the cable modem, and you’ll be all set to enjoy high-speed Internet access. Figure 1-5 shows a typical cable modem hookup.

The cable modem connects to an Ethernet card in your PC. If you don’t have an Ethernet card in your PC, the cable company technician often provides one.

Figure 1-5: The cable TV signal is split between the TV and the cable modem.

Here are some key points to note about the cable modem setup in Figure 1-5:

· Split the incoming cable TV signal into two parts by using a two-way splitter. (The cable company technician installs the splitter.)

warning.eps The two-way splitter needs to be rated for 1 GHz; otherwise it may not let the frequencies that contain the downstream data from the Internet pass through.

· Connect one of the video outputs from the splitter to your cable modem’s F-type video connector, using a coaxial cable.

· Connect the cable modem’s 100BaseT Ethernet connection to the Ethernet card on your PC.

· Connect your TV to the other video output from the two-way splitter.

warning.eps When you use cable modem to connect your Linux PC directly to the Internet, the connection is always on, so you have more of a chance that someone may try to break into the PC. Linux includes the iptables packet filtering capability, which you may want to use to protect your PC from unwanted Internet connections.

tip.eps To isolate your Linux PC or local area network from the public Internet, you may want to add a NAT router between your PC and the cable modem. One of the NAT router’s network interfaces connects to the Internet, and the other connects to your LAN; the router then acts as a gateway between your LAN and the Internet. As a bonus, you can even share a cable modem connection with all the PCs in your own local area network (LAN) by adding an Ethernet hub. Better yet, buy a combination NAT router and hub so you have only one box to do the entire job.

tip.eps Boxes that combine NAT router and hub are typically sold under the name cable/DSL router because they work with both DSL and cable modem.

The NAT router translates private IP addresses into a public IP address. When connected through a NAT router, any PC in the internal LAN can access the Internet as if it had its own unique IP address. As a result, you can share a single Internet connection among many PCs — an ideal solution for a family of Net surfers!

Figure 1-6 shows a typical setup with a cable modem connection being shared by a number of PCs in a LAN.

Figure 1-6: A NAT router isolates your PC from the Internet and also lets you share the cable modem connection with other PCs in a LAN.

Here are the points to note when setting up a connection like the one shown in Figure 1-6:

· You need a cable/DSL NAT router with two 100BaseT Ethernet ports (the 100BaseT port — also known as an RJ-45 jack, which looks like a large phone jack). Typically, one Ethernet port is labeled Internet (or External or WAN, for wide area network), and the other one is labeled Local.

· If you plan to set up a LAN, you also need an Ethernet hub/switch. For a small home network, you can buy a 4- or 8-port Ethernet hub. Basically, you want a hub with as many ports as the number of PCs you intend to connect to your local area network.

· Consider buying a single box that acts as both a NAT router and a hub with a number of Ethernet ports.

· Connect the video cable to the video input port of the cable modem.

· Connect the Ethernet port of the cable modem to the Internet port of the NAT router using a 100BaseT Ethernet cable. (The cable looks like a phone wire except that the Ethernet cable has bigger RJ-45 jacks and is often labeled Category 5 or Cat 5 wire.)

· Connect the Local Ethernet port of the NAT router to one of the ports on the Ethernet hub, using a 100BaseT Ethernet cable.

· Now connect each of the PCs to the Ethernet hub. Each PC must have an Ethernet card.

In Chapter 2 of this minibook, I explain how to configure the PCs in a LAN so that they can all access the Internet through the router.