两台路由器DHCP服务器设置

网络工程 思科 路由 dhcp 数据包跟踪器
2022-02-18 02:42:03

这是我的拓扑:

拓扑图

我正在尝试为 Windows XP 客户端获取 DHCP IP 地址,但是当我执行ipconfig /renew命令时,它显示can not use the rpc server and failed to get an ip address from dhcp server.

请检查我的拓扑和配置:

R

 Router#sh run
    Building configuration...

    Current configuration : 1091 bytes
    !
    ! Last configuration change at 14:17:26 UTC Fri Oct 28 2016
    !
    version 15.4
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    !
    hostname Router
    !
    boot-start-marker
    boot-end-marker
    !
    aqm-register-fnf
    !
    !
    no aaa new-model
    mmi polling-interval 60
    no mmi auto-configure
    no mmi pvc
    mmi snmp-timeout 180
    !
    !
    !
    !
    !
    !


    !
    ip dhcp excluded-address 1.1.1.254
    ip dhcp excluded-address 1.1.1.1 1.1.1.10
    !
    ip dhcp pool A
    network 1.1.1.0 255.255.255.0
    default-router 1.1.1.254
    dns-server 168.126.63.1
    lease 0 8
    !
    !
    !
    ip cef
    no ipv6 cef
    !
    multilink bundle-name authenticated
    !
    !
    !
    !
    !
    !
    !
    !
    !
    redundancy

    !
    interface Ethernet0/0
    ip address 1.1.2.2 255.255.255.0
    !
    interface Ethernet0/1
     no ip address
    shutdown
    !
    interface Ethernet0/2
    no ip address
    shutdown
    !
    interface Ethernet0/3
    no ip address
    shutdown
    !
    ip forward-protocol nd
    !
    !
    no ip http server
    no ip http secure-server

    control-plane

    line con 0
    logging synchronous
    line aux 0
    line vty 0 4
     login
    transport input none
    !
    !
    end

R1

    Router#sh run
Building configuration...

Current configuration : 2327 bytes
!
! Last configuration change at 12:59:47 UTC Fri Oct 28 2016
!
version 15.4
service config
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Router
!
boot-start-marker
boot-end-marker
!
aqm-register-fnf
!
!
no aaa new-model
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
!
!
!
!
!
!


!
!
!
!
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
redundancy
!
!
!
!
!
!
!
!
!
!
!
!
!
!
!
interface Ethernet0/0
 ip address 1.1.1.254 255.255.255.0
 ip helper-address 1.1.2.2
!
interface Ethernet0/1
 ip address 1.1.2.1 255.255.255.0
!
interface Ethernet0/2
 no ip address
 shutdown
!
interface Ethernet0/3
 no ip address
 shutdown
!
interface Ethernet1/0
 no ip address
 shutdown
!
interface Ethernet1/1
 no ip address
 shutdown
!
interface Ethernet1/2
 no ip address
 shutdown
!
interface Ethernet1/3
 no ip address
 shutdown
!
interface Ethernet2/0
 no ip address
 shutdown
!
interface Ethernet2/1
 no ip address
 shutdown
!
interface Ethernet2/2
 no ip address
 shutdown
!
interface Ethernet2/3
 no ip address
 shutdown
!
interface Ethernet3/0
 no ip address
 shutdown
!
interface Ethernet3/1
 no ip address
 shutdown
!
interface Ethernet3/2
 no ip address
 shutdown
!
interface Ethernet3/3
 no ip address
 shutdown
!
interface Ethernet4/0
 no ip address
 shutdown
!
interface Ethernet4/1
 no ip address
 shutdown
!
interface Ethernet4/2
 no ip address
 shutdown
!
interface Ethernet4/3
 no ip address
 shutdown
!
interface Ethernet5/0
 no ip address
 shutdown
!
interface Ethernet5/1
 no ip address
 shutdown
!
interface Ethernet5/2
 no ip address
 shutdown
!
interface Ethernet5/3
 no ip address
 shutdown
!
interface Ethernet6/0
 no ip address
 shutdown
!
interface Ethernet6/1
 no ip address
 shutdown
!
interface Ethernet6/2
 no ip address
 shutdown
!
interface Ethernet6/3
 no ip address
 shutdown
!
interface Ethernet7/0
 no ip address
 shutdown
!
interface Ethernet7/1
 no ip address
 shutdown
!
interface Ethernet7/2
 no ip address
 shutdown
!
interface Ethernet7/3
 no ip address
 shutdown
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
!
!
!
control-plane
!
!
!
!
!
!
!
!
line con 0
 logging synchronous
line aux 0
line vty 0 4
 login
 transport input none
!
!
end

另一个问题:

我把 DHCP 服务器的default-router地址设置为1.1.1.254,但是我们什么时候需要这个默认的路由器地址和dns-server地址呢?

1个回答

从我在您的 R 配置中可以看到,它没有通往1.1.1.0/24网络的路由。

您确实不应该使用该default-router命令,但如果您这样做,它需要是 R 知道的网络。那将是直接连接的网络,default-router应该是1.1.2.1.

更好的选择是使用到1.1.1.0/24网络的静态路由:

ip route 1.1.1.0 255.255.255.0 1.1.2.1

或放入默认路由:

ip route 0.0.0.0 0.0.0.0 1.1.2.1

或在两个路由器之间运行路由协议。