I have recently worked on a dhcp server, multiple network segments, and several option options. After successful deployment, I will post my configurations and share them with you. For more information, please advise.
The dhcpd configuration files of the Red Hat system including fedora are usually/etc/dhcpd. conf, and the lease file is usually/var/lib/dhcpd. leases
Start the command/etc/init. d/dhcpd restart or service dhcpd restart. I will not talk about the basic things. You can read books or search for documents online. The following is my/etc/dhcpd. conf configuration:
[Root @ zeyark] # more/etc/dhcpd. conf
# DHCP Server Configuration file.
# See/usr/share/doc/dhcp */dhcpd. conf. sample
Ddns-update-style interim; # ddns-update-style (none | interim | ad-hoc): defines the supported DNS dynamic update types, this parameter # is required and must be placed in the first line and can only be used in global configuration.
Allow client-updates; # allow/ignore clients to update DNS records
Option classless-static-routes code 121 = array of unsigned integer 8; # define routes based on option 121 RFC 3442)
Set vendor-string = option vendor-class-identifier; # enable to see the device ID option 60 in the lease file)
Shared-network DHCPnet {# define a DHCP network for wide-area sharing
Subnet 192.168.1.0 netmask 255.255.255.0 {}# this subnet is the subnet where the IP address of the NIC where you enable the dhcpd service is located, for example, your server goes online # the IP address configured for the card is 192.168.1.121 mask 24,192.168 .1.0 and the network address of this subnet # If you do not have the IP address, an error will occur when starting the DHCP service, I do not know the network segment subnet 192.168.1.0 # netmask 255.255.255.0 {}. This is actually the network segment of your server NIC address # dividing subnets to become subnets). Please study it on your own. I will not talk about it here.
Option domain-name "zeyark.net"; # define a domain name
Option domain-name-servers 192.168.1.65; # address of the domain name Server
Default-lease-time 86400; # default lease time
Max-lease-time 172800; # maximum lease time
Subnet 172.255.0.0 netmask 255.255.255.0 {# define a multi-subnet address pool. This is one of
Option routers 172.20.0.1; # subnet address pool gateway when an IP address is issued
Option subnet-mask subnet mask 255.255.0; # subnet mask of the address pool
Option broadcast-address 172.20.0.255; # broadcast address of the address pool
Option classless-static-routes 24,192,168, 0, 172,20, 52,114, # option121, which indicates that the method is abnormal for 96,172, 20, 29,59, 52,114,120,172, 20, 24,192,168; # Where 192,168, 0, 24 is the mask, 0, is the network segment
} # Note: it is a comma, not a dot. That's what I'm talking about.
Subnet 172.11.0.0 netmask 255.255.255.0 {# define another address pool
Range 172.11.0.2 172.11.0.127;
Option routers 172.11.0.1;
Option subnet-mask limit 255.0;
Option broadcast-address 172.11.0.255;
Option classless-static-routes 24,192,168, 0, 172,11,
52,114, 96,172, 52,114,120,172;
}
Subnet 172.21.0.0 netmask 255.255.255.0 {# define another address pool
Range 172.21.0.2 172.21.0.127;
Option routers 172.21.0.1;
Option subnet-mask limit 255.0;
Option broadcast-address 172.21.0.255;
Option classless-static-routes 24,192,168, 0, 172,21,
52,114, 96,172, 52,114,120,172;
}
Subnet 172.16.11.0 netmask 255.255.255.0 {# define another address pool
Class "foo "{
Match if substring (option vendor-class-identifier, 0, 31) = "H3C. H3C ICG2000, \" dslforum.org \"";
} # Define a class and issue an IP address according to the device ID, that is, the legendary option 60
Pool {# define a pool to allow devices of the class "foo" to obtain the address of range #172.16.11.2 172.16.11.127;
Allow members of "foo ";
Range 172.16.11.2 172.16.11.127;
}
Pool {# define a pool to prohibit devices of the class "foo" from obtaining the address in range #172.16.11.128 172.16.11.254.
Deny members of "foo ";
Range 172.16.11.128 172.16.11.254;
}
Option routers 172.16.11.1;
Option subnet-mask limit 255.0;
Option broadcast-address 172.16.11.255;
Option classless-static-routes 24,192,168, 0, 172,16, 11,1,
52,114, 96,172, 52,114,120,172;
}
}