Home > Articles

This chapter is from the book

Managing the Linux Networking Configuration

Test Objective Covered:

  1. Manage Linux network interfaces.

With Linux file system security behind us, we're ready to move on to a discussion of basic Linux network configuration tasks. To pass the CLE certification, Novell expects you to know what the term eth0 means and how to do some simple tasks, such as assigning an IP address or subnet mask.

Linux Network Interfaces

If you're coming into the Linux arena from the Windows world, you're probably used to managing Windows network interfaces using the Control Panel, as shown in Figure 3.15.

Figure 3.15Figure 3.15 Managing network interfaces in Windows XP.

Notice that each interface is assigned a name, such as Local Area Connection 1, Local Area Connection 2, and so on.

Managing Linux network interfaces is a little bit different. Linux Ethernet interfaces are labeled eth0, eth1, eth2, and so on. Each network board installed in the system is assigned one of these labels.

Most modern PC systems use the Peripheral Component Interconnect (PCI) expansion bus to implement modular expansion boards. PCI slots are assigned a number beginning with 1, as shown in Figure 3.16.

Figure 3.16Figure 3.16 PCI slots.

By default, if you have only one network board in the system, it is assigned to eth0. If you have more than one network interface in the system, the board installed in the lowest numbered PCI slot is assigned to eth0. The board installed in the next lowest-numbered PCI slot is assigned to eth1, and so on.

This seems simple on the surface. It gets tricky, however, when your motherboard uses an integrated network board.

TIP

An integrated network board is one that is built into the motherboard hardware itself. There is no network board installed in an expansion slot. The motherboard provides an RJ-45 jack to plug in an Ethernet cable.

If you are using only one network interface and it is the integrated interface, it will be automatically assigned to eth0. If you use the integrated interface and a network board installed in an expansion slot, however, either one could be assigned to eth0.

Some motherboard manufacturers build their boards such that an integrated device, such as a network board, will be assigned a lower slot number than one installed in a PCI expansion slot. I've encountered many systems where the built-in network adapter was assigned a very high number, whereas the first PCI expansion slot was assigned the number 1.

If you encounter this situation, you can manually swap eth0 and eth1 between interfaces. I've found it much easier (and faster), however, to simply swap the cables plugged into the RJ-45 jacks on the two interfaces.

About Network Boards

Not too long ago, administering a network server required that you be familiar with a number of different varieties of network boards in a variety of expansion bus types. In the mid-1990s, some of the more popular network standards included Ethernet, Token Ring, and Arcnet. You also had to know how to configure network boards in 8- and 16-bit ISA, 16- and 32-bit MCA, EISA, and VLB expansion busses.

Today, the choices are much less confusing. Nearly all network boards are 32-bit PCI boards. On a high-end server system, you may encounter a 64-bit PCI board. Nearly all the systems you use will probably use one of these two types of boards.

Occasionally, you may run into a Communications Networking Riser (CNR) network board. These are tiny little network boards. They are rarely implemented in server systems.

The good news is that most of the systems you work with will probably only have a single network interface. Most of the administration tasks you will need to perform will be with eth0.

There's also one other interface to be aware of that is present in all Linux systems, even those that don't have a network board installed: lo. The lo interface is the localhost loopback interface. It is usually assigned an IP address of 127.0.0.1.

This interface always points back to the host system. Many Linux applications and services require lo to be present to function.

Managing Linux Network Interfaces with ifconfig

When you install your Linux system, you are given the opportunity to configure various parameters for your network interfaces, such as IP address, subnet mask, and default gateway. At some point, you will probably need to modify this configuration.

This can be done with the ifconfig command. ifconfig is a very powerful command. It can be used to assign IP addresses, modify subnet masks, and perform many other tasks.

It can also be used to view the current networking configuration. If you enter ifconfig at a shell prompt on a Linux system, it displays detailed information about each network interface installed in the system. This output is displayed in Figure 3.17.

Figure 3.17Figure 3.17 Output from the ifconfig command.

TIP

The ifconfig command can only be run by the root user.

Notice in Figure 3.17 that this particular SUSE Linux system has two interfaces installed: eth0 and lo. The eth0 interface is an Ethernet interface with the parameters listed in Table 3.1.

Network Parameters

Parameter

Value

Board MAC Address

00:0C:29:E0:02:D5

IP Address

192.168.1.26

Subnet Mask

255.255.255.0

Ethernet Collisions Detected

0

Board Interrupt

10

Board I/O Address

0x10e0


The ifconfig utility can also be used to configure a Linux network interface. The general syntax is as follows:

For example, if you wanted to see only the current settings for the eth0 interface, you could enter ifconfig eth0. Some of the more useful parameters (and the ones you need to know for the CLE certification) include the ones shown in Table 3.2.

ifconfig Parameters

Parameter

Function

Example

ip_address

Assigns an IP address to the specified interface. (You don't need to include the text "ip_address" in the command, as shown in the example to the right.)

ifconfig eth0 10.0.1.30

netmask mask

Assigns a subnet mask to the specified interface.

ifconfig eth0 netmask 255.0.0.0

down

Disables the specified interface.

ifconfig eth1 down

up

Enables the specified interface (if it was previously disabled).

ifconfig eth1 up


Configuring Linux Network Interfaces in YaST

If using the command line gives you a case of the hives, never fear. You can also configure your Linux network interfaces in a graphical X Windows system environment using YaST.

To run YaST, select Applications, SUSE Menu, System, YaST2 from within GNOME. You can also run the program by opening a terminal session, changing to the root user using the su – command, and then entering yast2 at the shell prompt.

CAUTION

If you aren't authenticated as root, you will be asked to provide the root user's password before YaST will start.

If you run YaST from within GNOME, the screen shown in Figure 3.18 appears.

Figure 3.18Figure 3.18 The YaST Control Center.

From within YaST, select Network/Basic and then select Network Card Configuration. The screen shown in Figure 3.19 is displayed.

Figure 3.19Figure 3.19 The YaST Network cards configuration screen.

If you've just installed a new network board in the system, the unconfigured device will be displayed in the Network cards to configure field under Available are. To configure it, select Configure, and you will be presented with a series of screens that guide you through the process of assigning an IP address, subnet mask, default gateway address, and DNS server address to the interface.

If you need to modify the parameters assigned to an existing interface, select Change under the Already configured devices field. When you do, the screen shown in Figure 3.20 is displayed.

Figure 3.20Figure 3.20 Modifying an existing interface in YaST.

Notice that each of your interfaces is listed. The system shown in Figure 3.20 has only one network board, so only eth0 is listed.

Identify the interface you want to modify and select it. Then select Edit. When you do, the screen shown in Figure 3.21 appears.

Figure 3.21Figure 3.21 Modifying the network address in YaST.

If you want your system to be assigned an IP address dynamically from a DHCP server, mark Automatic address setup (via DHCP).

CAUTION

If you intend to install Novell Nterprise Linux Services on your Linux server, you should not use a dynamic IP address. Many of the NNLS components require that you use a static IP address assignment.

If you intend to use a static IP address assignment, mark Static address setup. Then enter an IP address and subnet mask in the respective fields.

At this point, you must decide if you need to configure a DNS server address and a default router. If you are using a static IP address assignment, you should configure these parameters.

Sometimes, the default router is also referred to as the default gateway, gateway router, or just router.

If you are using a dynamic address assignment obtained from a DHCP server, you may or may not need to configure these addresses. Check to see if your DHCP server is configured with the appropriate DHCP options to deliver these parameters automatically. If so, you don't need to configure these parameters.

However, sometimes a given DHCP server isn't configured to deliver these addresses. If your DHCP server is in this category, you will need to manually configure these parameters.

TIP

Most network administrators will configure their DHCP servers to deliver the DNS server and default router addresses automatically. It doesn't make much sense to deliver an IP address without these other two critical parameters.

To configure the host name of the system and the DNS server address, click Host name and name server. When you do, the screen shown in Figure 3.22 appears.

Figure 3.22Figure 3.22 Modifying the DNS server address in YaST.

In the Host Name field, enter the host name for your Linux system. In the Domain Name field, enter your organization's domain.

In the Name server fields, enter the IP addresses of your organization's primary, secondary (optional), and tertiary (optional) DNS servers; then click Next.

To configure the default router instead, click Routing. When you do, the screen shown in Figure 3.23 appears.

Figure 3.23Figure 3.23 Modifying the default gateway address in YaST.

In the Default gateway field, enter the default gateway IP address for your network and then click Next.

NOTE

You'll notice that there are several other parameters in this screen. A full discussion of these is beyond the scope of this book. For more information, see the Linux Network Administrator's Guide at http://www.tldp.org/LDP/nag2/index.html.

When you're satisfied with the configuration settings you've configured for the network interface, click Next and then click Finish. At this point, the interface will be disabled and the changes you configured applied. As this happens, the screen shown in Figure 3.24 is displayed.

Figure 3.24Figure 3.24 Implementing configuration changes in YaST.

When the changes have been applied, the interface will be brought back up. A nice feature of Linux is the fact that you don't need to reboot the system after making these types of changes. If you've ever used an older version of Windows, you know that these operating systems require a full reboot for even a minor change to the networking configuration.

NOTE

Later versions of Windows, such as Windows 2000 and XP, don't require you to reboot the system after making changes to the networking configuration.

You can now close the YaST Control Center by selecting Close.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020