There was a need to configure the dhcp server on CentOS. There will be several computers on the network and an extension is possible. In general, you just need to configure the server so that it issues addresses from 192.168.1.10 to 192.168.1.254. - FAILED. Please either help with the config, or give a link to a clever guide.
1 answer
# dhcpd.conf## Π·Π°Π΄Π°Ρ DNS, ΡΡΠΎΠ± ΠΈΡ
ΠΏΡΠΎΠΏΠΈΡΠ°ΡΡ Π°Π²ΡΠΎΠΌΠ°ΡΠΎΠΌ ΠΊΠ»ΠΈΠ΅Π½ΡΠ°ΠΌoption domain-name-servers 87.237.112.10, 77.241.40.178;default-lease-time 3600;max-lease-time 86400;ddns-update-style none;# ΠΎΠΏΠΈΡΠ°Π½ΠΈΠ΅ ΠΏΠ΅ΡΠ²ΠΎΠΉ ΠΏΠΎΠ΄ΡΠ΅ΡΠΊΠΈ Ρ ΠΏΡΠ»ΠΎΠΌ Π΄ΠΈΠ½Π°ΠΌΠΈΡΠ΅ΡΠΊΠΈ ΡΠ°Π·Π΄Π°Π²Π°Π΅ΠΌΡΡ
Π°Π΄ΡΠ΅ΡΠΎΠ²# ΠΎΡ 192.168.55.140 Π΄ΠΎ .180subnet 192.168.55.0 netmask 255.255.255.0 {# interface vr0; range 192.168.55.140 192.168.55.180; option routers 192.168.55.1;}# Π°Π½Π°Π»ΠΎΠ³ΠΈΡΠ½ΠΎ Π΄Π»Ρ Π²ΡΠΎΡΠΎΠΉ ΠΏΠΎΠ΄ΡΠ΅ΡΠΊΠΈsubnet 192.168.1.0 netmask 255.255.255.0 {# interface xl0; range 192.168.1.140 192.168.1.180; option routers 192.168.1.1;}host one { hardware ethernet 00:1d:22:33:44:55; fixed-address 192.168.55.2;}host two { hardware ethernet 00:1d:33:44:55:66; fixed-address 192.168.55.3;}host wifirouter { hardware ethernet 00:1c:33:44:55:66; fixed-address 192.168.1.2; option routers 192.168.1.1;} The file is obtained from dhcpd.conf.sample by editing - deleting unnecessary and adding the necessary items.
PS file with FreeBSD with ISC dhcpd, but the principle is about the same everywhere.
PPS if at start you get
I tried to use all sorts of manuals from the network, but everything I received at the start was FAILED.
be sure to see the logs See there for sure
- or no configuration file,
- or it is incorrect (it is easy to omit the semicolon or the closing brace).
- Well, or the problem is something else, but it will be described.
Logs search somewhere in / var / log /
- If I understand correctly, then the first 4 options are required? And then comes the announcement of 2 pools and 2 static hosts? - Sergey
- I would not say that they are 100% mandatory, but it was quieter for me to ask than to use the default values. Yes, further two pools and three hosts. And attention - the hosts are not quite static. I would even say that it is not static at all. And dynamically receive a fixed IP by MAC address. This is convenient in that you can always access a PC directly with IP knowledge. I commented out the interfaces, but in general it is possible to start dhcpd on specific interfaces. - gecube
- Yes, I apologize, not static, but reserved (at least in Windows it is so called). Thank you, I hope to start. - Sergey
- Alas, it did not start. dhcpd log is missing. - Sergey
- Log can not be! Search. Can write to any / var / log / messages or daemon.log - gecube
|