Monday, February 20, 2012
Dhcp configuration file Example
Example Subnet
Declaration
subnet
192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.254;
option subnet-mask 255.255.255.0;
option domain-search "example.com";
option domain-name-servers 192.168.1.1;
option time-offset -18000; # Eastern Standard Time
range 192.168.1.10 192.168.1.100;
}
To
configure a DHCP server that leases a dynamic IP address to a system within a
subnet, modify “Range Parameter” with
your values. It declares a default lease time, maximum lease time, and network configuration values for the clients. This example assigns
IP addresses in the
Range
Parameter
default-lease-time
600;
max-lease-time
7200;
option
subnet-mask 255.255.255.0;
option
broadcast-address 192.168.1.255;
option
routers 192.168.1.254;
option
domain-name-servers 192.168.1.1, 192.168.1.2;
option
domain-search "example.com";
subnet
192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
}
Note
that the optional parameter
Static
IP Address using DHCP
host
apex {
option host-name "apex.example.com";
hardware ethernet 00:A0:78:8E:9E:AA;
fixed-address 192.168.1.4;
}
All subnets that share the same physical network should be declared within a
Shared-network
Declaration
shared-network
name {
option domain-search "test.redhat.com";
option domain-name-servers ns1.redhat.com, ns2.redhat.com;
option routers 192.168.0.254;
more parameters for EXAMPLE shared-network
subnet 192.168.1.0 netmask 255.255.252.0 {
parameters for subnet
range 192.168.1.1 192.168.1.254;
}
subnet 192.168.2.0 netmask 255.255.252.0 {
parameters for subnet
range 192.168.2.1 192.168.2.254;
}
}
As demonstrated in "Group Declaration", the
Group
Declaration
group
{
option routers 192.168.1.254;
option subnet-mask 255.255.255.0;
option domain-search "example.com";
option domain-name-servers 192.168.1.1;
option time-offset -18000; # Eastern Standard Time
host apex {
option host-name
"apex.example.com";
hardware ethernet 00:A0:78:8E:9E:AA;
fixed-address 192.168.1.4;
}
host raleigh {
option host-name
"raleigh.example.com";
hardware ethernet 00:A1:DD:74:C3:F2;
fixed-address 192.168.1.6;
}
Subscribe to:
Post Comments (Atom)