VLAN间路由

网络工程 路由 转变 VLAN 第3层 切换模式
2021-07-04 05:50:50

我正在尝试配置 VLAN 间路由,但无法使用 MLS 进行路由。我附上了图片。请检查并给出答案。

在 switch0 中,我创建了 VLAN 2 和 4;在交换机 1 中只有 VLAN 3;在 switch2 VLAN 5 和 6 中。我想在所有 VLAN 之间进行通信。请告诉我 L3 交换机中的配置。由于缺乏知识,我没有配置。

请参考图片并给我答复,谢谢。

这些是我提供给相应 VLAN 的 IP 地址:

  • VLAN 2 IP = 192.168.11.0
  • VLAN 3 IP = 192.168.12.0
  • VLAN 4 IP = 192.168.13.0
  • VLAN 5 IP = 192.168.14.0
  • VLAN 6 IP = 192.168.15.0 在此处输入图片说明

三层交换机配置:

ip routing 
! 
spanning-tree mode pvst 
! 
interface FastEthernet0/1
 switchport trunk encapsulation dot1q
 switchport mode trunk 
! 
interface FastEthernet0/2
 switchport trunk encapsulation dot1q
 switchport mode trunk 
! 
interface FastEthernet0/3
 switchport trunk encapsulation dot1q
 switchport mode trunk 
! 
! 
interface Vlan1
 no ip address
 shutdown 
interface Vlan2
 ip address 192.168.11.100 255.255.255.0
interface Vlan4
 ip address 192.168.13.100 255.255.255.0 
interface Vlan5
 ip address 192.168.14.100 255.255.255.0 
interface Vlan6
 ip address 192.168.15.100 255.255.255.0 
ip classless

交换机 0 配置:

SW0#sh run
Building configuration...

Current configuration : 1163 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname SW0
!
!
!
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
 switchport access vlan 2
 switchport mode access
!
interface FastEthernet0/2
 switchport access vlan 4
 switchport mode access
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
 switchport mode trunk
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
 no ip address
 shutdown
!
!
!
!
line con 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
end              

交换机 1 配置:

SW1>
SW1>en
SW1#sh run
Building configuration...

Current configuration : 1290 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname SW1
!
!
!
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
 switchport access vlan 3
 switchport mode access
!
interface FastEthernet0/2
 switchport access vlan 3
 switchport mode access
!
interface FastEthernet0/3
 switchport access vlan 3
 switchport mode access
!
interface FastEthernet0/4
 switchport access vlan 3
 switchport mode access
!
interface FastEthernet0/5
 switchport access vlan 3
 switchport mode access
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
 no ip address
 shutdown
!
!
!
!
line con 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
end

交换机2配置:

SW2#sh run
Building configuration...

Current configuration : 1140 bytes
!
version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname SW2
!
!
!
!
!
spanning-tree mode pvst
!
interface FastEthernet0/1
 switchport access vlan 5
 switchport mode access
!
interface FastEthernet0/2
 switchport access vlan 6
 switchport mode access
!
interface FastEthernet0/3
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
 no ip address
 shutdown
!
!
!
!
line con 0
!
line vty 0 4
 login
line vty 5 15
 login
!
!
end
4个回答

将每个 VLAN 配置为“不关闭”。确保 VLAN 处于活动状态。“Conf t”和类型“vlan 2”,看看是否会启动 VLAN。对其余 VLAN 执行此操作。

确保每台交换机都配置了所有 VLAN,否则您将无法中继这些 VLAN。

这应该可以解决您的问题...

您仍然需要在 L3 交换机上配置 VLAN 3 SVI。

您还需要在所有三个 L2 交换机的 Fa0/24 上设置中继模式和封装。

所有交换机的配置都相同。根据您的问题和图表,我认为您需要将第 2 层接入交换机的配置更改为如下所示(对于底部图中最左侧的第 2 层交换机):

version 12.2
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname L2SWITCH0
!
no ip routing
!
spanning-tree mode pvst
!
interface FastEthernet0/1
 no switchport trunk encapsulation dot1q
 no switchport mode trunk
 switchport access VLAN 2
 switchport mode access
!
interface FastEthernet0/2
 no switchport trunk encapsulation dot1q
 no switchport mode trunk
!
interface FastEthernet0/3
 no switchport trunk encapsulation dot1q
 no switchport mode trunk
!
interface FastEthernet0/4
 no switchport trunk encapsulation dot1q
 no switchport mode trunk
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
 switchport access VLAN 4
 switchport mode access
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
 no ip address
 shutdown
!
interface Vlan2
 no ip address 192.168.11.100 255.255.255.0
!
interface Vlan3
 no ip address 192.168.12.100 255.255.255.0
!
interface Vlan4
 no ip address 192.168.13.100 255.255.255.0
!
interface Vlan5
 no ip address 192.168.14.100 255.255.255.0
!
interface Vlan6
 no ip address 192.168.15.100 255.255.255.0
!
ip classless
!
ip flow-export version 9
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
end

每个 IDF 交换机都需要将 1999 年的 FastEthernet 设置为 802.1q 中继和中继模式(以计算核心 L3 交换机上的另一端)。每个 IDF 都运行到核心第 3 层交换机,因此不要启用任何额外的 STP。如果某些内容是默认的,则可能会保留它,否则将关闭所有 STP。每个交换机都需要通过 VLAN 数据库或 VTP 的手动配置来查看所有 VLAN。

您还需要为每个 IDF 交换机分配一个 int VLAN1 上的 IP 地址以进行管理,并且可以配置 telnet 或 SSH 访问。