• No results found

Connecting to a wired network

In document Linux Mint Essentials (Page 191-197)

With most computers, Mint handles networking pretty much flawlessly. When an Ethernet cable is inserted, it will most likely automatically configure itself using DHCP (Dynamic Host Configuration Protocol), and then you'll immediately see other computers on your network, and you can also access the Internet. However, perhaps, you'd like to set your own address or have a bit more control than just letting Mint do the work for you. In some cases, you may run into an issue where your machine includes a network interface card (NIC) that's not immediately recognized, causing you to need to do some configuration before your machine is up and running.

In general, drivers for NICs are built into the Linux kernel. This is both a good thing and a bad thing. The good thing is that quite a few NIC drivers are included by default; there is no need for you to configure anything. However, in other cases, your NIC may not be included. This happens most often when you use a computer that is newer than the date on which your kernel was released. For example, if you have a computer with a Broadwell chipset, but you're using a version of Mint that was published before Broadwell was released, there are chances that your integrated network card will not be supported. We'll talk a bit more about troubleshooting later in this chapter.

As a rule of thumb, you should always download a Linux distribution that was released around the same time or a distribution that is new compared to the manufacturing date of your PC or NIC. For example, if you download a Linux distribution that features the 3.2 kernel (which was released in January, 2012) you're likely to run into problems with hardware support if you use a computer manufactured in 2013 or 2014. In most cases, this may mean issues with your NIC, wireless card, or video card. With this in mind, using a release of Mint closer to or newer than the manufacturing date of your computer is the best approach.

With a recent release of your distribution, in our case, Linux Mint, it's a very rare occurrence that your networking hardware is not recognized. When you plug in an Ethernet cable, you should see the following icon on the panel near the clock that looks like two cables connected together:

If all goes well, the automatic configuration will suffice. Once the Ethernet cable is connected, DHCP will assign the computer an IP address, and away it goes. If you would like to set more advanced settings, such as a static address, you'll need to open your network connections settings to edit them. To do so, click on the icon mentioned earlier on your panel and then click on Network Settings to see a list of the connections stored for your system. The following screenshot shows the settings dialog for network connections stored on the system:

By default, when you first open the tool, you'll most likely see a list of wireless networks or a wired network if your system doesn't contain a wireless card. To edit your wired connection, first click on Wired on the left pane, then click on the Options... button in the bottom-right corner of the window. A new window will appear that will allow you to fine-tune your wired connection. For example, if you click on the IPv4 Settings tab, you'll be able to set a static IP address by selecting Manual from the dropdown instead of the default Automatic (DHCP) option.

[ 178 ]

With DHCP, configuration is much easier, as your computer will contact your local DHCP server (which, in most cases, would be a home office router), request an address, and then configure itself. The problem with DHCP addressing is that an IP address can and will expire, and these are subject to change. If you would like to predictably contact your computer on the network via a specific and dedicated IP address, setting a static address is the key.

A complete set of instructions on networking is beyond the scope

of this book. However, a brief look at configuring a static address

follows in the next section.

Setting up a static IP

If you prefer your system to be reachable on your network via the same IP address each time, a static IP lease or static IP assignment is recommended. The two terms may sound the same, but the difference comes with who assigns the address. For example, a static lease, also known as a DHCP reservation, is where you configure your router to assign the same IP address to your machine each time. This is by far the easiest way to go, but unfortunately, most small office and home office routers do not feature an option to do this. If your router doesn't have an option to set a static lease (reservation), read on to discover how to change Mint's connection from DHCP to static and set the address manually.

First, you'll need to access your network settings. To do this, click on the network icon located near the clock in your system tray and then click on Network Settings. From there, a new window titled Networking will appear. On this screen, you'll be able to edit the advanced options for your wired and wireless connections, such as the IP address in this example. To edit an IP address of a wired interface, click on the Wired section on the left-hand side pane and then on the Options... button in the lower-right corner of the screen. This will bring up yet another window, Editing Wired connection 1. If you click on the IPv4 Settings tab, as shown in the following screenshot, you'll be able to edit your IP address:

If you're a beginner, you may not want to edit the automatically created connection. Instead, create a new one. This way, if you make a mistake, you can delete the connection you created and go back to the original connection that is known to be working.

Now that you're here, what settings should you provide to create your static connection? While there is no basic rule of thumb, as every network is different, there are a few key rules to keep in mind. As you probably already know, assigning the same IP address to two devices would cause conflict. Therefore, you should ensure that the address you assign is not in use. Most routers start assigning IP addresses beginning with a specific number. For example, perhaps your router exists at 192.168.1.1, and the first IP address it assigns is 192.168.1.100. Considering this IP address, as long as you haven't manually configured any other devices, you should be safe to use anything in between 192.168.1.2 and 192.168.1.99. For the other values, the DNS servers and Gateway is most likely your router, so you can use your router's IP address for both. Search domains is most likely the name of your network; you may or may not have set this.

[ 180 ]

If you are not sure of what your values are, rather than just assuming that your router is both your gateway and DNS server, the nm-tool command will tell you what the IP address is for your DNS server as well as your Gateway address. If you're unsure of which IP addresses are in use within your network, consider logging in to your router's configuration page. Most home and small office routers feature a configuration page that will allow you to see a list of all the connected devices. The following screenshot shows the output of the nm-tool command:

Once you have all the variables you need, you're ready to set a static IP address. On the Editing Wired connection window, which appeared earlier, choose Manual from the Method dropdown. Underneath Addresses, click on Add to add an IP address, Netmask, and Gateway address. After you click on Save, the connection will be changed to the values you provided. If you need to switch back to DHCP in the future, navigate back to Network Settings and change the dropdown accordingly.

Connecting to a wireless network

Like wired networking, the ability to utilize a wireless card in Mint depends on whether drivers are included in the version of the kernel that ships with your release. Wireless support is fairly good in Linux, but a few vendors are more problematic than the others. Thankfully, Linux Mint has gone to great lengths to support as many wireless cards as possible. There's a good chance that yours will be supported as well.

The icon mentioned earlier for wired connections (located near your clock in the system tray) is also used for wireless connections. If you click on this icon, you should see your local wireless connection listed in the pop-up menu that appears. The following screenshot shows the network connection menu available from the panel, showing an available wireless connection:

To connect to a network, simply click on it. If a password is required, it will prompt you to enter it. Once you enter the correct password, you should see a message that says you're connected. From this point on, you'll automatically connect to that network whenever you're in range of it.

You can set up a static IP address for a wireless network as well, should you need to do so. The way to do it is exactly as mentioned in the previous section, though you'll edit your connection underneath the

Wireless menu, instead of the connection under the Wired menu.

If, for some reason, you don't see your wireless network available in the list, the first thing you should check is whether or not your wireless card is enabled. Especially with laptops, it's far too easy to accidentally nudge the hardware switch that

enables/disables wireless communication (if you have such a switch). Some laptops have a keyboard key designated to control wireless access; it is very easy to press this key by mistake. Some laptops have the wireless toggle switch on one of their edges. This switch can often catch on the way in and out of a bag.

If you're sure your wireless card is turned on and you still don't see your network listed, your wireless card may not be supported by default. It's possible that Mint's Driver Manager may have a driver available for your card. If so, install it and you should be good to go after a reboot. If the Driver Manager doesn't have what you

[ 182 ]

In a nutshell, manually troubleshooting the inability to use your network card is done by first identifying the model of the card and then conducting a Google search for clues. This may seem like a silly approach, but it's surprisingly effective. If you have a problem with your hardware, it's unlikely that you would be the first person to encounter a problem. A typical Google search for Linux compatibility with specific hardware may include results from someone who has already solved the problem. To find your model number, execute the following command:

lscpci | grep Net

The output of this command will look similar to the following command:

00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 04)

03:00.0 Network controller: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] (rev 34)

In the preceding example output, you see two network cards: the first is the wired card, and the second is the wireless card. We know this because of the Advanced-N designation in the output. The model number of the wired card in this example machine is Intel 82579LM and that of the wireless card is Intel 6205. Therefore, we can conduct a Google search with key terms such as Intel 6205 Linux support or 82579LM Linux Support to look for results that may point to clues. As mentioned earlier, if you're using a recently released version of Mint, you most likely won't experience issues.

In document Linux Mint Essentials (Page 191-197)