Zen and the Art of Ubuntu Networking - Networking and the Internet - Ubuntu Linux For Dummies (2007)

Ubuntu Linux For Dummies (2007)

Part II: Networking and the Internet

In this part . . .

Part II concentrates on most readers' number one concern: getting a network connection and accessing the Internet. Chapter 6 describes connecting to a private network via Ethernet, Chapter 7 moves on to using wireless networks. Chapter 8 moves on to using high-speed broadband Internet connections. Chapter 9 reverts to using old-school dialup modems, and Chapter 10 provides the essential network security ingredient, the firewall.

Part II: Networking and the Internet

In this part . . .

Part II concentrates on most readers' number one concern: getting a network connection and accessing the Internet. Chapter 6 describes connecting to a private network via Ethernet, Chapter 7 moves on to using wireless networks. Chapter 8 moves on to using high-speed broadband Internet connections. Chapter 9 reverts to using old-school dialup modems, and Chapter 10 provides the essential network security ingredient, the firewall.

Chapter 6. Zen and the Art of Ubuntu Networking

In This Chapter

· Connecting to a wired network

· Configuring your network connection

You're already connected to a network if you're connected to a network. Huh? What kind of Zen network am I talking about? No, Ubuntu isn't a Zen master, but it's good at looking for and making network connections. Ubuntu is smart enough to figure out how to do all the sundry housekeeping jobs that getting connected requires.

If you booted live Ubuntu in Chapter 2 or installed it in Chapter 4, Ubuntu looked for a network. Assuming your computer was connected to a network switch (or hub), Ubuntu made the connection. At that point, you could use the network.

However, Ubuntu makes it easy to change or make a connection (in case you didn't originally have a network connection). This chapter describes using the network configuration utility for a wired network.

You can skip this chapter if you don't plug directly into a home or office network with an Ethernet cable. You probably need one of the following chapters instead for your network and Internet services:

· Chapter 7 walks you through connecting an Ubuntu computer to a wireless network (with or without networked Internet service).

· Chapter 8 tells you about connecting your Ubuntu computer directly to a broadband DSL or cable Internet modem without going through a network.

· Chapter 9 shows you how you can use your Ubuntu computer with a dialup Internet modem without going through a network.

Connecting to a Wired Network

Networking has advanced considerably in recent years. Back in the day, you had to work really hard to get connected. Economics dictated that using a local area network (LAN) was generally limited to medium or large businesses and organizations. Broadband Internet access was even more inaccessible. Mere mortals like me had to live with connecting to the Internet using old, slow dialup modems from a single computer.

Life was indeed hard. I personally had to take three buses and then walk through two feet of snow, uphill both ways, to get to the university to use their network. But technology marches on, and today we all can enjoy the power and utility of fast Internet and faster LANs.

Networking on a LAN is fundamentally the same as networking on the Internet. Whether you're communicating over a LAN or the Internet, your computer uses the same TCP/IP protocols. The Transmission Control Protocol/Internet Protocol (TCP/IP) dictates how computers and networks communicate. TCP/IP makes LANs and the Internet possible by providing the rules that every computer and network uses to communicate.

You need the following elements to connect to a wired network:

· A computer with an Ethernet connection: Since 2000, most PCs and laptops come equipped with a built-in Ethernet; you can purchase Ethernet add-on cards to plug into your computer for around $20. Ethernet adapters also come in USB formats and PCMCIA cards for laptops.

· An Ethernet switch: All cable and DSL modems include at least one Ethernet connection; many provide four or more connections. You can also purchase inexpensive Ethernet switches with four or more Ethernet connections in any electronics store.

· A category 5 (Cat5) Ethernet cable: Cable and DSL modems most often include a Cat5 cable. You can purchase Cat5 cables in any electronics store. You use the cable to connect your computer to the Ethernet switch.

Connect your Ubuntu computer to the Ethernet switch with a Cat5 cable, and you're ready to configure and use your LAN and the Internet.

Chapter 6. Zen and the Art of Ubuntu Networking

In This Chapter

· Connecting to a wired network

· Configuring your network connection

You're already connected to a network if you're connected to a network. Huh? What kind of Zen network am I talking about? No, Ubuntu isn't a Zen master, but it's good at looking for and making network connections. Ubuntu is smart enough to figure out how to do all the sundry housekeeping jobs that getting connected requires.

If you booted live Ubuntu in Chapter 2 or installed it in Chapter 4, Ubuntu looked for a network. Assuming your computer was connected to a network switch (or hub), Ubuntu made the connection. At that point, you could use the network.

However, Ubuntu makes it easy to change or make a connection (in case you didn't originally have a network connection). This chapter describes using the network configuration utility for a wired network.

You can skip this chapter if you don't plug directly into a home or office network with an Ethernet cable. You probably need one of the following chapters instead for your network and Internet services:

· Chapter 7 walks you through connecting an Ubuntu computer to a wireless network (with or without networked Internet service).

· Chapter 8 tells you about connecting your Ubuntu computer directly to a broadband DSL or cable Internet modem without going through a network.

· Chapter 9 shows you how you can use your Ubuntu computer with a dialup Internet modem without going through a network.

Connecting to a Wired Network

Networking has advanced considerably in recent years. Back in the day, you had to work really hard to get connected. Economics dictated that using a local area network (LAN) was generally limited to medium or large businesses and organizations. Broadband Internet access was even more inaccessible. Mere mortals like me had to live with connecting to the Internet using old, slow dialup modems from a single computer.

Life was indeed hard. I personally had to take three buses and then walk through two feet of snow, uphill both ways, to get to the university to use their network. But technology marches on, and today we all can enjoy the power and utility of fast Internet and faster LANs.

Networking on a LAN is fundamentally the same as networking on the Internet. Whether you're communicating over a LAN or the Internet, your computer uses the same TCP/IP protocols. The Transmission Control Protocol/Internet Protocol (TCP/IP) dictates how computers and networks communicate. TCP/IP makes LANs and the Internet possible by providing the rules that every computer and network uses to communicate.

You need the following elements to connect to a wired network:

· A computer with an Ethernet connection: Since 2000, most PCs and laptops come equipped with a built-in Ethernet; you can purchase Ethernet add-on cards to plug into your computer for around $20. Ethernet adapters also come in USB formats and PCMCIA cards for laptops.

· An Ethernet switch: All cable and DSL modems include at least one Ethernet connection; many provide four or more connections. You can also purchase inexpensive Ethernet switches with four or more Ethernet connections in any electronics store.

· A category 5 (Cat5) Ethernet cable: Cable and DSL modems most often include a Cat5 cable. You can purchase Cat5 cables in any electronics store. You use the cable to connect your computer to the Ethernet switch.

Connect your Ubuntu computer to the Ethernet switch with a Cat5 cable, and you're ready to configure and use your LAN and the Internet.

Using the Network Configuration Tool

As expected, Ubuntu provides an easy-to-use network configuration utility. You can configure your Ubuntu computer to connect to a LAN by using the following instructions:

1. From the GNOME menu bar, choose SystemAdministrationNetworking.

The Enter Your Password to Perform Administrative Tasks dialog opens (unless you've entered your password in the previous five minutes).

2. Type your password in the text box and click OK.

The Network Settings dialog, shown in Figure 6-1 , opens.

Figure 6-1: Looking at your network-related devices.

Enter the password you chose during the Ubuntu installation process described in Chapter 4.

Most computers come equipped with an integrated Ethernet network device; many computers, especially laptops, also come with a built-in modem. The Network Settings dialog shows all the network-related devices on your computer.

· Click the Wired connection and click the Properties button.

The Interface Properties dialog opens, showing your current, if any, configuration.

At this point, you can choose between static and dynamic network configuration. The rest of the chapter describes how to use these connections.

Choosing network connections

The Internet uses IP addresses to identify the location of both the sender and receiver. You must assign an IP address to your Ubuntu computer before it can connect to and use your LAN and the Internet.

There are two ways you can assign an IP address to your Ubuntu computer: dynamically or statically.

You can use either method in this chapter, but consider these guidelines:

· Use dynamic IP addresses (DHCP) if you don't want to provide network services (share files and folders, provide Web pages, and so on).

DHCP reduces the configuration work required to use a network. Most cable and DSL modems and Ethernet switches dynamically assign an IP address to any computer (or printer or networking device) that connects to it by using the dynamic host configuration protocol (DHCP). DHCP allows a computer to connect to a network containing a DHCP server and automatically have an IP address assigned to it.

· Avoid using static IP addresses unless you're setting up a server.

Static IP addresses don't change and are useful when setting up a computer that provides services to a network. You generally need to know the IP address of a server so you can contact it and use the service or services it provides.

Configuring a dynamic connection

You can use Ubuntu's network configuration utility to set up dynamic networking using DHCP. DHCP provides the easiest method to configure and use a LAN or Internet connection.

Dynamic host configuration protocol

DHCP dynamically (automatically, on demand) assigns IP addresses to computers and any networked devices (such as printers) on your LAN. You'll find that in general, your dynamic IP addresses rarely change. That's because DHCP generally sets a time-to-live (TTL) option of a day or two on assigned IPs. Your IP will be reassigned only if you leave your computer off for more than the TTL and another computer asks for an address; even then, the DHCP server might not reassign your IP address, but hand out the one in sequence.

You shouldn't have to configure a cable or DSL modem (or Ethernet switch) to use DHCP. Most such devices default to DHCP unless you configure them otherwise. That means you usually only need to plug your Ubuntu computer into the cable modem, DSL modem, or Ethernet switch to obtain an IP address that enables you to use the network.

The following instructions tell your Ethernet interface on your Ubuntu computer to use DHCP:

1. From the GNOME menu bar, choose SystemAdministrationNetworking.

Or if you still have the Interface Properties dialog open from earlier in the chapter, skip ahead to Step 4.

The Enter Your Password to Perform Administrative Tasks dialog opens (unless you've entered your password in the previous five minutes).

2. Type your password in the text box and click OK.

The Network Settings dialog, shown in Figure 6-1 , opens.

3. Click the Properties button in the Network Settings dialog.

The Interface Properties dialog, shown in Figure 6-1 , opens. The Enable This Connection check box should be selected and the Configuration drop-down menu should be set to DHCP.

Figure 6-1: The Interface Properties dialog.

· Click OK.

The Interface Properties dialog closes and control returns to the Network Settings utility.

· Select the check box immediately to the left of the Wired connection option.

Your current network connection closes.

· Click the check box again.

Your new network connection, including all the changes you made in the previous steps, opens.

· Click OK.

That's all there is to it! The Network Settings window closes and your Ubuntu computer is connected to your LAN or to your broadband modem. Your Ubuntu computer will now automatically get an IP address assigned to it from your broadband gateway or Ethernet switch.

If you're using DHCP (dynamic IP addresses), you can skip the rest of this chapter, which shows how to configure your Ubuntu computer to use static IP addresses.

Chapter 10 shows how to configure a firewall.

Configuring a static connection

Static IP addresses, as the name implies, don't change after they're set. You choose your IP address rather than letting your network switch or broadband modem make the selection.

Your static network connection configuration is not saved permanently if you're using live Ubuntu. (See Chapter 2 for instructions on using live Ubuntu.) Your configuration settings will be lost when you reboot your computer. Network configurations are saved if you're using a permanent Ubuntu installation. (See Chapter 4.)

Finding network information

If you're using a static IP address, the information you need for your Ubuntu computer's network connection depends on whether you're using someone else's network (such as at a school or a business) or your own.

Someone else's network

If you're connecting to someone else's network with a static IP address, ask your friendly system administrator for this information:

· IP address for your Ubuntu computer: _______________

· Subnetwork mask: _______________

The subnetwork mask value usually is 255.255.255.0, except for some very large organizations.

· Internet gateway: _______________

· Domain name: _______________

· DNS search domain: _______________

· Primary DNS server: _______________

· Secondary DNS server: _______________

When you have all the information you need to connect to someone else's network with a static IP address, skip to the "Configuring Ubuntu" section in this chapter.

Your own network

If you're connecting to your own network with a static IP address, some information is optional and other information is required.

You must have this information to set up Ubuntu on your own network:

· An IP address for your Ubuntu computer: _______________

· The subnetwork mask: _______________

Your broadband router (modem) generally determines what IP address range you'll use. I've found broadband modems usually use either 192.168.0.1 or 192.168.1.1, but in one case the device used 10.0.0.1. Consult your device's manual to find out what default private IP addresses the device uses. Most devices automatically provide a private IP address space on the Ethernet ports you connect your LAN computers to. You can change the addresses if your Internet service provider (ISP) uses a nonstandard configuration, but otherwise you should use the default.

· Internet Gateway address: _______________

The gateway address usually is 192.168.0.1 or 192.168.1.1 for a consumer broadband cable or DSL modem. Check your DSL modem's manual to find out.

· DNS server IP addresses: _______________

You can find a DNS server or two by contacting your ISP. DNS servers convert Internet address names (such as www.theonion.com) to the actual IP addresses (such as 65.61.134.200).

· Search domain (optional): _______________

Specifying a search domain eliminates the need to specify an entire — fully qualified — address when writing Internet names with that domain. For instance, say your Ubuntu computer is connected to a network whose domain is thisismynetwork43.com, and the Web server is named www.thisismynetwork43.com. By specifying the search domain thisismynetwork43.com, you only have to write www instead of www.thisismynetwork.com when connecting to the Web server with a browser.

If you're running your own home network, you can select your own values for these elements:

· A hostname (your computer): _______________

A default hostname is created when you install Ubuntu.

· Your domain name (your network): _______________

Configuring Ubuntu

When you have all the information to connect to a network with a static IP address, you're ready to set up Ubuntu. The rest of this chapter guides you through the steps.

IP address

This section describes configuring your IP address, subnetwork mask, and gateway address. Follow these steps:

1. From the Configuration drop-down menu in the Interface Properties window (refer to Figure 6-1 ), choose Static IP Address.

The IP Address and other text boxes activate.

2. Type your IP address in the IP Address text box.

3. If necessary, change your subnetwork mask value.

You should never have to change your subnetwork mask unless you're connecting to a very large organization's LAN (in which case, the system administrator will tell you what value to use).

255.255.255.0 (the usual subnetwork mask value) is automatically entered in the Subnet Mask text box.

4. Type the IP address of your Internet connection in the Gateway Address text box.

The value usually is 192.168.0.1 or 192.168.1.1 when using a consumer broadband cable or DSL modem.

Figure 6-1 shows a sample completed Interface Properties dialog.

Figure 6-1: An example Interface Properties dialog.

· Click the OK button.

After you configure your Internet gateway, you need to tell Ubuntu where to search for host and domain names. The following section, "Host and domain names," describes that configuration process.

Host and domain names

By default, your Ubuntu computer automatically is named after your user account name when you install Ubuntu. You can change your computer name (the hostname) and also give your network a name (the domain name) by using the options found by clicking the General tab of the Network Settings dialog:

· When connecting to a home network using private IP addresses, you can use any hostname for your computer and any domain name for your Ubuntu computer.

· When connecting to a network you don't own, you should use the host and domain names given to you by the network administrator or system administrator.

If you want to change your Ubuntu computer's hostname and/or domain name, follow these steps:

1. From the GNOME menu bar, choose SystemAdministrationNetworking.

The Enter Your Password to Perform Administrative Tasks dialog opens (unless you've entered your password in the previous five minutes).

2. Type your password in the text box and click OK.

The Network Settings dialog, shown in Figure 6-1 , opens.

Figure 6-1: Setting your hostname and domain name.

· Click the General tab in the Network Settings window.

· If you need a specific name for your computer, type it in the Hostname text box.

· If you need a specific domain name for your LAN, type it in the Domain Name text box.

DNS

You don't need to know anything about the DNS protocol to use DNS, but the sidebar "Domain name service (DNS)" tells the story. You only need to specify one or two DNS servers when using static IP addresses.

Domain name service (DNS)

On LANs and the Internet, computers find each other by using numeric IP addresses. However, most humans can't easily use numeric IP addresses. So the Internet uses the domain name service (DNS) to convert numeric IP addresses to names.

For instance, if you want some light-hearted "news," you can enter www.theonion.com. Your computer checks the DNS server, finds the actual numeric IP address for the theOnion.com Web site (65.61.134.200), and uses that numeric IP address.

The following instructions are for configuring your Ubuntu computer to use one or two DNS servers:

1. Click the DNS Servers Add button.

2. Type a DNS server IP address in the text box.

3. If you want to add search domains, repeat these steps for each domain:

1. Click the Search Domains Add button.

2. Type a domain name in the text box.

Figure 6-1 shows an example Network Settings dialog filled in with two DNS servers and a search domain.

Figure 6-1: DNS servers and a search domain.

Search domains reduce the amount of typing you need to do when looking for DNS names. If you set a search domain to wiley.com, you only need to type in www when looking for www.wiley.com. You have to type both the hostname and domain name (called the fully qualified domain name, or FQDN) if you don't specify a search domain.

Finishing up: Activating the new settings

When you've finished making all the configuration changes to use a static IP address, you need to activate them. Follow these steps:

1. Click the Connections tab.

You see the original window shown in Figure 6-1 .

2. Click the Deactivate button.

Your network connection is closed.

3. Click the Activate button.

The Activating the Interface dialog opens while the changes are being made. Your network connection is restarted using all the changes you made.

4. Click the OK button.

The Network Settings window closes.

You can use this utility to make additional changes as desired.

You should set up a firewall to protect your Ubuntu computer after you've configured its networking. Chapter 10 describes how to build a firewall that will protect you from the bad guys on the Internet.

Private IP addresses and your LAN

Most consumer-level network switches and broadband cable and DSL modems use the private network address spaces when working with your LAN. IP addresses like 192.168.0.1 through 192.168.0.255, 192.168.1.1 through 192.168.1.255, and 10.0.0.0 through 10.0.0.255 can't be routed on the Internet and are referred to as private. Private IP addresses are an Internet design feature defined in RFC1918 (Request for Comments).

Private IP addresses are used for small home networks and small business networks because

· They can't be routed.

· They can't interfere with the Internet.

· They don't require authorization from anyone.

You can use private IP addresses for your LAN if you have a broadband modem or Ethernet switch that provides Network Address Translation (NAT). Almost all cable and DSL modems provide NAT, which makes nonrouteable IP addresses a perfect fit for home networks and small business networks.





All materials on the site are licensed Creative Commons Attribution-Sharealike 3.0 Unported CC BY-SA 3.0 & GNU Free Documentation License (GFDL)

If you are the copyright holder of any material contained on our site and intend to remove it, please contact our site administrator for approval.

© 2016-2024 All site design rights belong to S.Y.A.