配置跨交换机中继链路 - VLAN划分与主机互通

本文将介绍如何在两个交换机上配置跨交换机中继链路,实现同一VLAN内的主机互通。假设两个交换机加入同一个VTP域,一个为Server,一个为Client。

步骤:

  1. 创建VLAN
    • 在VTP Server上创建VLAN 2、VLAN 3。

enable configure terminal vlan 2 name VLAN2 exit vlan 3 name VLAN3 exit


2. **接口划分**
   - 将规划的接口划入相应的VLAN。
   - 例如:接口Gi1/0/1和Gi1/0/2属于VLAN 2,接口Gi1/0/3、Gi1/0/4和Gi1/0/5属于VLAN 3。

interface GigabitEthernet1/0/1 switchport mode access switchport access vlan 2 exit interface GigabitEthernet1/0/2 switchport mode access switchport access vlan 2 exit interface GigabitEthernet1/0/3 switchport mode access switchport access vlan 3 exit interface GigabitEthernet1/0/4 switchport mode access switchport access vlan 3 exit interface GigabitEthernet1/0/5 switchport mode access switchport access vlan 3 exit


3. **VTP Client配置**
   - 登录到VTP Client交换机,并进入全局配置模式。
   - 将规划的接口划入相应的VLAN,与VTP Server上的配置相同。

enable configure terminal interface GigabitEthernet1/0/1 switchport mode access switchport access vlan 2 exit interface GigabitEthernet1/0/2 switchport mode access switchport access vlan 2 exit interface GigabitEthernet1/0/3 switchport mode access switchport access vlan 3 exit interface GigabitEthernet1/0/4 switchport mode access switchport access vlan 3 exit interface GigabitEthernet1/0/5 switchport mode access switchport access vlan 3 exit


4. **VTP同步**
   - 确保VTP Server和VTP Client的VTP域名称、VTP密码和VTP版本相同。

5. **子网划分**
   - 确定子网位数和子网掩码。
   - 假设子网掩码为255.255.255.0。

6. **地址分配**
   - 根据子网掩码和主机数量,为每个子网分配一个唯一的子网地址。

7. **网关配置**
   - 确定每个子网的网关。
   - 假设每个子网的网关地址可以是对应子网地址的第一个可用地址。

8. **VLAN主机配置**
   - 配置每个VLAN的主机地址和网关。
   - 假设VLAN 2的主机地址范围为192.168.209.10-192.168.209.20,VLAN 3的主机地址范围为192.168.209.30-192.168.209.40。
   - 在VTP Server上配置VLAN 2的主机地址和网关:

interface Vlan2 ip address 192.168.209.10 255.255.255.0 exit

   - 在VTP Client上配置VLAN 2的主机地址和网关:

interface Vlan2 ip address 192.168.209.11 255.255.255.0 exit

   - 在VTP Server上配置VLAN 3的主机地址和网关:

interface Vlan3 ip address 192.168.209.30 255.255.255.0 exit

   - 在VTP Client上配置VLAN 3的主机地址和网关:

interface Vlan3 ip address 192.168.209.31 255.255.255.0 exit


9. **主机配置**
   - 在每个VLAN的主机上配置相应子网的地址和网关,确保同一VLAN的主机能够互相ping通。

**示例:**

- 交换机1(VTP Server):192.168.209.4,有两个主机,主机1是192.168.209.13,主机2是192.168.209.14。
- 交换机2(VTP Client):192.168.209.5,有三个主机,主机3是192.168.209.15,主机4是192.168.209.16,主机5是192.168.209.17。

**完成以上步骤后,应该能够实现同一VLAN内的主机互相ping通。**
配置跨交换机中继链路 - VLAN划分与主机互通

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

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