关于DHCP的问题
如拓扑,R1做了DHCP ,2个地址池,分别是VLAN 10 和 vlan 20. 问题:如果,R1的FA0/1接口做子接口,配置vlan10 和vlan20 ,pc2,pc3可以获得到地址(pc2和pc3分别链接的是交换机fa0/2和FA0/3,VLAN 是vlan10和vlan20). 但是 pc0和pc1就获取不到地址了。删除R1的fa0/1子接口,pc0和pc1就可以获取到地址。我的配置如下:
左边交换机的配置:
Switch(config)#do show run
Building configuration...
Current configuration : 1205 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/2
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/3
switchport mode trunk
!
interface Vlan1
no ip address
shutdown
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
end
R0的配置
Router#show run
Building configuration...
Current configuration : 1064 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
ip cef
no ipv6 cef
spanning-tree mode pvst
!
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation dot1Q 10
ip address 192.168.10.254 255.255.255.0
ip helper-address 10.1.12.2
!
interface FastEthernet0/0.2
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0
ip helper-address 10.1.12.2
!
interface FastEthernet0/1
ip address 10.1.12.1 255.255.255.0
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
network 1.1.1.1 0.0.0.0 area 0
network 10.1.12.0 0.0.0.255 area 0
network 192.168.10.0 0.0.0.255 area 0
network 192.168.20.0 0.0.0.255 area 0
!
ip classless
!
ip flow-export version 9
line con 0
!
line aux 0
!
line vty 0 4
login
!
end
R1的配置
Router#show run
Building configuration...
Current configuration : 1155 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
ip dhcp pool 10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.254
dns-server 61.139.2.69
ip dhcp pool 20
network 192.168.20.0 255.255.255.0
default-router 192.168.20.254
dns-server 61.139.2.69
ip cef
no ipv6 cef
spanning-tree mode pvst
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip address 10.1.12.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
!
interface FastEthernet0/1.1
encapsulation dot1Q 10
ip address 192.168.10.254 255.255.255.0
!
interface FastEthernet0/1.2
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0
!
interface Vlan1
no ip address
shutdown
!
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
network 10.1.12.0 0.0.0.255 area 0
network 2.2.2.2 0.0.0.0 area 0
ip classless
ip flow-export version 9
no cdp run
line con 0
!
line aux 0
!
line vty 0 4
login
end
右边交换机的配置
Switch#show run
Building configuration...
Current configuration : 1205 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
switchport mode trunk
!
interface FastEthernet0/2
switchport access vlan 20
switchport mode access
!
interface FastEthernet0/3
switchport access vlan 10
switchport mode access
interface Vlan1
no ip address
shutdown
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
end
请大佬帮忙看看,是什么问题。还是说两边不能同时获取到同一VLAN 的地址,谢谢大家!!!!!
子接口的地址换一下吧,两边的网络是同一张网络,IP地址是不能有重复的,除非有NAT。两边的子网一样,路由器不知道数据到底转给谁。希望能够帮助您。 666 666 666 两侧vlan10 和 vlan 20地址重复,R0中继发起的DHCP discover报文源IP地址是子接口IP地址,R1收到discover报文后,因为R1上vlan10和vlan20所在网段和左侧一致,所以回包目的地址是自己直连路由,并不会回传给R0,DHCP交互失败。 {:6_299:} 是的,地址重复了
页:
[1]