试图让 DHCP 在 VLAN 中工作

网络工程 局域网 dhcp 数据包跟踪器
2022-02-21 22:46:28

我正在尝试让 DHCP 在 VLAN 上工作。我有 3 个 VLAN,它们是 .10、.11、.12。

.11 和 .12 工作正常,它们从 DHCP 服务器获取 IP 地址及其相应的网关。

.10 主机正在获取 IP 地址,但没有获取它们的 .10 网关。

我的 DHCP 服务器是 192.168.10.254,连接到 VLAN 10 的 .10 交换机。

这是我为交换机设置的 VLAN 10。什么可能阻止它将所有信息转发到 VLAN 10 主机。

我也已经在 DHCP 服务器中设置了 DHCP 池。

hostname Lan-Switch1
!
!
!
enable secret 5 $1$mERr$nXufIEw80DqfKWVQo3J4O.
enable password 7 080C557E080A16001D1908
!
!
!
!
!
ip routing
!
!
!
!
!
!
!
!
!
!
!
!
ip ssh version 1
ip domain-name man.inishtrahill.ie
ip name-server 192.168.10.254
!
!
spanning-tree mode rapid-pvst
spanning-tree portfast default
spanning-tree vlan 1-4094 priority 24576
!
!
!
!
!
!
interface FastEthernet0/1
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/2
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/3
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/4
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/5
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/6
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/7
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/8
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/9
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/10
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/11
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/12
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/13
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/14
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/15
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/16
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/17
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/18
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/19
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/20
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/21
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/22
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/23
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface FastEthernet0/24
 switchport access vlan 10
 switchport mode access
 spanning-tree portfast
 spanning-tree guard root
!
interface GigabitEthernet0/1
 description Connection to Switch 2 GigabitEthernet0/1
 switchport trunk native vlan 999
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface GigabitEthernet0/2
 description Connection to Switch 3 GigabitEthernet0/1
 switchport trunk native vlan 999
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan10
 description classroom 1 and classroom 2
 ip address 192.168.10.1 255.255.255.0
!
interface Vlan11
 description classroom 3 and classroom 4
 ip address 192.168.11.1 255.255.255.0
 ip helper-address 192.168.10.254
!
interface Vlan12
 description secretary and principal
 ip address 192.168.12.1 255.255.255.0
 ip helper-address 192.168.10.254
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
logging 192.168.10.254
line con 0
 exec-timeout 6 50
 password 7 080C556D061716181E0E
 logging synchronous
 login
!
line aux 0
!
line vty 0 4
 exec-timeout 5 30
 password 7 080C557A0C150B1206
 logging synchronous
 login
line vty 5 15
 exec-timeout 5 30
 password 7 080C557E080A16001D1908
 logging synchronous
 login
!
!
ntp authentication-key 1 md5 0832494D1B1C112713181F13253920 7
ntp server 192.168.10.254 key 0
!
end


Lan-Switch1# 
2个回答

由于您获得了 IP 地址,因此 DHCP 似乎工作正常。必须在 DHCP 服务器上的 DHCP 范围服务器选项中配置 VLAN 的默认网关。

理想情况下,有一个 DHCP 服务器位于唯一的子网上。您只需ip helper-address向每个子网的网关接口添加一个(在 Cisco IOS 术语中),以便 DHCP 广播请求被单播转发到集中式 DHCP 服务器(或服务器集群)。换句话说,您不需要为每个子网部署单个 DHCP 服务器。大多数网络管理员更喜欢从一个盒子管理所有 DHCP 范围,它只是让事情更整洁/更容易。