By completing this chapter, you will be able to do the following things:
Connecting a host to a local area network
Configure host name (hosthttp://www.aliyun.com/zixun/aggregation/11696.html ">name")
Configure IP addresses
Configuring default Routes
To configure a host as a DNS client
Use ping and nslookup to test network connectivity
Setting the IP address and subnet mask
What is the IP address?
Every machine in the LAN, whether it is a laser printer, workstation, or a server, needs to be assigned a unique internet protocal (IP) address. Each packet that passes through the network contains a destination address that is used to determine the target of the packet and the routing information that is required to reach the target.
An IP address consists of four integers within 1-255, separated by dots.
Examples of IP addresses:
125.67.12.43
15.34.67.9
212.1.1.34
Your network administrator or ISP should assign you an IP address, and if you have more than one NIC on your machine, you may even need to assign multiple IP addresses.
What is a subnet mask?
Companies with large networks now separate the networks into multiple subnets. Separating larger networks into smaller "subnets" can greatly improve the performance and reliability of the network. If your company's network is divided into subnets, your network administrator will assign a "subnet mask" to you. By using the subnet mask and IP address, you can determine which subnet you belong to, and uniquely determine your IP address in the subnet. In order to communicate with other nodes in the LAN, you must define a subnet mask for your machine.
Examples of subnet masks:
255.255.0.0
255.255.255.0
255.255.254.0
Setting the IP address and subnet mask
Each UNIX has its own tools to set the IP address and subnet mask, and here's an example of HP-UX:
When you connect your host to the LAN, your ISP or network administrator assigns a unique IP address to your host. You may also be assigned a subnet mask. When you first start your system, the Set_parms tool automatically prompts you to enter an IP address and several other network parameters. You can also use Set_parms to modify network parameters at any time:
# set_parms Initial