Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Linux+ Certification Bible.pdf
Скачиваний:
46
Добавлен:
15.03.2015
Размер:
3.78 Mб
Скачать

Chapter 7 Configuring Networking 213

Figure 7-6: The Host Name and IP Configuration Screen

IP addressing

The network configuration program allows you to configure all network cards in the system; this is important if you plan to use the system to connect two LAN segments or to filter or route traffic. TCP/IP requires all stations participating in the LAN or WAN to have an IP address. IP addresses are logical numbers, such as street addresses or phone numbers, which are broken into four groups or octets. These four groups of numbers are usually separated by periods (for example, 192.168.0.101). Octets are really representations of the binary numbers. In fact, the binary numbers are just zeros and ones that create all the numbers used in an IP address. An IP address is a 32-bit number — thus, 4 sets of 8 binary numbers — that must be unique to one and only one piece of equipment attached to the network. Using binary math, or by just multiplying 2 × 2 × 2 × 2 × 2 × 2 × 2 × 2=256, you arrive at 256 total available numbers (starting with 0 and ending with 255). Therefore, the range of the numbering system available for IP addresses is 0 to 255.

IP addresses originate from the Internet Assigned Numbers Authority (IANA). (see www.iana.org/ for more information). These addresses are assigned to Internet Service Providers (ISP), who then distribute them to customers. Since duplication of IP addresses on a network is a serious problem, the network administrator should be consulted before randomly assigning IP addresses to servers and other IP devices. A system usually contains only one NIC or adapter, but you may experience some situations in which you use several NICs, such as routing and other specialized

214 Part III Configuration

servers. Thus, the only NIC is usually listed as adaptor 1. You can verify this; in Figure 7-6, for example, notice that in the listing next to Net device, adapter 1 has a net device but adapter 2 does not. Manual IP addressing is selected if the administrator can provide a static address. The address should then be entered into the IP address field. If the network is using dynamic IP addressing, as in this example, the administrator is managing a DHCP (Dynamic Host Configuration Protocol) server which is providing IP addresses, so the DHCP option should be selected. You can also select bootp, which is an older type of dynamic addressing system.

DHCP

The Dynamic Host Configuration Protocol (DHCP) is used to automate the task of assigning IP addresses to network devices. Client computers (and other IP devices) can be configured to request an IP address, and other necessary IP settings, from a DHCP server upon entering the network. DHCP servers are configured with a range, or pool, of IP addresses to manage. A Linux system can also be set up to be a DHCP server.

Using the DHCP protocol, client devices send out a broadcast asking for a local DHCP server. Although this is always a local network broadcast, routers can be configured to forward DHCP requests to other network segments. When a DHCP server receives a request, and it has unassigned addresses, it offers one from its address pool to the client. The client then accepts the address and any other information the DHCP server is configured to provide. Most of the time this additional information will be the address of the default gateway and DNS servers. The DHCP server will also set a Time To Live (TTL) value for this lease. The client PC must renew the IP address before the TTL expires or it will need to obtain new IP information from a DHCP server in order to remain on the network. Lease renewals are requested when half of the TTL time has past up to the time that the TTL has expired.

Netmask

An IP address actually contains two pieces of information. The first part of the address identifies a specific network and the second part identifies a specific host, or device, on that network. The only way to determine what part of the IP address is the network portion and which is the host portion is to use a netmask. The netmask is added to the IP address in a binary mathematical process, which creates a new 32-bit number. The point at which this result differs from the added value of the netmask identifies the network side of the IP address. By manipulating the netmask value, an ISP or private network administrator can create numerous “sub” networks from a single IP address class. This specifically allows ISPs to better utilize the shrinking number of available public IP addresses. Advanced discussions of IP addressing and subnetting is beyond the scope of this book — although you will find many books dedicated to just this subject.

Chapter 7 Configuring Networking 215

Hardware resources

The next items to configure in the networking menu are the network card device, kernel module, I/O (input/output) port, and IRQ (interrupt request). I/O and IRQ are optional because they already indicate the resources of the hardware network device being used.

3.13 Load, remove, and edit list modules (e.g., insmod, rmmod, lsmod, modprobe)

Many network cards are loaded by Linux as a kernel module, meaning that it runs right out of the kernel itself. The following commands are useful in manipulating network card modules:

insmod — Inserts a module into the kernel. For example, if you need to load a 3Com network driver into the kernel for your system, you would use the command, insmod 3c90x

rmmod — This command removes a module from the kernel

lsmod — This lists the modules that are currently loaded into the kernel

modprobe — An advanced command that allows you to automatically load modules using a prepared list stored in a file

DNS

The Domain Name System (DNS) translates a user-friendly domain name, such as www.linux.org, into an IP address. By setting DNS servers in your network client, you are telling the client which DNS server to go to when looking up address names. There is a primary and secondary server, because if the first server is not working when you look up an address, the client will go to the secondary to try the operation.

DNS configuration is illustrated in Figure 7-7.

Routing and gateways

This network configuration section allows you to set your default gateway and routing tables. Typically, for most end user systems, you will only need to set your default gateway, which should be your primary router on your network. More advanced server configurations may need static routes set to different networks. Figure 7-8 shows the information that you are presented when you select routing and gateways.

216 Part III Configuration

Figure 7-7: The Resolver Configuration (DNS) Screen

Figure 7-8: The Routing and Gateway Configuration Screen

Соседние файлы в предмете Операционные системы