Cisco 路由器上的 DHCP 配置

网络工程 思科 路由器 ipv4 dhcp
2021-07-18 15:19:21

请帮忙

您好,我正在尝试配置网络中的 DHCP 服务器

我的网络布局的NETMAP是

150:0/0 250:0/0
250:0/1 450:0/0
250:1/0 350:0/0
250:1/1 550:0/0`
Say here 150,250,350,450 and 550 represents the router and each interface is connected in the above fashion example the 0/0 interface of router 150 is connected to interface 0/0 of the router 250 and so on.

I am trying to make the router 450 as the DHCP server the config for that is

`!
! Last configuration change at 14:37:39 IST Tue Oct 6 2015
!
version 15.5
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
!
clock timezone IST 5 30
!
!
!
!
!
!
!
!
!




ip dhcp excluded-address 10.0.0.1 10.0.0.30
ip dhcp excluded-address 30.0.0.1 30.0.0.20
ip dhcp excluded-address 40.0.0.1 40.0.0.10
!
ip dhcp pool DHCP150
network 10.0.0.0 255.255.255.0
default-router 10.0.0.1 255.255.255.0
!
ip dhcp pool DHCP350
network 30.0.0.0 255.255.255.0
default-router 30.0.0.1 255.255.255.0
!
ip dhcp pool DHCP550
network 40.0.0.0 255.255.255.0
default-router 40.0.0.1 255.255.255.0
!
!
!


ip cef
no ipv6 cef
!
!
!
!
!
!
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
ip address 20.0.0.2 255.0.0.0
!
interface Ethernet0/1
no ip address
!
interface Ethernet0/2
no ip address
shutdown
!
interface Ethernet0/3
no ip address
shutdown
!
interface Ethernet1/0
no ip address
!
interface Ethernet1/1
no ip address
!
interface Ethernet1/2
no ip address
shutdown
!
interface Ethernet1/3
no ip address
shutdown
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial3/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial3/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial3/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial3/3
no ip address
shutdown
serial restart-delay 0
!
ip forward-protocol nd
!
!
no ip http server
!
!
!
!
control-plane
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
!
!
!
end

你们能告诉我我应该在客户端做什么吗?我想首先我应该在客户端上提供默认路由,以便他们知道如何到达 DHCP 服务器,但即使我试图在客户端上配置 ip 路由。我收到消息,因为每当我执行 sh ip route 时都没有设置最后的网关

此外,所有其他路由器连接的 250 路由器上的配置是

!
! Last configuration change at 14:44:09 IST Tue Oct 6 2015
!
version 15.5
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
!
clock timezone IST 5 30
!
!
!
!
!
!
!
!
!




ip dhcp excluded-address 10.0.0.1 10.0.0.30
!
ip dhcp pool DHCP1
network 10.0.0.0 255.0.0.0
default-router 10.0.0.1
dns-server 10.0.0.1
domain-name cisco.local
!
!
!
no ip domain lookup


ip cef
no ipv6 cef
!
!
!
!
!
!
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
ip address 10.0.0.1 255.0.0.0
!
interface Ethernet0/1
ip address 20.0.0.1 255.0.0.0
!
interface Ethernet0/2
no ip address
shutdown
!
interface Ethernet0/3
no ip address
shutdown
!
interface Ethernet1/0
ip address 30.0.0.1 255.0.0.0
!
interface Ethernet1/1
ip address 40.0.0.1 255.0.0.0
!
interface Ethernet1/2
no ip address
shutdown
!
interface Ethernet1/3
no ip address
shutdown
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial3/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial3/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial3/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial3/3
no ip address
shutdown
serial restart-delay 0
!
ip forward-protocol nd
!
!
no ip http server
!
!
!
!
control-plane
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
!
!
!
end



!
! Last configuration change at 15:07:25 IST Tue Oct 6 2015
!
version 15.5
service timestamps debug datetime msec
service timestamps log datetime msec
!
hostname Router
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
!
!
!
clock timezone IST 5 30
!
!
!
!
!
!
!
!
!




!
!
!
no ip domain lookup


ip cef
no ipv6 cef
!
!
!
!
!
!
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
ip address 10.0.0.1 255.255.255.0
!
interface Ethernet0/1
ip address 20.0.0.1 255.255.255.0
!
interface Ethernet0/2
no ip address
shutdown
!
interface Ethernet0/3
no ip address
shutdown
!
interface Ethernet1/0
ip address 30.0.0.1 255.255.255.0
!
interface Ethernet1/1
ip address 40.0.0.1 255.255.255.0
!
interface Ethernet1/2
no ip address
shutdown
!
interface Ethernet1/3
no ip address
shutdown
!
interface Serial2/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial2/3
no ip address
shutdown
serial restart-delay 0
!
interface Serial3/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial3/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial3/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial3/3
no ip address
shutdown
serial restart-delay 0
!
ip forward-protocol nd
!
!
no ip http server
!
!
!
!
control-plane
!
!
line con 0
logging synchronous
line aux 0
line vty 0 4
login
!
!
!
end

我正在尝试在客户端上配置默认路由,但表示未设置最后的网关。

2个回答

首先,在这里接缝是 IOU 圈 ,您在许多问题中都失败了 1- 您配置的 DHCP 池在路由器 450 和路由器 250(10.0.0.0/24 和 10.0.0.0/8)中包含相同的范围,这将导致 iP冲突 2 - 本质上,您配置为 DHCP 池的网络已经用作路由器之间的互连,DHCP 经常用于路由器后面的客户端或主机(这将肯定在用于将路由器连接到每个的网络以外的网络中)其他) 3- 仅供参考,如果您打算将路由器 450 用作其他路由器后面的客户端的 DHCP 服务器,只需使用用作客户端网络 GW 的接口下在此处输入图片说明

why you need to configure this DHCP server ??
IP helper command

我想首先我应该在客户端上提供默认路由,以便他们知道如何到达 DHCP 服务器,但即使我试图在客户端上配置 ip 路由

不,客户端通过发送广播数据包(DHCPDISCOVER,UDP 数据包从端口 68 - bootpc - 到 67 - bootps)来发现 DHCP 服务器,因此您的 DHCP 服务器必须在客户端的同一广播域中才能提供服务。作为一种例外,放置在广播域中的 DHCP 中继代理可能就足够了;基本上,它从它连接到远程 DHCP 服务器的网络中的客户端转发 DHCP 消息(命令“ip helper xxxx”)。

因此,例如,如果路由器 250 的接口 Ethernet1/0 拥有 30.0.0.1/8(广播域),则路由器 450 上的配置“ip dhcp pool DHCP350”应移至 250,或 250 应配置为DHCP 中继代理到 450。