Network | DHCP

动态主机设置协议(Dynamic Host Configuration Protocol,
DHCP)是一个局域网的网络协议,使用UDP协议工作,主要有两个用途:

  • 给内部网络或网络服务供应商自动分配IP地址给用户

  • 给内部网络管理员作为对所有计算机作中央管理的手段

DHCP使用了租约的概念,或称为计算机IP地址的有效期。租用时间是不定的,主要取决于用户在某地联接Internet需要多久,这对于教育行业和其它用户频繁改变的环境是很实用的。通过较短的租期,DHCP能够在一个计算机比可用IP地址多的环境中动态地重新配置网络。DHCP支持为计算机分配静态地址,如需要永久性IP地址的Web服务器。

When a computer or other networked device connects to a network, its DHCP
client software in the operating system sends a broadcast query requesting
necessary information. Any DHCP server on the network may service the request.
The DHCP server manages a pool of IP addresses and information
about client configuration parameters such as default gateway, domain
name, the name servers, and time servers. On receiving a request, the server may
respond with specific information for each client, as previously configured by
an administrator, or with a specific address and any other information valid for
the entire network, and the time period for which the allocation
(lease) is valid.

The client broadcasts messages on the network subnet using the destination
address 255.255.255.255 or the specific subnet broadcast
address. A DHCP client may also request its last-known IP address. If the client
remains connected to the same network, the server may grant the request.
Otherwise, it depends whether the server is set up as authoritative or not. An
authoritative server denies the request, causing the client issue a new request.
A non-authoritative server simply ignores the request, leading to an
implementation-dependent timeout for the client expire the request and ask for a
new IP address.

When a DHCP server receives a DHCPDISCOVER message from a client, which is an
IP address lease request, the server reserves an IP address for the client and
makes a lease offer by sending a DHCPOFFER message to the client. This message
contains the client‘s MAC address, the IP address that the server is offering,
the subnet mask, the lease duration, and the IP address of the DHCP server
making the offer.

In response to the DHCP offer, the client replies with a DHCP request, broadcast to the server, requesting the
offered address. A client can receive DHCP offers from multiple servers,
but it will accept only one DHCP
offer. Based on required server identification option in the request and
broadcast messaging, servers are informed
whose offer the client has accepted.[5] When other DHCP servers receive
this message, they withdraw any offers that they might have made to the client
and return the offered address to the pool of available addresses.

When the DHCP server receives the DHCPREQUEST message from the client, the
configuration process enters its final phase. The acknowledgement phase involves
sending a DHCPACK packet to the client. This packet includes the
lease duration and any other configuration information that the client
might have requested. At this point, the IP configuration process is
completed.

After the client obtains an IP address, the client may use the Address
Resolution Protocol (ARP) to prevent
address conflicts caused by overlapping address pools of DHCP
servers.

时间: 2024-12-20 08:17:37

Network | DHCP的相关文章

openstack network:dhcp binding fail

[Lab5]DHCP

[Lab5]DHCP 在动态IP 地址的方案中,每台计算机并不设定固定的IP 地址,而是在计算机开机时才 被分配一个IP 地址,这台计算机被称为DHCP 客户端.而负责给DHCP 客户端分配IP 地 址的计算机称为DHCP 服务器.也就是说DHCP 是采用客户/服务器(Client/Server)模式,有 明确的客户端和服务器角色的划分. DHCP 的工作过程如下: 1.DHCP 客户机启动时,客户机在当前的子网中广播DHCPDISCOVER 报文向DHCP 服务器申请一个IP 地址. 2.DH

创建第一个 local network(II)- 每天5分钟玩转 OpenStack(81)

上一节通过 Web GUI 创建了 “first_local_net”,本节我们需要搞清楚底层网络结构有了哪些变化? 点击 “first_local_net” 链接,显示 network 的 subnet 和 port 信息. 在 Ports 列表中已经创建了一个 port,名称为 “(a5bd3746-3f89)”,IP 为 172.16.1.2, Attached Device 是 network:dhcp. 这里我们只需要知道该 port 对应的是 dhcp 的 interface,至于

openstack通过Network Namespace和iptables实现租户私有网络互訪和L3路由功能

安装架构介绍 本文旨在通过自己搭建类似neutron (openvswitch + gre) 实现SDN 的环境,学习了解其工作原理,模拟核心原理.比方:同一租户自己定义网络 instance 互通,手动为instance 分配 floating ip 等相关内容. 虚拟网络 须要新建3个虚拟网络Net0.Net1和Net2.其在virtual box 中相应配置例如以下. Net0: Network name: VirtualBox host-only Ethernet Adapter#2 P

7、二种 为二个不同的子网配置DHCP服务器

环境如下:        (参考之前,保证二个子网可以互相ping通) 虚拟机vm1        192.168.170.3                    VMnet8 (NAT模式) 虚拟机vm2        192.168.155.3                    VMnet1 (仅主机模式) 虚拟机gate        192.168.170.4 (eth1)       VMnet8 (NAT模式) 192.168.155.4 (eth0)       VMnet1

Linux - Network Configuration

Part 1: Basic Network Terminology Before setting up a network or accessing an existing network, it is important to know some key terms that are related to networking. This section explores the terms you should be aware of. Some of the terms are basic

Linux --DHCP服务器配置;DHCP服务器中继

DHCP概述 1.采用DHCP的必要性 在TCP/IP网络上,每台工作站要能存取网络上的资源之前,都必须进行基本的网络配置,一些主要参数诸如IP地址,子网掩码,缺省网关,DNS等必不可少,还可能需要一些附加的信息如IP管理策略之类.对于一个稍微大点的网络而言,网络的管理和维护的任务是相当繁重的.一台计算机从一个子网转移到另一个子网,就要重新对系统进行配置.对于普通水平的工作站用户是不能赋予他们配置自己的工作站网络的权限,而且也没有这个必要.如果一个没有相应技术水平的用户出于好奇或想学习一下的目的

OpenStack中down掉的异常dhcp port 处理

在OpenStack中,随着网络环境费复杂增长,有时候会遇到dhcp agent port bonding failed,导致agent无法正常提供服务,我们可以简单的用下面的方法来处理 1.查找down掉的port [email protected]:~# neutron port-list -c id -c tenant_id --status DOWN --device_owner network:dhcp -c device_owner -c device_id -c fixed_ips

DHCP与DHCP中继原理理与配置

centos7 关闭防火墙 systemctl stop firewalld systemctl disable firewalld centos6 关闭防火墙 service iptables stop chkconfig iptables off 关闭selinux安全机制 sed -i '7 s/enforcing/disabled' /etc/selinux/config setenforce 0 iptables -F DHCP服务器 安装DHCP服务 [[email protecte