DHCP server: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(51 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
''' | '''Configure DHCP server on RHEL7''' | ||
yum install dhcp | yum install dhcp | ||
Config file ''/etc/dhcp/dhcpd.conf'' should looks like this: | |||
# | |||
# DHCP Server Configuration file. | |||
# see /usr/share/doc/dhcp*/dhcpd.conf.example | |||
# see dhcpd.conf(5) man page | |||
# | |||
subnet 192.168.10.0 netmask 255.255.255.0 { | subnet 192.168.10.0 netmask 255.255.255.0 { | ||
option domain-name "clontest.com jlab.org"; | |||
option domain-name-servers 192.168.10.1; | |||
option routers 192.168.10.1; | |||
use-host-decl-names true; | |||
pool { | pool { | ||
range 192.168.10.2 192.168.10.20; | range 192.168.10.2 192.168.10.20; | ||
Line 68: | Line 21: | ||
} | } | ||
} | } | ||
set vendorclass = option vendor-class-identifier; | set vendorclass = option vendor-class-identifier; | ||
option pxe-system-type code 93 = unsigned integer 16; | option pxe-system-type code 93 = unsigned integer 16; | ||
set pxetype = option pxe-system-type; | set pxetype = option pxe-system-type; | ||
# DISKLESS Clients in here | # DISKLESS Clients in here | ||
group | group | ||
Line 84: | Line 37: | ||
} | } | ||
next-server 192.168.10.1; | next-server 192.168.10.1; | ||
host test5 { | |||
host | |||
hardware ethernet 00:20:38:10:14:f7; | hardware ethernet 00:20:38:10:14:f7; | ||
fixed-address 192.168.10.5; | fixed-address 192.168.10.5; | ||
} | } | ||
host test6 { | |||
hardware ethernet 00:20:38:0A:07:D7; | |||
fixed-address 192.168.10.6; | |||
} | |||
host test7 { | |||
hardware ethernet 00:20:38:0F:2C:0D; | |||
fixed-address 192.168.10.7; | |||
} | |||
} # Diskless clients group | } # Diskless clients group | ||
Enable and start service: | |||
systemctl enable dhcpd | |||
systemctl start dhcpd | systemctl start dhcpd | ||
Check service status, fix errors if any: | |||
systemctl status dhcpd | |||
Check | |||
Latest revision as of 15:23, 15 May 2025
Configure DHCP server on RHEL7
yum install dhcp
Config file /etc/dhcp/dhcpd.conf should looks like this:
# # DHCP Server Configuration file. # see /usr/share/doc/dhcp*/dhcpd.conf.example # see dhcpd.conf(5) man page # subnet 192.168.10.0 netmask 255.255.255.0 { option domain-name "clontest.com jlab.org"; option domain-name-servers 192.168.10.1; option routers 192.168.10.1; use-host-decl-names true; pool { range 192.168.10.2 192.168.10.20; deny dynamic bootp clients; allow unknown clients; } } set vendorclass = option vendor-class-identifier; option pxe-system-type code 93 = unsigned integer 16; set pxetype = option pxe-system-type; # DISKLESS Clients in here group { if substring(vendorclass, 0, 9)="PXEClient" { if pxetype=00:06 or pxetype=00:07 { filename "efi/boot/grub2/x86_64-efi/core.efi"; } else { filename "linux-install/pxelinux.0"; } } next-server 192.168.10.1; host test5 { hardware ethernet 00:20:38:10:14:f7; fixed-address 192.168.10.5; } host test6 { hardware ethernet 00:20:38:0A:07:D7; fixed-address 192.168.10.6; } host test7 { hardware ethernet 00:20:38:0F:2C:0D; fixed-address 192.168.10.7; } } # Diskless clients group
Enable and start service:
systemctl enable dhcpd systemctl start dhcpd
Check service status, fix errors if any:
systemctl status dhcpd