2.配置SVI实现VLAN间路由

小浩 Lv3

一、背景

为减少广播包对网络的影响,网络管理员在公司内网中进行VLAN的划分。完成了VLAN划分后,发现不同VLAN之间无法通信了。如何开启不同VLAN间的通信通道?

二、拓扑图

cisco7

三、配置流程

  1. 在三层交换机上配置两个vlan,vlan10与vlan20

    配置:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    Switch>en

    Switch#conf t

    Enter configuration commands, one per line. End with CNTL/Z.

    Switch(config)#ip routing #打开三层交换机的路由协议

    Switch(config)#vlan 10

    Switch(config-vlan)#exit

    Switch(config)#vlan 20

    Switch(config-vlan)#exit
  2. 在三层交换机上将端口分别划分到各个VLAN上

    配置:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    Switch(config)#interface fastEthernet 0/1

    Switch(config-if)#switchport access vlan 10

    Switch(config-if)#exit

    Switch(config)#interface fastEthernet 0/2

    Switch(config-if)#switchport access vlan 20

    Switch(config-if)#exit
  3. 在三层交换机上给各个vlan配置ip地址

    配置:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    Switch#conf t

    Enter configuration commands, one per line. End with CNTL/Z.

    Switch(config)#int vlan 10

    %LINK-5-CHANGED: Interface Vlan10, changed state to up

    %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan10, changed state to up

    Switch(config-if)#ip address 192.168.10.1 255.255.255.0

    Switch(config-if)#no shutdown

    Switch(config-if)#exit

    Switch(config)#int vlan 20

    %LINK-5-CHANGED: Interface Vlan20, changed state to up

    %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan20, changed state to up

    Switch(config-if)#ip address 192.168.20.1 255.255.255.0

    Switch(config-if)#no shutdown

    Switch(config-if)#exit
  4. 配置PC与验证测试

    4.1 配置PC-PT1

    ip:192.168.10.2

    MASK:255.255.255.0

    Gateway:192.168.10.1

    cisco8

    4.2 配置PC-PT2

    ip:192.168.20.2

    MASK:255.255.255.0

    Gateway:192.168.20.1

    cisco9

4.3 验证测试

​ PC-PT1 ping PC-PT2 ping 192.168.20.2

  • Title: 2.配置SVI实现VLAN间路由
  • Author: 小浩
  • Created at : 2024-04-08 15:40:30
  • Updated at : 2024-06-08 13:52:13
  • Link: https://blog.xh8.shop/2024/04/08/2-配置SVI实现VLAN间路由/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments