CONTENT
  • CHANGES
Szukaj
counter

#top Konfiguracja


O ile nie zdefiniowano inaczej wszystkie poniższe opcje dotyczą pliku konfiguracyjnego dhcpd.conf dostępnego standardowo w lokalizacji /etc/dhcp/dhcpd.conf (lub /etc/dhcpd/dhcpd.conf).

#top include


Dokumentacja DHCPd: REFERENCE: DECLARATIONS
Składnia include "filename";
Opis: The include statement
The include statement is used to read in a named file, and process the contents of that file as though it were entered in place of the include statement.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/dhcpd.conf:
# dhcpd eth0 and eth1 moved
#include "/etc/dhcpd/eth0-dhcpd.conf";
#include "/etc/dhcpd/eth1-dhcpd.conf";
include "/etc/dhcpd/virbr1-dhcpd.conf";
include "/etc/dhcpd/virbr2-dhcpd.conf";
include "/etc/dhcpd/virbr3-dhcpd.conf";
include "/etc/dhcpd/virbr4-dhcpd.conf";
include "/etc/dhcpd/virbr5-dhcpd.conf";

Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/virbr1-dhcpd.conf:
#
# virbr1-dhcpd.conf
#

subnet ... netmask ... {
	# hosts fixed address
	include "/etc/dhcpd/virbr1-hosts.conf";
}



#top Listen


Dokumentacja DHCPd: COMMAND LINE
Dokumentacja DHCPd: PORTS
Składnia (argumenty wiersza poleceń): dhcpd [...] [ if0 [ ...ifN ]]
Opis:
The names of the network interfaces on which dhcpd should listen for broadcasts may be specified on the command line. This should be done on systems where dhcpd is unable to identify non-broadcast interfaces, but should not be required on other systems. If no interface names are specified on the command line dhcpd will identify all network interfaces which are up, eliminating non-broadcast interfaces if possible, and listen for DHCP broadcasts on each interface.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/sysconfig/dhcpd:
# Define INTERFACES to limit which network interfaces dhcpd listens on.
# The default null value causes dhcpd to listen on all interfaces.
# INTERFACES=""
INTERFACES="virbr1 virbr2 virbr3 virbr4 virbr5"



#top ddns-updates


Dokumentacja DHCPd: REFERENCE: PARAMETERS
Składnia ddns-updates flag;
Opis: The ddns-updates statement
The ddns-updates parameter controls whether or not the server will attempt to do a DNS update when a lease is confirmed. Set this to off if the server should not attempt to do updates within a certain scope. The ddns-updates parameter is on by default. To disable DNS updates in all scopes, it is preferable to use the ddns-update-style statement, setting the style to none.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/dhcpd.conf:
# Use this to enble / disable dynamic dns updates globally.
ddns-updates on;



#top ddns-update-style


Dokumentacja DHCPd: REFERENCE: PARAMETERS
Składnia ddns-update-style style;
Opis: The ddns-update-style parameter
The style parameter must be one of ad-hoc, interim or none. The ddns-update-style statement is only meaningful in the outer scope - it is evaluated once after reading the dhcpd.conf file, rather than each time a client is assigned an IP address, so there is no way to use different DNS update styles for different clients. The default is none.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/dhcpd.conf:
# Use this to enble / disable dynamic dns updates globally.
#ddns-update-style none;
#ddns-update-style on;
ddns-update-style ad-hoc;



#top authoritative


Dokumentacja DHCPd: REFERENCE: PARAMETERS
Składnia authoritative;, not authoritative;,
Opis: The authoritative statement
The DHCP server will normally assume that the configuration information about a given network segment is not known to be correct and is not authoritative. This is so that if a naive user installs a DHCP server not fully understanding how to configure it, it does not send spurious DHCPNAK messages to clients that have obtained addresses from a legitimate DHCP server on the network.
Network administrators setting up authoritative DHCP servers for their networks should always write authoritative; at the top of their configuration file to indicate that the DHCP server should send DHCPNAK messages to misconfigured clients. If this is not done, clients will be unable to get a correct IP address after changing subnets until their old lease has expired, which could take quite a long time.
Usually, writing authoritative; at the top level of the file should be sufficient. However, if a DHCP server is to be set up so that it is aware of some networks for which it is authoritative and some networks for which it is not, it may be more appropriate to declare authority on a per-network-segment basis.
Note that the most specific scope for which the concept of authority makes any sense is the physical network segment - either a shared-network statement or a subnet statement that is not contained within a shared-network statement. It is not meaningful to specify that the server is authoritative for some subnets within a shared network, but not authoritative for others, nor is it meaningful to specify that the server is authoritative for some host declarations and not others.
The style parameter must be one of ad-hoc, interim or none. The ddns-update-style statement is only meaningful in the outer scope - it is evaluated once after reading the dhcpd.conf file, rather than each time a client is assigned an IP address, so there is no way to use different DNS update styles for different clients. The default is none.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/dhcpd.conf:
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;
authoritative;



#top subnet statement


Dokumentacja DHCPd: REFERENCE: DECLARATIONS
Składnia
subnet subnet-number netmask netmask {
[ parameters ]
[ declarations ]
}
Opis: The subnet statement
The subnet statement is used to provide dhcpd with enough information to tell whether or not an IP address is on that subnet. It may also be used to provide subnet-specific parameters and to specify what addresses may be dynamically allocated to clients booting on that subnet. Such addresses are specified using the range declaration.
The subnet-number should be an IP address or domain name which resolves to the subnet number of the subnet being described. The netmask should be an IP address or domain name which resolves to the subnet mask of the subnet being described. The subnet number, together with the netmask, are sufficient to determine whether any given IP address is on the specified subnet.
Although a netmask must be given with every subnet declaration, it is recommended that if there is any variance in subnet masks at a site, a subnet-mask option statement be used in each subnet declaration to set the desired subnet mask, since any subnet-mask option statement will override the subnet mask declared in the subnet statement.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/dhcpd.conf:
#
# virbr1-dhcpd.conf
#

subnet 10.41.0.0 netmask 255.255.0.0 {
[...]
}





#top option values


#top option routers


Dokumentacja DHCPd: SETTING OPTION VALUES USING EXPRESSIONS
Składnia option routers ip-address [, ip-address... ];
Opis:
The routers option specifies a list of IP addresses for routers on the client’s subnet. Routers should be listed in order of preference.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/virbr1-dhcpd.conf:
#
# virbr1-dhcpd.conf
#

subnet 10.41.0.0 netmask 255.255.0.0 {
[...]
	# default gateway
	option routers 10.41.0.250;
[...]
}



#top option subnet-mask


Dokumentacja DHCPd: SETTING OPTION VALUES USING EXPRESSIONS
Składnia option subnet-mask ip-address;
Opis:
The subnet mask option specifies the client’s subnet mask as per RFC 950. If no subnet mask option is provided anywhere in scope, as a last resort dhcpd will use the subnet mask from the subnet declaration for the network on which an address is being assigned. However, any subnet-mask option declaration that is in scope for the address being assigned will override the subnet mask specified in the subnet declaration.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/virbr1-dhcpd.conf:
#
# virbr1-dhcpd.conf
#

subnet 10.41.0.0 netmask 255.255.0.0 {
[...]
	# default gateway
	option subnet-mask 255.255.0.0;
[...]
}



#top option domain-name-servers


Dokumentacja DHCPd: SETTING OPTION VALUES USING EXPRESSIONS
Składnia option domain-name-servers ip-address [, ip-address... ];
Opis:
The domain-name-servers option specifies a list of Domain Name System (STD 13, RFC 1035) name servers available to the client. Servers should be listed in order of preference.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/virbr1-dhcpd.conf:
#
# virbr1-dhcpd.conf
#

subnet 10.41.0.0 netmask 255.255.0.0 {
[...]
	# domain options
	option domain-name-servers 10.5.5.5;
[...]
}



#top option domain-name


Dokumentacja DHCPd: SETTING OPTION VALUES USING EXPRESSIONS
Składnia option domain-name text;
Opis:
This option specifies the domain name that client should use when resolving hostnames via the Domain Name System.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/virbr1-dhcpd.conf:
#
# virbr1-dhcpd.conf
#

subnet 10.41.0.0 netmask 255.255.0.0 {
[...]
	# domain options
	option domain-name "xen.wbcd.pl";
[...]
}




Dokumentacja DHCPd: SETTING OPTION VALUES USING EXPRESSIONS
Składnia option domain-name-servers ip-address [, ip-address... ];
Opis:
The domain-name-servers option specifies a list of Domain Name System (STD 13, RFC 1035) name servers available to the client. Servers should be listed in order of preference.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/virbr1-dhcpd.conf:
#
# virbr1-dhcpd.conf
#

subnet 10.41.0.0 netmask 255.255.0.0 {
[...]
	# domain options
	option domain-search "xen.wbcd.pl";
[...]
}



#top option nis-domain


Dokumentacja DHCPd: SETTING OPTION VALUES USING EXPRESSIONS
Składnia option nis-domain text;
Opis:
This option specifies the name of the client's NIS (Sun Network Information Services) domain. The domain is formatted as a character string consisting of characters from the NVT ASCII character set.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/virbr1-dhcpd.conf:
#
# virbr1-dhcpd.conf
#

subnet 10.41.0.0 netmask 255.255.0.0 {
[...]
	# domain options
	option nis-domain  "xen.wbcd.pl";
[...]
}





#top declarations


#top default-lease-time


Dokumentacja DHCPd: REFERENCE: DECLARATIONS
Składnia default-lease-time time;
Opis: The default-lease-time statement
Time should be the length in seconds that will be assigned to a lease if the client requesting the lease does not ask for a specific expiration time. This is used for both DHCPv4 and DHCPv6 leases (it is also known as the "valid lifetime" in DHCPv6). The default is 43200 seconds.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/virbr1-dhcpd.conf:
#
# virbr1-dhcpd.conf
#

subnet 10.41.0.0 netmask 255.255.0.0 {
[...]
	default-lease-time  3600;   # 1 hour
[...]
}



#top max-lease-time


Dokumentacja DHCPd: REFERENCE: DECLARATIONS
Składnia max-lease-time time;
Opis: The max-lease-time statement
Time should be the maximum length in seconds that will be assigned to a lease. If not defined, the default maximum lease time is 86400. The only exception to this is that Dynamic BOOTP lease lengths, which are not specified by the client, are not limited by this maximum.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/virbr1-dhcpd.conf:
#
# virbr1-dhcpd.conf
#

subnet 10.41.0.0 netmask 255.255.0.0 {
[...]
	max-lease-time     14400;   # 4 hours
[...]
}



#top next-server


Dokumentacja DHCPd: REFERENCE: DECLARATIONS
Składnia next-server server-name;
Opis: The next-server statement
The next-server statement is used to specify the host address of the server from which the initial boot file (specified in the filename statement) is to be loaded. Server-name should be a numeric IP address or a domain name.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/virbr1-dhcpd.conf:
#
# virbr1-dhcpd.conf
#

subnet 10.41.0.0 netmask 255.255.0.0 {
[...]
	# Custom Option
	next-server 10.5.5.5; # TFTP
[...]
}



#top filename


Dokumentacja DHCPd: REFERENCE: DECLARATIONS
Składnia filename "filename";
Opis: The filename statement
The filename statement can be used to specify the name of the initial boot file which is to be loaded by a client. The filename should be a filename recognizable to whatever file transfer protocol the client can be expected to use to load the file.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/virbr1-dhcpd.conf:
#
# virbr1-dhcpd.conf
#

subnet 10.41.0.0 netmask 255.255.0.0 {
[...]
	# Custom Option
	filename "pxelinux.0";
[...]
}



#top range dynamic-bootp


Dokumentacja DHCPd: REFERENCE: DECLARATIONS
Składnia range [ dynamic-bootp ] low-address [ high-address];
Opis: The range statement
For any subnet on which addresses will be assigned dynamically, there must be at least one range statement. The range statement gives the lowest and highest IP addresses in a range. All IP addresses in the range should be in the subnet in which the range statement is declared. The dynamic-bootp flag may be specified if addresses in the specified range may be dynamically assigned to BOOTP clients as well as DHCP clients. When specifying a single address, high-address can be omitted.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/virbr1-dhcpd.conf:
#
# virbr1-dhcpd.conf
#

subnet 10.41.0.0 netmask 255.255.0.0 {
[...]
	 range dynamic-bootp 10.41.0.100 10.41.0.225;
[...]
}



#top host statement


Dokumentacja DHCPd: REFERENCE: DECLARATIONS
Składnia
host hostname {
[ parameters ]
[ declarations ]
}
Opis: The host statement
The host declaration provides a way for the DHCP server to identify a DHCP or BOOTP client. This allows the server to provide configuration information including fixed addresses or, in DHCPv6, fixed prefixes for a specific client.
If it is desirable to be able to boot a DHCP or BOOTP client on more than one subnet with fixed v4 addresses, more than one address may be specified in the fixed-address declaration, or more than one host statement may be specified matching the same client.
The fixed-address6 delcaration is used for v6 addresses. At this time it only works with a single address. For multiple addresses specify multiple host statements.
If client-specific boot parameters must change based on the network to which the client is attached, then multiple host declarations should be used. The host declarations will only match a client if one of their fixed-address statements is viable on the subnet (or shared network) where the client is attached. Conversely, for a host declaration to match a client being allocated a dynamic address, it must not have any fixed-address statements. You may therefore need a mixture of host declarations for any given client...some having fixed-address statements, others without.
hostname should be a name identifying the host. If a hostname option is not specified for the host, hostname is used.
Host declarations are matched to actual DHCP or BOOTP clients by matching the dhcp-client-identifier option specified in the host declaration to the one supplied by the client, or, if the host declaration or the client does not provide a dhcp-client-identifier option, by matching the hardware parameter in the host declaration to the network hardware address supplied by the client. BOOTP clients do not normally provide a dhcp-client-identifier, so the hardware address must be used for all clients that may boot using the BOOTP protocol.
DHCPv6 servers can use the host-identifier option parameter in the host declaration, and specify any option with a fixed value to identify hosts.
Please be aware that only the dhcp-client-identifier option and the hardware address can be used to match a host declaration, or the host-identifier option parameter for DHCPv6 servers. For example, it is not possible to match a host declaration to a host-name option. This is because the host-name option cannot be guaranteed to be unique for any given client, whereas both the hardware address and dhcp-client-identifier option are at least theoretically guaranteed to be unique to a given client.

Examples:
Zmiany jakie należy wprowadzić w pliku /etc/dhcpd/virbr1-hosts.conf:
host x1-cen05          { hardware ethernet 00:16:3e:01:00:50; fixed-address 10.41.0.50; option host-name "cen05.xen.wbcd.pl";         }
host x1-cen06-1        { hardware ethernet 00:16:3e:01:00:51; fixed-address 10.41.0.51; option host-name "cen06-1.xen.wbcd.pl";       }
host x1-cen06-2        { hardware ethernet 00:16:3e:01:00:52; fixed-address 10.41.0.52; option host-name "cen06-2.xen.wbcd.pl";       }
host x1-cen05x64       { hardware ethernet 00:16:3e:01:00:53; fixed-address 10.41.0.53; option host-name "cen05x64.xen.wbcd.pl";      }
host x1-cen05dev       { hardware ethernet 00:16:3e:01:00:54; fixed-address 10.41.0.54; option host-name "cen05dev.xen.wbcd.pl";      }
host x1-cen06dev       { hardware ethernet 00:16:3e:01:00:56; fixed-address 10.41.0.56; option host-name "cen06dev.xen.wbcd.pl";      }
host x1-cen06x64       { hardware ethernet 00:16:3e:01:00:58; fixed-address 10.41.0.58; option host-name "cen06x64.xen.wbcd.pl";      }
host x1-cen07x64       { hardware ethernet 00:16:3e:01:00:57; fixed-address 10.41.0.57; option host-name "cen07x64.xen.wbcd.pl";      }




















































Zmodyfikowany ostatnio: 2019/09/02 19:21:46 (4 lata temu), textsize: 21,8 kB, htmlsize: 33,0 kB

Zapraszam do komentowania, zgłaszania sugestii, propozycji, własnych przykładów, ...
Dodaj komentarzKomentarze użytkowników