您的位置:首页 > 运维架构 > Linux

linux系统命令之dhcp服务器

2017-10-30 21:52 344 查看

搭建dhcp服务器

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

[root@foundation17 ~]# 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.




[root@foundation17 ~]# yum install dhcp.x86_64 -y          ##安装dhcp






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




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




[root@foundation17 ~]# 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行以后删掉






[root@foundation17 ~]# yum install dhcp -y

[root@foundation17 ~]# systemctl status dhcpd

[root@foundation17 ~]# systemctl stop firewalld




内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: