DHCP installation 1
1: first install dhcp-3.0.5-18.el5 package
2: After installation, run the rpm-qc dhcp command to view the configuration documents.
3: Find the/etc/dhcpd. conf file and edit it.
4: Use the vim editor to edit vim/etc/dhcpd. conf.
This article is empty when you enter it, but you can see a comment (# see/usr/share/doc/dhcp */dhcpd. conf. sample) indicates: see/usr/share/doc/dhcp */dhcpd. conf. sample
5: Refer to/usr/share/doc/dhcp */dhcpd in the previous step. conf. sample document, in vim etc/dhcpd. run the following command in conf: r/usr/share/doc/dhcp */dhcpd. conf. sample to read the content in this document
6. modify the current/etc/dhcpd. conf file.
1 #
2 # DHCP Server Configuration file.
3 # see/usr/share/doc/dhcp */dhcpd. conf. sample
4 #
5 ddns-update-style interim;
6 ignore client-updates;
7 option domain-name-servers 222.88.88.88, 222.85.85.85; (super-scope DNS server)
8 subnet 192.168.60.0 netmask 255.255.255.0 {(a common scope network segment, subnet mask)
9
10 # --- default gateway
11 option routers 192.168.60.254; (GATEWAY)
12 option subnet-mask limit 255.0; (subnet mask)
13
14 option nis-domain "domain.org ";
15 option domain-name "test"; (scope name)
16 filename "pxelinux.0 ";
17 option time-offset-18000; # Eastern Standard Time
18 # option ntp-servers 192.168.1.1;
19 # option netbios-name-servers 192.168.1.1;
20 # --- Selects point-to-point node (default is hybrid). Don't change this unless
21 # -- you understand Netbios very well
22 # option netbios-node-type 2;
23
24 range dynamic-bootp 192.168.60.1 192.168.60.10;
25 default-lease-time 21600;
26 max-lease-time 43200;
27
28 # we want the nameserver to appear at a fixed address
29 # host AAA {
30 # next-server marvin.redhat.com;
31 # hardware ethernet 00: 0C: 29: 68: 2F: 9D;
32 # fixed-address 192.168.60.2;
33 #}
34}
35 subnet 192.168.70.0 netmask 255.255.255.0 {
36
37 # --- default gateway
38 option routers 192.168.70.254;
39 option subnet-mask limit 255.0;
40
41 option nis-domain "domain.org ";
42 option domain-name "test1 ";
43 filename "pxelinux.0 ";
44 option time-offset-18000; # Eastern Standard Time
45 # option ntp-servers 192.168.1.1;
46 # option netbios-name-servers 192.168.1.1;
47 # --- Selects point-to-point node (default is hybrid). Don't change this unless
48 # -- you understand Netbios very well
49 # option netbios-node-type 2;
50
51 range dynamic-bootp 192.168.70.1 192.168.70.10;
52 default-lease-time 21600;
53 max-lease-time 43200;
54
55 # we want the nameserver to appear at a fixed address
56 # host AAA {
57 # next-server marvin.redhat.com;
58 # hardware ethernet 00: 0C: 29: 68: 2F: 9D;
59 # fixed-address 192.168.60.2;
60 #}
61}
62 subnet 192.168.10.0 netmask 255.255.255.0 {(62-63 this is an empty scope, mainly to match the IP address of the host)
63}
# Indicates the annotation part.
This is the dhcp configuration on my machine. Some modifications need to be made in it. Here I have made two scopes: one with the IP address range 192.168.60.0 and the other with the IP address range 192.168.70.0, you can also make them into a super scope, but you need to add a command.
Add a line "shared-network AAA (super-scope name) {" to the end of row 7th, then write a line "}" in the last line, and finally save and exit wq.
Author: "Fools note"