我在使用非常简单的 DHCP 侦听配置时遇到了一些问题。
我正在使用一个非常简单的拓扑,使用棒上的路由器。我使用 VLAN 10 和 VLAN 20。
当我的交换机上未启用 dhcp snooping 时,我的客户端可以从我的路由器获取 DHCP,但是当我启用 snooping 时,他们无法再获得 IP。
我的交换机有接口 f0/6 和 f0/11 作为接入端口,f0/6 在 vlan 10 上,f0/11 在 vlan 20 上。f0/1 处于中继模式。
我的交换机配置:
Switch DHCP snooping is enabled
DHCP snooping is configured on following VLANs:
1-100
Insertion of option 82 is enabled
Option 82 on untrusted port is not allowed
Verification of hwaddr field is enabled
Interface Trusted Rate limit (pps)
----------------------- ------- ----------------
FastEthernet0/1 yes unlimited
未启用 DHCP 侦听时我有完全连接,所以我只是问为什么启用侦听时它不起作用。
我在交换机上的“显示运行”配置:
!
ip dhcp relay information trust-all
!
ip dhcp snooping vlan 1-100
ip dhcp snooping
!
interface FastEthernet0/1
switchport trunk native vlan 99
ip dhcp snooping trust
switchport mode trunk
!
interface FastEthernet0/6
switchport access vlan 10
switchport mode access
!
interface FastEthernet0/11
switchport access vlan 20
switchport mode access
!
interface Vlan1
no ip address
shutdown
!
interface Vlan10
no ip address
ip helper-address 192.168.1.1
!
interface Vlan20
no ip address
ip helper-address 192.168.2.1
!
interface Vlan99
ip address 192.168.99.99 255.255.255.0
!
end
我在路由器上的“显示运行”配置:
ip dhcp relay information trust-all
!
ip dhcp excluded-address 192.168.1.1
ip dhcp excluded-address 192.168.2.1
!
ip dhcp pool VLAN10
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
ip dhcp pool VLAN20
network 192.168.2.0 255.255.255.0
default-router 192.168.2.1
!
interface GigabitEthernet0/0.10
encapsulation dot1Q 10
ip address 192.168.1.1 255.255.255.0
!
interface GigabitEthernet0/0.20
encapsulation dot1Q 20
ip address 192.168.2.1 255.255.255.0