在 GNS3(并使用 Cisco 路由器)中,我创建了四个子网,如下所示:
目标是在路由器上设置 DHCP 服务器并在路由器上设置R1DHCP 中继代理,R2以使其可用于subnet2and subnet3(对于当前问题,我只关注subnet1and subnet2,特别是PC1and PC2)。
在为每个路由器的每个接口配置了 IP 地址之后,我已经在路由器上设置了 DHCP 地址池,即 、subnet1和subnet2,如上图所示。在 router 上,我还定义了使用以下命令的路由:subnet3R1R1subnet2
R1(config)#ip route 20.20.2.0 255.255.255.224 1.12.21.2
R2(config)#end
在 router 上R2,我f0/0使用以下方法在接口上定义了一个 DHCP 中继代理:
R2(config)#int f0/0
R2(config-if)#ip helper-address 1.12.21.1
R2(config)#end
对于 router R1,输出为show running-config:
R1#sho running-config
Building configuration...
Current configuration : 1541 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
no ip dhcp use vrf connected
ip dhcp excluded-address 10.10.1.32 10.10.1.62
ip dhcp excluded-address 20.20.2.16 20.20.2.30
ip dhcp excluded-address 30.30.3.8 30.30.3.14
!
ip dhcp pool subnet1
network 10.10.1.0 255.255.255.192
default-router 10.10.1.1
dns-server 10.10.1.2
lease 0 2
!
ip dhcp pool subnet2
network 20.20.2.0 255.255.255.224
default-router 20.20.2.1
dns-server 10.10.1.2
lease 0 0 30
!
ip dhcp pool subnet3
network 30.30.3.0 255.255.255.240
default-router 30.30.3.1
dns-server 10.10.1.2
!
!
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
interface FastEthernet0/0
ip address 10.10.1.1 255.255.255.192
duplex auto
speed auto
!
interface Serial0/0
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 1.12.21.1 255.255.255.252
duplex auto
speed auto
!
ip route 20.20.2.0 255.255.255.224 1.12.21.2
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login
!
!
end
对于 router R2,输出为show ruuning-config:
Building configuration...
Current configuration : 998 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
ip tcp synwait-time 5
!
!
!
interface FastEthernet0/0
ip address 20.20.2.1 255.255.255.224
ip helper-address 1.12.21.1
duplex auto
speed auto
!
interface Serial0/0
no ip address
shutdown
clock rate 2000000
!
interface FastEthernet0/1
ip address 30.30.3.1 255.255.255.240
duplex auto
speed auto
!
interface FastEthernet1/0
ip address 1.12.21.2 255.255.255.252
duplex auto
speed auto
!
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login
!
!
end
下面是 switch 的配置,andSW1也一样:SW2SW3
因为PC1,使用命令ip dhcp,带回它的 IP 地址以及它的掩码等等。但是PC2,有一个问题。当我尝试PC2>ip dhcp结果是:
DDDO
Can't find DHCP server
我还在链接上使用了 Wireshark R2 to R1,SW2 and PC2您可以在下面看到两条DHCPOFFER消息被发送到PC2on link SW2 to PC2,但没有DHCPREQUEST被发回。
我的配置哪里错了?



