centos8 dhcp
时间: 2023-09-20 13:14:04 浏览: 72
As an AI language model, I can provide you with the steps to configure DHCP on CentOS 8:
1. Install the DHCP package by running the command:
`sudo dnf install dhcp`
2. Configure the DHCP server by editing the /etc/dhcp/dhcpd.conf file. Here is an example configuration:
```
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.50 192.168.1.100;
option routers 192.168.1.1;
option domain-name-servers 8.8.8.8, 8.8.4.4;
}
```
This configuration sets up a DHCP server to assign IP addresses in the range of 192.168.1.50 to 192.168.1.100, with the router being 192.168.1.1 and the DNS servers being Google's public DNS servers.
3. Start and enable the DHCP service by running the following commands:
```
sudo systemctl start dhcpd
sudo systemctl enable dhcpd
```
This will start the DHCP service and enable it to start automatically at boot.
4. Check the status of the DHCP service by running the command:
`sudo systemctl status dhcpd`
This should show that the DHCP service is active and running.
That's it! Your CentOS 8 machine is now configured as a DHCP server. You can now connect other devices to your network and they should receive an IP address from your CentOS 8 DHCP server.
阅读全文