linux系统命令之dhcp服务器

搭建dhcp服务器


1.yum  search dhcp -y         ####搜索dhcp


[[email protected] ~]# yum search dhcp -y      ####搜索dhcp安装包
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
              : manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
============================== N/S matched: dhcp ===============================
dhcp-common.x86_64 : Common files used by ISC dhcp client and server
dhcp-libs.i686 : Shared libraries used by ISC dhcp client and server
dhcp-libs.x86_64 : Shared libraries used by ISC dhcp client and server
dhclient.x86_64 : Provides the ISC DHCP client daemon and dhclient-script
dhcp.x86_64 : Dynamic host configuration protocol software      ##dhcp软件
dnsmasq.x86_64 : A lightweight DHCP/caching DNS server

  Name and summary matches only, use "search all" for everything.


linux系统命令之dhcp服务器


[[email protected] ~]# yum install dhcp.x86_64 -y          ##安装dhcp


linux系统命令之dhcp服务器linux系统命令之dhcp服务器





2.找配置文件  并 更改  覆盖源文件
[[email protected] ~]# cat /etc/dhcp/dhcpd.conf

linux系统命令之dhcp服务器


[[email protected] ~]# cp /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf ##生成配置文件


linux系统命令之dhcp服务器


[[email protected] ~]# vim /etc/dhcp/dhcpd.conf
 
 7 option domain-name "qq.com";              ###指定域名
 8 option domain-name-servers 172.25.254.17;  ###指定客户主机获得到的dns
 10 default-lease-time 600;              ###最短租约期
 11 max-lease-time 7200;                ###最长租约期
 27 
 28 # This is a very basic subnet declaration.
 29 
 30 subnet 172.25.254.0 netmask 255.255.255.0 {
 31   range 172.25.254.123 172.25.254.234;
 32   option routers 172.25.254.17;
 33 }

 35行以后删掉


linux系统命令之dhcp服务器


linux系统命令之dhcp服务器



[[email protected] ~]# yum install dhcp -y
[[email protected] ~]# systemctl status dhcpd
[[email protected] ~]# systemctl stop firewalld


linux系统命令之dhcp服务器

linux系统命令之dhcp服务器