Every TCP/IP host (to be more correct, interface) belongs to a ”local” network. A ”local” network is specified by two components. The first component is the network address, and the second component is the netmask.
The network address is a 32-bit number. However, not all 32 bits are used to specify the network. Some of the bits are reserved for hosts in the network. The netmask is used to separate the portion that specifies the network versus the portion that specifies a host in the network.
Although the network address is a 32-bit number, it is usually specified by four octets. This is because a 32-bit number expressed as a decimal number is very difficult to read. For example, the network address of the Power server is 165.196.78.0 (in quad-octets). In binary, this is 101001011100010001001110000000002. The netmask is 255.255.255.0 (in binary, 1111111111111111111111111000000002). A ‘1’ in a netmask (in binary representation) is a part of the network address, whereas a ‘0’ in the netmask is a part of a host address.
This means a host has 8 bits to distinguish itself from the other hosts of the same network. Two addresses are reserved: all 1’s in the host address and all 0’s in the host address. All 1’s in the host address is the ‘broadcast’ address, all 0’s in the host address is the network address. As a result, even though there are 256 possible host addresses, only 254 are available for hosts.
If the network address, netmask and host address are all configured correct, a host should be able to communicate with other hosts in the network.
The most important command for this job is ifconfig. First, run the command without any arguments:
/sbin/ifconfig
|
It should display information about all the interfaces. If you do not find your network interface (most likely eth0). Don’t panic. We’ll can do this step-by-step. You need to have root privileges to do this.
These commands manually sets the interface to a specific address and netmask. At this point, the host should be able to communicate with other hosts of the same network. Of course, this may be difficult to test without knowing how the other hosts are set up.
It is usually okay to rely on ping to check communication with another host.