Cloud Native应用交付

  • 首页
  • 关于本站
  • 个人介绍
  • Downloads
  • Repo
    • Github
    • Container
  • F5
    • F5 Python SDK
    • F5-container
    • F5-LBaaS
  • 社交
    • 联系我
    • 微信/微博
    • 公众号
    • 打赏赞助
行至水穷处 坐看云起时
Cloud Native Application Services: cnadn.net
  1. 首页
  2. 路由器技术
  3. 正文

DHCP技术(整理版)[转贴]

2006年04月13日 7055点热度 0人点赞 0条评论

DHCP基本知识点 1 DHCP协议在RFC2131种定义,使用udp协议进行数据报传递,使用的端口是67以及68。 2 DHCP最常见的应用是,自动给终端设备分配ip地址,掩码,默认网关,但是DHCP也同样可以给终端设备自动配置其他options,比如DNS server, 域名(比如 net130.com),time zones, NTP servers 以及其他的配置内容,更有些厂家,利用自己开发的第3放软件,把自己的一些配置信息,利用dhcp协议来实现对终端设备的自动配置。 3 DHCP服务的系统最基本的构架是 client/server模式,并且如果client 和server不再同一个2层网络内(即广播可以到达的网络范围),则必须要有能够透过广播报文的中继设备,或者能把广播报文转化成单播报文的设备(cisco的ios就引经了这种功能) There are three distinct element types in a DHCP network. There must be a client and a server. If these two elements are not on the same Layer 2 network, there also must be a proxy, which usually runs on the router. The proxy is needed because the client device initially doesn't know its own IP address, so it must send out a Layer 2 broadcast to find a server that has this information. The router must relay these broadcasts to the DHCP server, then forward the responses back to the correct Layer 2 address so that the right end device gets the right configuration information. 4 CISCO的路由器(IOS12.0 T1以后),可以配置为dhcp的中继设备,DHCP的客户端设备,也可以配置为DHCP的服务器。 5 同一个网段DHCP服务器可以有多个,这不会影响终端设备从服务器获取配置信息,终端设备以接受到的第一组配置信息为准。以后又服务器段返回的DHCP配置信息被抛弃。 . Most DHCP networks of any size include two or more DHCP servers for redundancy. The end devices typically just need to talk to a DHCP server at startup time, but they will not work at all without it. So redundancy is important. This also means that it is not unusual for an end device to see several responses to a DHCP request. It will generally just use the first response. However, this also underscores the importance of ensuring that all of the DHCP servers distribute the same information. Their databases of end device configuration parameters must be synchronized. 6 DHCP 服务器往往遵守先来先服务的规则(first-come, first-served),或者说他能够建立一个IP地址和终端设备MAC地址之间的映射表(或者叫做database),由此可以保证特定的终端(也就是特定的MAC)每次开机后都能够获得此相同的ip地址。 .The server can allocate IP addresses from a pool on a first-come, first-served basis, or it can associate IP addresses with end device MAC addresses to ensure that a particular client always receives the same address.

用 IP Helper Addresses 命令配置DHCP中继服务 1典型配置命令 The ip helper-address configuration command allows the router to forward local DHCP requests to one or more centralized DHCP servers: Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface Ethernet0
Router1(config-if)#ip helper-address 172.25.1.1 /*指定dhcp服务器的地址,表示通过Ethernet0向该服务器发送DHCP请求包*/
Router1(config-if)#ip helper-address 172.25.10.7 /*作用同上*/
Router1(config-if)#end
Router1#
关于以上配置的讨论
1 在客户端设备和DHCP服务器不再同一广播域内的时候,中间设备即路有器(路有功能的设备)必须要能够转发这种广播包,具体到cisco的设备上,则启用ip helper-address命令,来实现这种中继。
2 DHCP服务器要给终端设备分配地址则需要掌握两个重要的信息,第一,该客户端设备所在网络的子网掩码,DHCP服务器依据子网掩码的信息来判断,服务器该分配哪个IP地址,以使得该ip地址在那个子网内,第二,DHCP服务器必须知道客户端的MAC地址,以维护DHCP服务器的ip 地址和MAC之间的映射关系,由此保证同样一台客户机,每次启动后能获得和前一次相同的ip地址。
3 配置了ip helper-address命令之后的路由器在中继DHCP请求时的工作过程如下 a,DHCP客户端发送请求,由于没有ip地址,所以自己的源IP地址为0.0.0.0,而且也不知道目的DHCP服务器的地址,所以为广播255.255.255.255。该数据报中当然还包含其他信息,比如二层的信息,源mac地址,和目的mac地址FFFFFFFFFFFF。 b,当路由器接收到该数据报的时候,他就用自己的接口地址(接收到数据报的接口)来取代源地址0.0.0.0,并且用ip help-address 命令中指定的地址(上例中为172.25.1.1以及172.25.10.7)来取代目的地址255.255.255.255 The router must replace the source address with its own IP address, for the interface that received the request. And it replaces the destination address with the address specified in the ip helper-address command. The client device's MAC address is included in the payload of the original DHCP request packet, so the router doesn't need to do anything to ensure that the server receives this information. c 当DHCP服务器接收到路有器转发过来的DHCP请求包时,他有了足够的信息,(由源IP地址中的地址,确定客户机所在的子网掩马,由此分配相应地址池中的空闲地址,并且知道了客户记得MAC地址,把它写入自己的数据库,建立IP地址和MAC的映射关系)然后DHCP服务器做出响应,并且由路有器把数据报转发会客户端。(整个过程应该在客户机和服务器之间还有一次会话,由于这不是路由器DHCP配置的讨论重点,这里不谈) 4 例子中配置了两个DHCP服务器,我们必须分别用ip helper-address 命令指明,路有器会转发DHCP请求包到所有的DHCP服务器上。很多企业的做法都是至少有两台DHCP服务器,有提高冗余和可靠性的作用。此时,如果客户端受到几个来自不同DHCP服务器的应答,则只选择最先接收到的应答数据报。 5 必须要注意的是;ip helper-address 命令不仅仅是只转发DHCP请求包,事实上,在默认情况下,他还转发其他的UDP报(比如DNS请求)到ip helper-address命令所指定的服务器上,所以这种额外的数据流量可能会增加DHCP服务器链路的负担以及服务器CPU负担,可能会引起问题,关于解决办法,将在后面讨论。 最后 用show ip interface 显示相关的ip help-address配置信息: Router1#show ip interface Ethernet0
Ethernet0 is up, line protocol is up
Internet address is 192.168.30.1/24
Broadcast address is 255.255.255.255
Address determined by setup command
MTU is 1500 bytes
Helper addresses are 172.25.1.3
172.25.1.1

Directed broadcast forwarding is disabled Router1#

在配置了dhcp中继的路由器上,禁止无意义udp广播报的转发 问题的提出: 正如前面章节说描述的那样,路由器上配置IP helper addresses命令后,] ]>

相关文章

  • DHCP技术(整理版)[续][转贴]
  • 以前单位同事一次DHCP snooping排错经历
  • http://www.cisco.com/warp/public/707/gre_ipsec_ospf.html
  • IPSEC VPN上跑组播
  • 一个DHCP问题的分析过程
本作品采用 知识共享署名-非商业性使用 4.0 国际许可协议 进行许可
标签: dhcp
最后更新:2006年04月13日

纳米

linjing.io

打赏 点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理。

页面AI聊天助手

纳米

linjing.io

☁️迈向Cloud Native ADC ☁️

认证获得:
TOGAF: ID 152743
Kubernetes: CKA #664
Microsoft: MCSE MCDBA
Cisco: CCNP
Juniper: JNCIS
F5:
F5 Certified Solution Expert, Security
F5 Certified Technology Specialist, LTM/GTM/APM/ASM
F5 Certified BIG-IP Administrator
  • 点击查看本博技术要素列表
  • 归档
    分类
    • AI
    • Automation
    • Avi Networks
    • Cisco ACI
    • CISCO资源
    • F5 with ELK
    • F5-Tech tips
    • F5技术
    • Juniper
    • Linux
    • NGINX
    • SDN
    • ServiceMesh
    • WEB编程
    • WINDOWS相关
    • 业界文章
    • 交换机技术
    • 化云为雨/Openstack
    • 协议原理
    • 容器/k8s
    • 我的工作
    • 我的生活
    • 网站技术
    • 路由器技术
    • 项目案例
    标签聚合
    gtm irule api flannel istio k8s neutron network bigip F5 docker envoy openstack DNS nginx
    最近评论
    汤姆 发布于 8 个月前(09月10日) 嗨,楼主,里面的json怎么下载啊,怎么收费啊?
    汤姆 发布于 8 个月前(09月09日) 大佬,kib的页面可以分享下吗?谢谢
    zhangsha 发布于 1 年前(05月12日) 资料发给我下,谢谢纳米同志!!!!lyx895@qq.com
    李成才 发布于 1 年前(01月02日) 麻烦了,谢谢大佬
    纳米 发布于 1 年前(01月02日) 你好。是的,因为以前下载系统插件在一次升级后将所有的下载生成信息全弄丢了。所以不少文件无法下载。DN...
    浏览次数
    • Downloads - 183,773 views
    • 联系我 - 118,966 views
    • 迄今为止最全最深入的BIGIP-DNS/GTM原理及培训资料 - 116,512 views
    • Github - 103,661 views
    • F5常见log日志解释 - 79,774 views
    • 从传统ADC迈向CLOUD NATIVE ADC - 下载 - 74,625 views
    • Sniffer Pro 4 70 530抓包软件 中文版+视频教程 - 74,320 views
    • 迄今为止最全最深入的BIGIP-DNS/GTM原理及培训资料 - 67,770 views
    • 关于本站 - 60,911 views
    • 这篇文档您是否感兴趣 - 55,495 views
    链接表
    • F5SE创新
    • Jimmy Song‘s Blog
    • SDNlab
    • Service Mesh社区
    • 三斗室
    • 个人profile
    • 云原生社区

    COPYRIGHT © 2023 Cloud Native 应用交付. ALL RIGHTS RESERVED.

    Theme Kratos Made By Seaton Jiang

    京ICP备14048088号-1

    京公网安备 11010502041506号