Chapter 1
In This Chapter
Finding out what a network is and why you might want one
Setting up the network hardware
Configuring network system preferences
Troubleshooting your network
In the not-so-distant past — I’m talking a generation ago — networks were found only in huge companies that had the money and the workforce to pay for and maintain them. But now, as technology rolls on, a home or small office network is both affordable and relatively easy to create.
Networks can be used for many things. Computers exchange all types of data over a network: files that you want to send between computers or to networked printers, streaming audio or video, data for multiplayer computer games, or even a private company website (typically called an intranet). Anything you can imagine that would involve moving data between multiple computers can be done by using a network.
In this chapter, I introduce you to what networks are, what you can do with them, and how to set up a small Mac-based network of your own for your home or small business.
In a nutshell, a network is a combination of hardware, cables, and software that allows computers, printers, and other devices to talk with one another. (Heck, you don’t even need cables with a wireless network, as I show you in Chapter 3 of this minibook.) To build a wired network, you need the right hardware and software. Some of the hardware and all the software you need probably came with your Mac, depending on which Mac you have. As you progress through this chapter, you discover everything that’s required to set up your network so you can pick up any additional parts you need. Any good-sized computer store (either the brick-and-mortar or online variety) has everything you need to get up and running.
Now, back to the requirements: You need the right hardware and software to make your wired network sing. This section covers each component with a description about the role that each part plays on the network and other good stuff you want to know to get your network right the first time.
Okay, this might be obvious, but I’m nothing if not thorough. The first thing that you need to build a network is … well, stuff! That’s right — you need to have devices that you want to network. Most times these are computers (whether Macs or other PCs running Windows, Linux, or Unix), printers, cell phones, iOS devices (such as the iPad, iPhone, and iPod touch), and other stand-alone, network-capable devices (such as file servers and shared backup drives).
A network interface card (NIC) is a hardware device that your computer uses to talk to the rest of the network. The NIC connects to the network cabling, and it speaks the language of electronics, sending data around the network. Nowadays, most networks use the Ethernet networking protocol, and most NICs are Ethernet-compatible. All Yosemite–compatible Mac models have Ethernet NIC hardware built right onto the Mac’s main system board. Note: The MacBook Air and the MacBook Pro with Retina display offer only wireless hardware built in, but you can add a wired Ethernet port to either model using an external USB or Thunderbolt adapter.
So you have an assortment of devices in your home or small office that you decide to network. How do you make them all interconnect? You could connect just two computers by using nothing more than a single Ethernet cable. But to connect more than two computers, you need fancier hardware: namely, a switch. The switch is used to connect everything, so it’s the focal point of the network. No switch, no network.
Time for a quick hardware introduction: A port is like an Ethernet NIC on your computer. A switch is really just a small box that has a bunch of Ethernet ports on it. Inside, all those Ethernet ports are arranged so the talking (sending) wires from each port connect to the listening (receiving) wires on all other ports. Therefore, when one computer talks, all others listen.
Setting up a switch (and therefore giving birth to your network, which sounds more painful than it is) is usually no more difficult than connecting a power cable to the device and plugging in your computers with their own Ethernet cables. You see various lights on the box — usually a power light indicating that the switch is powered on and operational. You also see lights that correspond to each port on the switch; these lights tell you what’s going on in the box. For instance, you normally see the following types of lights:
Cables are the ties that bind … literally. Cables are used to connect the Ethernet port on each computer to the switch, the central hardware of the network. With a little experience, you’ll be a cable-wielding superhero with hundreds of feet of cable draped across every piece of furniture in your place for your first LAN party. (A LAN party, by the way, is when way too many techies bring their computers into a small space, connect them, and play games for 48 hours straight. Oh, and we eat a lot, too. Good stuff!)
Here’s the scoop on what kind of cables to use. Technically, you can run 100 Mbps Ethernet over Cat-5 cable (like a super-version of the wire that you use for your telephones).
Hey, did I mention that you can eschew cables entirely? For more information on the lean, mean (but significantly slower) world of wireless networking, see Chapter 3 of this minibook.
After you collect the hardware components I list earlier in this chapter, you’re ready to connect things. Here’s a quick list of things to do to get your network fired up:
To keep costs down, try to place the switch in a location close to a centrally located power outlet so you use the least amount of cable. If cost isn’t an issue, hide the unit in a closet and just run all the cables along the walls to the hub or switch. And if cost really isn’t an issue, get your house fully wired with Cat-5e or Cat-6 cable.
Some switches come on automatically when you plug them in and can never be turned off. Others have a power switch that you need to turn on the first time that you plug them in.
Until you have computers or printers attached to it, the switch might just have a status light that shows that the switch is powered on. But if the lights on your unit don’t match up with what the manual says, you could have a bum unit that you need to return.
You should see a link light or speed light come on that verifies that the two devices sense each other. (And, depending on the Mac, you might also have a link light on the NIC where you plug in the cable.)
Congratulations! You’re a network technician! (Don’t forget to call your friends and brag.) The first phase of the network, the physical connection, is complete; the next step is the configuration of OS X.
Take a deep breath; there’s no need to panic — configuring your network software basically involves entering lots of numbers and other stuff in dialogs. (Most folks can just allow Yosemite to take care of network settings automatically.) But just so that you’ll understand what’s involved, this section explains what those numbers are, what they do, and why you ought to know what they do.
First things first: TCP/IP stands for Transmission Control Protocol/Internet Protocol. Second, a protocol is just the techno-nerd word for a set of rules or a language that computers use to communicate. Without protocols, the computers on your network would never be able to speak to one another even though you have NICs, cables, and a hub or a switch. The Internet Protocol (IP) part of the TCP/IP suite is what you’re really interested in because it’s the most important part of your network configuration chore.
IP addresses are like street addresses for computers on a network. Each computer on the network has an IP address, and this address needs to be unique because no other computer can share it. When a computer wants to communicate with another computer, it can simply send the data on the network in a nice package that has its address as well as the address of the computer that it’s trying to talk to. (Remember frames? If not, take a refresher in the earlier section “Switch.”)
An IP address is just a number, but it’s written in a strange way. (Go figure.) All IP addresses are currently written as four sets of numerals between 0 and 255 with a dot (period) between each set. For instance, a common IP address that you might run into is 192.168.0.1. As everyone knows, engineers can’t sleep unless they have three or four ways to write the same thing, including IP addresses. The form shown here — which is by far the most common — is dotted notation. Each number, such as 192, is an octet.
One important thing to keep in mind is that the Almighty IP Address Police — Internet Assigned Numbers Authority (IANA; www.iana.org) — has broken IP addresses into groups. The two main types of IP addresses are public and private:
You’ll almost always get a public IP address from your Internet service provider (ISP), whether you’re using a cable modem, digital subscriber line (DSL), or a regular dial-up modem. If you use a cable/DSL router or Yosemite’s built-in sharing software to share your Internet connection among multiple computers, you’ll be using private IP addresses on your network while using a single public IP address to talk to the Internet. (More on that in Chapter 4 of this minibook.)
“Great! I get an IP address, put it into my Network settings in System Preferences, and off I go. Right?” Well, you’re close, but here are a few other pieces of information that you might need before you can go surfing around the world:
After you have the hardware in place and you’ve chosen and configured a protocol to allow the computers to all talk to one another, you need software to make use of your new network connections. Time for more good news: Lots of the software you need to move data on your network is included already in OS X! Here are brief descriptions of some of the network software and protocols already built in to OS X and what they’re used for:
In this section, I show you how to configure your Mac to communicate with other computers on a local network.
Leave it to Yosemite to provide you with assistance — in this case, when you first open the Network pane, you might be greeted with a dialog offering you assistance on setting up the stuff I cover in this section. (Whether you get this absolutely free offer of aid depends on whether you upgraded your Mac from a previous version of OS X or whether you entered your network and Internet settings in the Yosemite Setup Assistant.) If you do decide to allow the Yosemite Internet/Network Assistant to guide you through your network setup, I’ll meet back up with you at the next section. (Note that you can also start the assistant manually at any time by clicking the Assist Me button at the bottom of the Network pane.)
Now I’d like to introduce you to a very dear friend of mine — an abbreviation that you will soon grow to love, as does everyone else who’s set up a small Mac network. Dynamic Host Configuration Protocol (DHCP) enables a computer to automatically get all the information that I’ve talked about to this point. (Check in your Webster’s … this protocol is the very definition of the word godsend.)
You’re saying, “Mark, there’s gotta be a catch, right?” Well, here’s the bad news: Before you can use DHCP, you have to add a DHCP server, which provides other computers on the network with their configuration settings. Here’s the good news: Most Internet connection-sharing hardware devices (and software-sharing implementations as well) provide a DHCP server as part of the price of admission. (Internet connection sharing allows all your networked computers to access the Internet through a single Internet connection. I cover it more in Chapter 4 of this minibook.) Most wired and wireless routers can provide DHCP services these days. Technology marches on.
If you plan to use Internet connection sharing or you know that you have a DHCP server on your network, you can set up your Mac to automatically obtain the required IP address and information by following these steps:
OS X contacts the DHCP server to obtain an IP address, a subnet mask, a gateway router IP address, and a Domain Name System (DNS) address. (DNS servers convert a human-friendly address, such as www.yahoo.com, to a computer-friendly IP address, such as 66.218.71.86.)
A few seconds after clicking the Apply button, you should see the information, as provided by the DHCP server, which lets you know that the process worked and configuration is complete. You might also notice that the DNS Server information is empty (or dimmed). Fear not: OS X is really using DNS information provided by the DHCP server. Press +Q to quit System Preferences and save your settings.
You say you don’t have a DHCP server, and you need to manually assign IP addresses? Oh, rapture — this configuration requires you to manually configure the TCP/IP properties. Keep in mind that for now, you are concerned not with the Internet — just with computers on the local network.
A result of being on a local network — because it’s not connected to the Internet, it’s also called a private network — is that you must use IP addresses that are reserved for private network use. Down to business: You can use a few different ranges of IP addresses, but I recommend that you use IP addresses in the 192.168.x.x range. What does this mean exactly? Well, here’s the scoop:
Octet numbers are conjoined by periods.
It doesn’t matter which one you choose, as long as you use this same third number on all computers on your network.
Make sure that every computer on your local network has a different fourth octet number. This is important — your network won’t work otherwise.
For instance, suppose you’re using three computers on your network. All the IP addresses that you use will start with 192.168. Next, suppose you choose 123 for the third octet. (Remember that you can choose any number between 1 and 254.) Finally, for the fourth octet, choose the numbers 100, 105, and 110 for the three computers, respectively. (Again, you can choose any numbers between 1 and 254.) Here are the resulting IP addresses used on the three computers:
After you know the IP addresses and the subnet mask that you’re going to use, start setting up each computer. Being a nice guy, I walk you through the process of configuring OS X with the 192.168.0.106 address as an example.
Be sure that you have all the physical portion of your network powered up and connected as I outline in the earlier section, “Setting Up Your Network.”
The Network pane appears.
Figure 1-1 shows how things should look at this point.
Your new network settings take effect.
Repeat this procedure with the other IP addresses for each of the other Macs that are connected to your network.
After you have your Macs connected and your TCP/IP configuration is done, check to make sure that everything is working. After you have at least two computers on your network, each with a TCP/IP address, you can use a simple little utility called ping to test the connection.
The ping application is a simple but extremely helpful utility that’s the first connectivity-testing tool out of the box, even for network professionals. When you use the ping utility — referred to as pinging something — the application sends a small packet of data to whatever destination you’re trying to reach. When the receiving computer hears the ping, it answers with a ping reply. If the original computer receives the ping reply, you know that the connection between the computers is good.
To ping a computer, you use a little application built in to OS X called Network Utility, which allows you to work various network wonders (including checking connectivity, watching the route that your computer takes to get to another computer, and looking up information about Internet domain names). To use Network Utility to check network connectivity, follow these steps:
Five or ten pings are plenty to see whether the connection is working.
Your Mac sends ping packets to the IP address that you entered.
If your ping is unsuccessful, you see nothing, at least for a little bit. Each ping that you send takes two seconds before it’s considered missing in action. So, if you choose five pings, wait ten seconds before you see the results. After all the pings time out — a ping times out when it doesn’t get returned in the proper amount of time — you see a line of text appear that reads ping: sendto: No route to host or 100% packet loss. Both error messages mean the same thing: All the ping packets that you sent out are now in the packet graveyard, never to be seen again. As you’ve likely guessed already, this is not A Good Sign for your network connectivity. Look to the following section, “Troubleshooting Your New Network,” to find out where to begin troubleshooting this problem.
After you have your computers configured and you’ve verified connectivity among them, start doing the fun stuff that a network allows you to do, such as sharing data, printing, and (most important) playing games with users on other computers.
After a network is set up and operating, it rarely has problems. Still, Murphy sometimes takes charge, and the darn thing just won’t work right. When you do have problems with the network, I recommend using a standard, consistent approach to finding and fixing the problem. This section breaks down troubleshooting into two areas:
Although many things on a network can go bad or cause problems, network problems are typically caused by faulty equipment or wiring. Sometimes it’s something as simple as a cable not being plugged in snugly. Looking at the physical cables, connections, and equipment is always the best place to start looking for problems. The following steps will help you check physical things that can cause network problems:
Check the end that plugs into the computer first — and then check the end that connects to the switch.
Check the port on the switch to see whether the link or speed light is lit. (Depending on the switch that you have, you might not have a link light. Many switches use a speed light to indicate a link. Check the manufacturer’s manual for your model.) If your computer is on and connected but no link or speed light is lit, try replacing the network cable.
Choose one of the other computers connected to the switch that works, unplug it, and plug the broken computer into that port for testing. Occasionally, a single port on a switch goes bad; if that happens, just mark it as bad and don’t use it anymore. But if all computers connected to the switch stop working, it’s probably the switch that’s gone south. If the switch is still under warranty, I recommend getting it fixed or replaced. If the warranty has expired, it’s usually more cost-effective to replace a switch than fix it.
If other computers work fine on that switch, the NIC inside your computer has possibly gone bad.
If you reach this determination, call your local service center to have it looked at and repaired. If you have an older model on which the NIC was added instead of built in, you can simply replace the NIC yourself.
After checking the hardware, look for problems in the network settings. When using TCP/IP on your network, look for these specific things: the TCP/IP configuration mode, IP address, subnet mask, and router IP address (if you’re using a router to connect to the Internet or other networks). To check these settings, open System Preferences and click the Network icon to bring up the Network pane. Click the Ethernet entry in the list and then follow these steps:
This step checks the router and DNS settings.