Linux offers DHCP full Raiders
Author: netbull OSO Oso
Set DHCP
Setting DHCP below Linux is not complicated, all of you have to do only one file: /etc/dhcpd.conf.
Below, I use my own setup file to say how to modify this file:
DEFAULT-Lease-Time 259200;
Max-Lease-Time 777600;
Option Domain-name "Siyongc";
These lines I put on the beginning of the document. The first and second lines I defined the preset period and the highest period of the rental, the value was calculated in seconds, which is 'three days' and 'nine days'.
Then I specified the domain name used by the network.
Next is:
Subnet 192.168.0.0 Netmask 255.255.255.0 {
Range 192.168.0.21 192.168.0.30;
Range 192.168.0.121 192.168.0.230;
Option Broadcast-Address 192.168.0.255;
Option Routers 192.168.0.17;
Option Domain-Name-Servers 192.168.0.17, 203.56.8.1;
}
Subnet 203.30.35.128 Netmask 255.255.255.224 {
Range 203.30.35.140 203.30.35.157;
Option Broadcast-Address 203.30.35.159;
Option routers 203.30.35.134
Option Domain-Name-Servers 203.30.35.134 203.56.8.1;
}
Here, I have two network cards to provide DHCP services to two networks, respectively. In the first network (192.168.0.0) I specified two Scope, which is used to assign DHCP IP range: 192.168.0.21 to 192.168.0.30 and 192.168.0.121 to 192.168.0.230. In addition, I also specified the 'Broadcast Address',' Router Address' and 'DNS' Address'.
The second network because NETMASKs were used in 27 Bit, so the NET ID is: 203.30.35.128, and the broadcast address is: 203.30.35.159.
Finally, I also set this sentence:
Host PII266 {
Hardware Ethernet 48: 54: E8: 27: 75: 77;
Fixed-Address 192.168.0.15;
}
As we know, get the IP client machine through DHCP, if its lease has expired, so good may lose the original IP. However, I think my PII266 this host will always use a fixed IP address. The above sentence is for this purpose. First, I have to find the interface type and hardware address connected to my network on the PII266 machine, that is,: Ethernet 48: 54: E8: 27: 75: 77, then I use 'Fixed-Address' to 192.168. 0.15 This IP is not assigned to PII266 within DHCP Scopes.
If you refer to the settings I set up on this file, be sure to pay attention to each punctuation, some numbers are separated by ',', and some use the space bar to separate; and each sentence must be used; 'Do the end (The same as Perl Script), otherwise, the following line will be considered a continuation of the line, but will not be a new one.
When this /etc/dhcpd.conf file is set, you have to create a blank file for /tc/dhcp.Leases with the following command:
Touch /etc/dhcp.Leases
Note: You don't try to modify this file yourself, if this file has problems, remove or rename it, and then create it with the touch command.