在stick上配置dhcp中继代理和路由器

网络工程 局域网 dhcp
2022-02-16 19:56:46

我需要帮助。我不知道我做错了什么,因为我已经配置了 dhcp 池、子接口和 dhcp 中继代理。网关 pc 使用静态 IP 地址,而分支 pc 通过作为网关路由器的 dhcp 服务器获取其 IP 地址。现在唯一的问题是 Branch 端的 pc 没有获取 ip 地址。

![在此处输入图像描述

--网关路由器--

ip dhcp 排除地址 192.168.1.0 192.168.1.5  
ip dhcp 排除地址 202.188.1.0 202.188.1.5  
ip dhcp 排除地址 172.16.1.0 172.16.1.5  
ip dhcp 池管理员  
 网络 192.168.1.0 255.255.255.0  
 默认路由器 192.168.1.1  
ip dhcp 池 STAFF  
 网络 202.188.1.0 255.255.255.0  
 默认路由器 202.188.1.1  
ip dhcp 池 GUEST  
 网络 172.16.1.0 255.255.255.0  
 默认路由器 172.16.1.1  
没有ip cef  
没有ipv6 cef  
生成树模式 pvst  
接口千兆以太网0/0/0  
 没有IP地址  
 双面自动  
 速度自动  
接口 GigabitEthernet0/0/0.10  
 封装dot1Q 10  
 ip地址192.168.1.1 255.255.255.0  
接口 GigabitEthernet0/0/0.20  
 封装dot1Q 20  
 ip地址202.188.1.1 255.255.255.0  
接口千兆以太网0/0/0.30  
 封装dot1Q 30  
 ip地址172.16.1.1 255.255.255.0  
接口 GigabitEthernet0/0/1  
 没有IP地址  
 双面自动  
 速度自动  
 关闭  
接口 GigabitEthernet0/0/2  
 没有IP地址  
 双面自动  
 速度自动  
 关闭  
接口 Serial0/1/0  
 ip地址10.0.0.1 255.255.255.252  
 时钟频率 128000  
接口 Serial0/1/1  
 没有IP地址  
 时钟频率 2000000  
 关闭  
接口 Vlan1  
 没有IP地址  
 关闭  
路由器 ospf 1  
 路由器 ID 1.1.1.1  
 日志邻接变化  
 网络 10.0.0.0 0.0.0.3 区域 0  
 网络 192.168.1.0 0.0.0.255 区域 0  
 网络 202.188.1.0 0.0.0.255 区域 0  
 网络 172.16.1.0 0.0.0.255 区域 0  
ip 无类  

--GWSwitch--

生成树模式 pvst  
生成树扩展系统 ID  
接口 FastEthernet0/1  
 交换机端口访问 vlan 10  
 交换端口模式访问  
接口 FastEthernet0/2  
 交换机端口访问 vlan 10  
 交换端口模式访问  
接口 FastEthernet0/3  
 交换机端口访问 vlan 10  
 交换端口模式访问  
接口 FastEthernet0/4  
 交换机端口访问 vlan 10  
 交换端口模式访问  
接口 FastEthernet0/5  
 交换机端口访问 vlan 10  
 交换端口模式访问  
接口 FastEthernet0/6  
 交换机端口访问 VLAN 20  
 交换端口模式访问  
接口 FastEthernet0/7  
 交换机端口访问 VLAN 20  
 交换端口模式访问  
接口 FastEthernet0/8  
 交换机端口访问 VLAN 20  
 交换端口模式访问  
接口 FastEthernet0/9  
 交换机端口访问 VLAN 20  
 交换端口模式访问  
接口 FastEthernet0/10  
 交换机端口访问 VLAN 20  
 交换端口模式访问  
接口 FastEthernet0/11  
 交换机端口访问 vlan 30  
 交换端口模式访问  
接口 FastEthernet0/12  
 交换机端口访问 vlan 30  
 交换端口模式访问  
接口 FastEthernet0/13  
 交换机端口访问 vlan 30  
 交换端口模式访问  
接口 FastEthernet0/14  
 交换机端口访问 vlan 30  
 交换端口模式访问  
接口 FastEthernet0/15  
 交换机端口访问 vlan 30  
 交换端口模式访问  
接口 FastEthernet0/16  
接口 FastEthernet0/17  
接口 FastEthernet0/18  
接口 FastEthernet0/19  
接口 FastEthernet0/20  
接口 FastEthernet0/21  
接口 FastEthernet0/22  
接口 FastEthernet0/23  
接口 FastEthernet0/24  
接口 GigabitEthernet0/1  
 交换机端口中继本机 vlan 99  
 交换端口模式中继  
接口 GigabitEthernet0/2  
接口 Vlan1  
 没有IP地址  
 关闭  
线路连接 0  
线 vty 0 4  
 登录  
线 vty 5 15  
 登录  
结尾  

--分支路由器--

ip dhcp 排除地址 192.168.1.0 192.168.1.5  
ip dhcp 排除地址 202.188.1.0 202.188.1.5  
ip dhcp 排除地址 172.16.1.0 172.16.1.5  
ip dhcp 池管理员  
没有ip cef  
没有ipv6 cef  
生成树模式 pvst  
接口千兆以太网0/0/0  
 没有IP地址  
 双面自动  
 速度自动  
接口 GigabitEthernet0/0/0.10  
 封装dot1Q 10  
 ip地址192.168.1.2 255.255.255.0  
 ip 助手地址 10.0.0.1  
接口 GigabitEthernet0/0/0.20  
 封装dot1Q 20  
 ip地址202.188.1.2 255.255.255.0  
 ip 助手地址 10.0.0.1  
接口千兆以太网0/0/0.30  
 封装dot1Q 30  
 ip地址172.16.1.2 255.255.255.0  
 ip 助手地址 10.0.0.1  
接口 GigabitEthernet0/0/1  
 没有IP地址  
 双面自动  
 速度自动  
 关闭  
接口 GigabitEthernet0/0/2  
 没有IP地址  
 双面自动  
 速度自动  
 关闭  
接口 Serial0/1/0  
 ip地址 10.0.0.2 255.255.255.252  
接口 Serial0/1/1  
 没有IP地址  
 时钟频率 2000000  
 关闭  
接口 Vlan1  
 没有IP地址  
 关闭  
路由器 ospf 1  
 路由器 ID 2.2.2.2  
 日志邻接变化  
 网络 10.0.0.0 0.0.0.3 区域 0  
 网络 192.168.1.0 0.0.0.255 区域 0  
 网络 202.188.1.0 0.0.0.255 区域 0  
 网络 172.16.1.0 0.0.0.255 区域 0  

--BSwitch--

接口 FastEthernet0/1  
 交换机端口访问 vlan 10  
 交换端口模式访问  
接口 FastEthernet0/2  
 交换机端口访问 vlan 10  
 交换端口模式访问  
接口 FastEthernet0/3  
 交换机端口访问 vlan 10  
 交换端口模式访问  
接口 FastEthernet0/4  
 交换机端口访问 vlan 10  
 交换端口模式访问  
接口 FastEthernet0/5  
 交换机端口访问 vlan 10  
 交换端口模式访问  
接口 FastEthernet0/6  
 交换机端口访问 VLAN 20  
 交换端口模式访问  
接口 FastEthernet0/7  
 交换机端口访问 VLAN 20  
 交换端口模式访问  
接口 FastEthernet0/8  
 交换机端口访问 VLAN 20  
 交换端口模式访问  
接口 FastEthernet0/9  
 交换机端口访问 VLAN 20  
 交换端口模式访问  
接口 FastEthernet0/10  
 交换机端口访问 VLAN 20  
 交换端口模式访问  
接口 FastEthernet0/11  
 交换机端口访问 vlan 30  
 交换端口模式访问  
接口 FastEthernet0/12  
 交换机端口访问 vlan 30  
 交换端口模式访问  
接口 FastEthernet0/13  
 交换机端口访问 vlan 30  
 交换端口模式访问  
接口 FastEthernet0/14  
 交换机端口访问 vlan 30  
 交换端口模式访问  
接口 FastEthernet0/15  
 交换机端口访问 vlan 30  
 交换端口模式访问  
接口 FastEthernet0/16  
接口 FastEthernet0/17  
接口 FastEthernet0/18
接口 FastEthernet0/19  
接口 FastEthernet0/20  
接口 FastEthernet0/21  
接口 FastEthernet0/22  
接口 FastEthernet0/23  
接口 FastEthernet0/24  
接口 GigabitEthernet0/1  
 交换端口模式中继  
接口 GigabitEthernet0/2  
1个回答

认为将@Ron Maupin 的评论扩展到实际答案可能对其他人有益。

所述配置发生的情况如下:

  1. 访客连接到分支机构网络中的 VLAN 30 并广播 DHCP Discover 数据包
  2. 分支交换机泛洪 Disc 数据包
  3. 品牌路由器收到它,并按照 IP Helper 配置的指示将数据包转发到网关路由器
  4. 作为 DHCP 服务器的网关将响应 DHCP Offer
  5. 因为网关服务器在g0/0/0.30上看到网络172.16.1.0/24是本地连接的,所以它不会通过s0/1/0转发数据包,而是通过g0/0/0.30
  6. 主办公室 VLAN 30 中的设备将收到 DHCP 提议,但由于他们没有请求,他们将丢弃数据包

正如 Ron 所说,改变一侧的 IP 地址是解决方案。使用当前设备和 IP 范围意味着拆分网络。

如何从那里继续取决于。如果主办公室中的所有设备都使用静态 IP 寻址,则可以更改现有的 DCHP 池和预留以提供 xxx128/25 范围内的 IP。然后 xxx0/25 中的所有地址在主办公室中可用,并且分支机构中的设备将接收(例如)从 xxx130/25 开始的 IP。

另一方面,如果主办公室也需要 DHCP 服务,则有必要将现有池更改为范围 xxx0/25,并在范围 xxx128/25 中创建新池以供分支机构使用。

编辑

哎呀!路由!需要重新配置 OSPF 以反映新的网络配置。