
Configuring a DHCP/NAT Server
Most Linux distributions propose a DHCP server called dhcpd.
The configuration of the DHCP server just requires the creation of a dhcpd.conf
configuration file which will be placed in the directory.
Here is an example of dhcpd.conf file:
subnet 10.0.0.0 netmask 255.255.255.0 {
range 10.0.0.2 10.0.0.50;
option routers 10.0.0.1;
option domain-name-servers 10.0.0.60;
default-lease-time 1000
max-lease-time 3600
}
•
Subnet is used for defining the network address used by IP addresses.
•
Netmask defines the subnet mask.
•
Range defines the address range given by the dhcpd server.
•
Option routers defines the IP address of the default gateway.
•
Option domain-name-servers defines the DNS address.
•
Default-lease-time defines the default lease time, in this case 1,000 seconds.
•
Max-lease-time defines the maximum lease time.
The dhcpd server can be started whenever the Internet gateway is switched on
by entering the following line:
# dhcpd eth0
where eth0 is the Ethernet interface connected to the gateway.
Configuring a DHCP Client Under Linux 269
Figure 11.17 Internet access with confidentiality between computers
Komentarze do niniejszej Instrukcji