Things are a little more complicated with real networks like Ethernets. If you want to connect your host to an existing network, you have to ask its administrators to give you an IP-address on this network. When setting up the network all by yourself, you have to assign IP-addresses yourself as described below.
Hosts within a local network should usually share addresses from the same logical IP-network. Hence you have to assign an IP-network address. If you have several physical networks, you either have to assign them different network numbers, or use sub-netting to split your IP-address range into several subnetworks.
If your network is not connected to the Internet, you are free to choose any (legal) network address. You only have to make sure to choose one from classes A, B, or C, else things will most likely not work properly. However, if you intend to get on the Internet in the near future, you should obtain an official IP-address now. The best way to proceed is to ask your network service provider to help you. If you want to obtain a network number just in case you might get on the Internet someday, request a Network Address Application Form from email@example.com.
To operate several Ethernets (or other networks, once a driver is available), you have to split your network into subnets. Note that sub-netting is required only if you have more than one broadcast network; point-to-point links don't count. For instance, if you have one Ethernet, and one or more SLIP links to the outside world, you don't need to subnet your network. The reason for this will be explained in chapter-.
As an example, the brewery's network manager applies to the NIC for a class B network number, and is given 22.214.171.124. To accommodate the two Ethernets, she decides to use eight bits of the host part as additional subnet bits. This leaves another eight bits for the host part, allowing for 254 hosts on each of the subnets. She then assigns subnet number 1 to the brewery, and gives the winery number 2. Their respective network addresses are thus 126.96.36.199 and 188.8.131.52. The subnet mask is 255.255.255.0.
vlager, which is the gateway between the two networks, is assigned a host number of 1 on both of them, which gives it the IP-addresses 184.108.40.206 and 220.127.116.11, respectively. Figure- shows the two subnets, and the gateway.
Note that in this example I am using a class B network to keep things simple; a class C network would be more realistic. With the new networking code, sub-netting is not limited to byte boundaries, so even a class C network may be split into several subnets. For instance, you could use 2 bits of the host part for the netmask, giving you four possible subnets with 64 hosts on each.