Red Hat [Electronic resources] : The Complete Reference Enterprise Linux Fedora Edition؛ The Complete Reference نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Red Hat [Electronic resources] : The Complete Reference Enterprise Linux Fedora Edition؛ The Complete Reference - نسخه متنی

Richard L. Petersen

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید








TCP/IP Configuration Files



A set of configuration files in the /etc directory, shown in Table 38-7, are used to set up and manage your TCP/IP network. These configuration files specify such network information as host and domain names, IP addresses, and interface options. The IP addresses and domain names of other Internet hosts you want to access are entered in these files. If you configured your network during installation, you can already find that information in these files.




























































Table 38-7: TCP/IP Configuration Addresses and Files


Address


Description


Host address


IP address of your system; it has a network part to identify the network you are on and a host part to identify your own system


Network address


IP address of your network


Broadcast address


IP address for sending messages to all hosts on your network at once


Gateway address


IP address of your gateway system, if you have one (usually the network part of your host IP address with the host part set to 1)


Domain name server addresses


IP addresses of domain name servers your network uses


Netmask


Used to determine the network and host parts of your IP address


Files


Description


/etc/hosts


Associates hostnames with IP addresses, lists domain names for remote hosts with their IP addresses


/etc/sysconfig/network-scripts


Network connection configurations


/etc/host.conf


Lists resolver options


/etc/nsswitch.conf


Name Switch Service configuration


/etc/resolv.conf


Lists domain name server names, IP addresses (nameserver), and domain names where remote hosts may be located (search)


/etc/protocols


Lists protocols available on your system


/etc/services


Lists available network services, such as FTP and Telnet, and the ports they use


/etc/sysconfig/networking


Holds network configuration files managed by redhat-config-network


/etc/sysconfig/network


Network configuration information



Identifying Hostnames: /etc/hosts


Without the unique IP address the TCP/IP network uses to identify computers, a particular computer cannot be located. Because IP addresses are difficult to use or remember, domain names are used instead. For each IP address, a domain name exists. When you use a domain name to reference a computer on the network, your system translates it into its associated IP address. This address can then be used by your network to locate that computer.

Originally, every computer on the network was responsible for maintaining a list of the hostnames and their IP addresses. This list is still kept in the /etc/hosts file. When you use a domain name, your system looks up its IP address in the hosts file. The system administrator is responsible for maintaining this list. Because of the explosive growth of the Internet and the development of more and more large networks, the responsibility for associating domain names and IP addresses has been taken over by domain name servers. The hosts file is still used to hold the domain names and IP addresses of frequently accessed hosts, however. Your system normally checks your hosts file for the IP address of a domain name before taking the added step of accessing a name server.

The format of a domain name entry in the hosts file is the IP address followed by the domain name, separated by a space. You can then add aliases for the hostname. After the entry, on the same line, you can enter a comment. A comment is always preceded by a

# symbol. You can already find an entry in your hosts file for localhost with the IP address 127.0.0.1. localhost is a special identification used by your computer to enable users on your system to communicate locally with each other. The IP address 127.0.0.1 is a special reserved address used by every computer for this purpose. It identifies what is technically referred to as a loopback device. A sample /etc/hosts file is shown here.

/etc/hosts







127.0.0.1 turtle.mytrek.com localhost
192.168.0.1 turtle.mytrek.com
192.168.0.2 rabbit.mytrek.com
192.168.34.56 pango1.mytrain.com












/etc/resolv.conf


As noted in Chapter 34, the /etc/resolv.conf file holds the IP addresses for your DNS servers along with domains to search. A DNS entry will begin with the term nameserver followed by the name server's IP address. A search entry will list network domain addresses. Check this file to see if your network DNS servers have been correctly listed.

/etc/resolv.conf







search mytrek.com mytrain.com
nameserver 192.168.0.1
nameserver 192.168.0.3












/etc/sysconfig/network-scripts


The /etc/sysconfig/network-scripts directory holds configuration information for different network connection devices such the IP address and network address used. For a detailed discussion see the section "Network Interfaces and Routes" later in this chapter.


/etc/sysconfig/networking


The /etc/sysconfig/networking directory holds configuration information set up with redhat-config-network (Network on System Settings menu and window). These file should not be edited manually. The profiles directory holds configurations for the different profiles you set up. Different profile directories will include the hosts file listing host domain names and IP addresses, the network file holding your system's host name, and the resolv.conf file, which contains your domain name servers. The device configuration file for the connection you use for that profile will also be listing, such as ifcfg-eth0 for the first Ethernet device. These are all configurations that may change depending on the profile you use. For example, at the office you may use an Ethernet connection on a company network with its own DNS servers, whereas at home you may use a modem connection to an ISP with its own Internet DNS servers. Your hostname and domain name may vary depending on the networks your different profiles connect to.


/etc/services


The /etc/services file lists network services available on your system, such as FTP and Telnet, and associates each with a particular port. Here, you can find out what port your Web server is checking or what port is used for your FTP server. You can give a service an alias, which you specify after the port number. You can then reference the service using the alias.


/etc/protocols


The /etc/protocols file lists the TCP/IP protocols currently supported by your system.


/etc/sysconfig/network


The /etc/sysconfig/network file contains system definitions for your network configuration. These include definitions for your domain name, gateway, and hostname, as shown here:

NETWORKING=yes
HOSTNAME=turtle.mytrek.com
GATEWAY=192.168.0.1


/ 328