Previous Section
 < Day Day Up > 
Next Section


Local Area Network Addressing

If you are setting up a DNS server for a local area network (LAN) that is not connected to the Internet, you should use a special set of IP numbers reserved for such local networks (also known as private networks or intranets). This is especially true if you are implementing IP masquerading, where only a gateway machine has an Internet address, and the others make use of that one address to connect to the Internet. For a class C IPv4 network (254 hosts or less), these are numbers that have the special network number 192.168, as used in these examples. If you are setting up a LAN, such as a small business or home network, you are free to use these numbers for your local machines. You can set up a private network, such as an intranet, using network cards such as Ethernet cards and Ethernet hubs, and then configure your machines with IP addresses starting from 192.168.0.1. The host segment can range from 1 to 254, where 255 is used for the broadcast address. If you have three machines on your home network, you can give them the addresses 192.168.0.1, 192.168.0.2, and 192.168.0.3. You can then set up domain name services for your network by running a DNS server on one of the machines. This machine becomes your network's DNS server. You can then give your machines fully qualified domain names and configure your DNS server to translate the names to their corresponding IP addresses. As shown in Figure 34-2, for example, you could give the machine 192.168.0.1 the name turtle.mytrek.com, and the machine 192.168.0.2 the name rabbit.mytrek.com. You can also implement Internet services on your network such as FTP, Web, and mail services by setting up servers for them on your machines. You can then configure your DNS server to let users access those services using fully qualified domain names. For example, for the mytrek.com network, the Web server could be accessed using the name www.mytrek.com. Instead of a Domain Name Service, you could have the /etc/hosts files in each machine contain the entire list of IP addresses and domain names for all the machines in your network. But for any changes, you would have to update each machine's /etc/hosts file.

Click To expand
Figure 34-2: DNS server and network

IPv4 Private Networks

IPv4 provides a range of private addresses for the three classes supported by IPv4. As you have seen, class C IPv4 network numbers that have the special network number 192.168. Numbers are also reserved for class A and class B non-Internet local networks. Table 34-1 lists these addresses. The possible addresses available span from 0 to 255 in the host segment of the address. For example, class B network addresses range from 172.16.0.0 to 172.16.255.255, giving you a total of 65,534 possible hosts. The class C network ranges from 192.168.0.0 to 192.168.255.255, giving you 254 possible subnetworks, each with 254 possible hosts. The number 127.0.0.0 is reserved for a system's loopback interface, which allows it to communicate with itself, as it enables users on the same system to send messages to each other.

These numbers were originally designed for class-based addressing. However, they can just as easily be used for Classless Interdomain Routing (CIDR) addressing, where you can create subnetworks with a smaller number of hosts. For example, the 254 hosts addressed in a class C network could be split into two subnetworks, each with 125 hosts. See Chapter 38 for more details.

Table 34-1: Non-Internet Private Network IP Addresses

Address

Networks

10.0.0.0

Class A network

172.16.0.0 to 172.31.255.255

Class B network

192.168.0.0

Class C network

127.0.0.0

Loopback network (for system self-communication)

IPv6 Private Networks

IPv6 supports private networks with site-local addresses that provide the same functionality of IPv4 private addresses. The site-local addresses have no public routing information. They cannot access the Internet. They are restricted to the site they are used on. The site-local addresses use only three fields: a format prefix, subnet identifier, and interface identifier. A site-level address has the format prefix fec0. If you have no subnets, it will be set to 0. This will give you a network prefix of fec0:0:0:0. You can drop the set of empty zeros to give you fec0::. The interface id field will hold the interface identification information, similar to the host ID information in IPv4.

fec0::           IPv6 site-local prefix


Previous Section
 < Day Day Up > 
Next Section
This HTML Help has been published using the chm2web software.