跨交换机中继链路配置及VLAN间通信指南

目标

本指南将指导您完成跨两个 Cisco 交换机的中继链路配置,并设置 VLAN 间通信。

拓扑结构

本指南使用以下拓扑结构:

  • 交换机 1: * IP 地址: 192.168.209.4 * 主机 1: 192.168.209.13 (VLAN 2) * 主机 2: 192.168.209.14 (VLAN 2)* 交换机 2: * IP 地址: 192.168.209.5 * 主机 3: 192.168.209.15 (VLAN 3) * 主机 4: 192.168.209.16 (VLAN 3) * 主机 5: 192.168.209.17 (VLAN 3)

配置步骤

1. 配置 VTP

  • 在 VTP Server (交换机 1) 上:

enableconfigure terminalvtp mode servervtp domain <域名>vtp password <密码>end

  • 在 VTP Client (交换机 2) 上:

enableconfigure terminalvtp mode clientvtp domain <域名>vtp password <密码>end

2. 创建 VLAN

  • 在 VTP Server (交换机 1) 上:

enableconfigure terminalvlan 2name VLAN2exitvlan 3name VLAN3end

3. 分配接口到 VLAN

  • 在交换机 1 上:

enableconfigure terminalinterface <连接主机 1 和 2 的接口编号>switchport mode accessswitchport access vlan 2end

  • 在交换机 2 上:

enableconfigure terminalinterface <连接主机 3、4 和 5 的接口编号>switchport mode accessswitchport access vlan 3end

4. 划分子网

  • 子网掩码: 255.255.255.0 (/24)

  • 子网:

    • VLAN 2: 192.168.209.0 * 可用地址范围: 192.168.209.1 - 192.168.209.126 * 网关: 192.168.209.1

    • VLAN 3: 192.168.209.128 * 可用地址范围: 192.168.209.129 - 192.168.209.254 * 网关: 192.168.209.129

5. 配置 VLAN 接口 IP 地址

  • 在交换机 1 上:

enableconfigure terminalinterface vlan 2ip address 192.168.209.1 255.255.255.0no shutdownend

  • 在交换机 2 上:

enableconfigure terminalinterface vlan 3ip address 192.168.209.129 255.255.255.0no shutdownend

6. 验证配置

确保同一 VLAN 中的主机可以相互 ping 通。例如:

  • 从主机 1 (192.168.209.13) ping 主机 2 (192.168.209.14)* 从主机 3 (192.168.209.15) ping 主机 5 (192.168.209.17)

总结

通过完成上述步骤,您已成功配置了跨两个交换机的 VLAN 中继链路,并实现了不同 VLAN 间的主机通信。请记住根据您的网络环境修改 IP 地址、子网掩码和其他配置参数。

跨交换机中继链路配置及VLAN间通信指南

原文地址: https://www.cveoy.top/t/topic/dUlV 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录