Hardware Reference
In-Depth Information
You can use this approach to assign static IPv4 addresses to every machine on your network—simply make note
of which machine is given which number. However, this can become tiresome after a while, and many embedded
devices don't allow such control over the configuration. Either case requires you to upgrade to DHCP.
DHCP stands for Dynamic Host Configuration Protocol and is a way of configuring the networking facilities of
each client machine on the network. The software comes in two parts, a client and a server. The client says simply,
“I'm a machine; where is the network?” by transmitting a message onto the cable for all machines to hear. The server
listens for any and all of these messages and responds by returning all the configuration data that the sender should
use for networking, such as its IPv4 address, domain name, and so on.
Configuring a DHCP client in Linux is easy and involves replacing the earlier section of the
/etc/network/interfaces file with the following:
auto eth1
iface eth1 inet dhcp
Creating a DHCP server takes a little more work but can often be avoided as many network routers include one,
although it's sometimes disabled by default.
To prepare one in Linux, you should first install the DHCP server software with a command such as this:
apt-get install dhcp3-server
You can then edit the /etc/dhcpd.conf file to assign addresses to each machine. Prior to editing, you may need
to run this:
ln -s /etc/dhcp3/dhcpd.conf /etc/dhcpd.conf
ln -s /usr/sbin/dhcpd3 /usr/sbin/dhcpd
The addresses of each machine can be assigned by following these steps:
1.
Giving it the next free number in a series, say 100-254. These are pooled addresses.
2.
Looking at the MAC address of the network card that sent the message (all MACs are
unique) and giving it a specific address based on that number.
3.
Doing any combination of 1 and 2.
Because these pooled addresses are finite in number, they are never given to a machine. Instead, they are leased ,
and the DHCP client of each machine must rerequest the address if it's still using it after a certain amount of time.
The software does this automatically behind the scenes. If you have a lot of visitors to your home (who'd rather use the
Internet than talk with you!), then leasing addresses is the simplest way to go because each friend wouldn't need to
have a static address that would require configuration.
Pooled addresses are configured like this:
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.1;
range 192.168.1.5 192.168.1.115;
}
Otherwise, the number of machines in your house is probably limited, so static addresses add very little work
and make it quicker to troubleshoot since you know in advance what IP each computer should have. A typical
configuration would appear like this:
host teddyspc {
hardware ethernet 00:A1:68:8E:9E:AA;
fixed-address 192.168.1.4;
}
Search WWH ::




Custom Search