美文网首页
DHCP服务

DHCP服务

作者: new_liziang | 来源:发表于2019-01-18 11:12 被阅读0次

使用两台虚拟机,一台server端作为dhcp的服务器,另一台desktop作为dhcp的客户端。

配置server端的ip和dns

yum install dhcp -y

[root@foundation74 etc]# cd dhcp/
[root@foundation36 dhcp]# ls
dhclient.d dhcpd6.conf dhcpd.conf

vim /etc/sysconfig/network //配置网关
GATEWAY=真机的ip

cp /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf

vim /etc/dhcp/dhcpd.conf 修改dhcpd.conf

# dhcpd.conf
# #
# Sample configuration file for ISC dhcpd
#

# option definitions common to all supported networks...
option domain-name "westos.com";        ##域名
option domain-name-servers 114.114.114.114; ##dns

default-lease-time 600;             ##默认租约
max-lease-time 7200;                ##最长租约

# Use this to enble / disable dynamic dns updates globally.
#ddns-update-style none;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;

#Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

# No service will be given on this subnet, but declaring it helps the 
# DHCP server to understand the network topology.
27  删除
28  删除

# This is a very basic subnet declaration.

subnet 172.25.254.0 netmask 255.255.255.0 {     ##网络号
  range 172.25.254.126 172.25.254.200;          ##IP地址池范围
    option routers 172.25.254.26;           ##网关
    }
35-最后 全删除   然后保存

systemctl restart dhcpd 重启dhcp服务
dhcp服务已完成。

现在转到desktop虚拟机,让虚拟机自动获取i
systemctl stop firewalld 关闭防火墙
nm-connection-editor 设置为dhcp模式

ip是服务器分配的第一个,网关和上面服务器设置的相同

[root@localhost Desktop]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.25.254.136  netmask 255.255.255.0  broadcast 172.25.254.255
        inet6 fe80::5054:ff:fe00:240a  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:00:24:0a  txqueuelen 1000  (Ethernet)
        RX packets 222203  bytes 3762566728 (3.5 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 122798  bytes 8355140 (7.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
[root@localhost Desktop]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.25.254.36   0.0.0.0         UG    1024   0        0 eth0

相关文章

  • DHCP服务器

    DHCP服务 DHCP介绍 DHCP应用场景 DHCP工作原理 DHCP服务器部署 DHCP作用域 DHCP超级作...

  • 2018-12-10DHCP的搭建

    DHCP服务的搭建 1,安装DHCP服务端 #yum -y install dhcp 2,配置dhcp服务器 #v...

  • Centos7搭建DHCP服务器

    一、DHCP服务简介 ****1. DHCP服务简介**** DHCP(Dynamic Host Configur...

  • DHCP报文类型以及流程

    客户端发送DHCP Discover广播信息寻找DHCP服务器 服务器收到DHCP Discover后发送DHCP...

  • Centos7下搭建dhcp服务

    1.配置DHCP服务器 dhcp服务的安装与基本配置: 1)安装DHCP服务: yum install d...

  • 2020-12-08

    (小白学网络)DHCP实验—本地服务器 1.设置交换机为DHCP服务器 (config)#service dhcp...

  • Kali Linux常用服务配置教程安装及配置DHCP服务

    Kali Linux常用服务配置教程安装及配置DHCP服务 在Kali Linux中,默认没有安装DHCP服务。下...

  • DHCP snooping总结

    DHCP服务已是网络中必不可少的服务之一。随着DHCP服务的部署,一些安全问题也逐渐暴露出一些问题: DHCP报文...

  • Learning Openstack Part12 Neutro

    neutron提供DHCP服务的组件是DHCP agent。DHCP agent在网络节点上运行,默认通过dnsm...

  • linux pxe的构建

    服务端要求: (dhcp已经配好) 运行dhcp服务,用来分配地址,定位引导程序 运行tftp服务,提供引导程序下...

网友评论

      本文标题:DHCP服务

      本文链接:https://www.haomeiwen.com/subject/wybgdqtx.html