• 跨交换机划分vlan


    拓扑图

    如图所示,四台交换机的IP地址网段相同,划分vlan后,只有相同vlan的主机才能通信

    因为是跨交换机的vlan划分,所以两台交换机都要配置相同的vlan

    switch 1 配置内容

    Switch>en

    Switch#

    Switch#conf t

    Switch(config)# vlan 10

    Switch(config-vlan)#exit

    Switch(config)#vlan 20

    Switch(config-vlan)#exit

    Switch(config)#int f0/1

    Switch(config-if)#switchport mode access

    Switch(config-if)#switchport access vlan 10

    Switch(config-if)#exit

    Switch(config)#int f0/2

    Switch(config-if)#switchport mode access

    Switch(config-if)#switchport access vlan 20

    Switch(config-if)#exit

    switch 0与switch1的配置内容一致

    划分好vlan后,还需要将两台交换机间的端口设置为trunk模式,不然无法传输除vlan1以外vlan的信息

    使用switchport mode trunk来设置trunk模式

    Switch(config)#int f0/24

    Switch(config-if)#switchport mode trunk

    Switch(config-if)#
    %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down
    %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to up
    Switch(config-if)#
    Switch(config-if)#exit
     
    设置结束后,用ping命令来测试网络连通性
    pc1 ping  pc2

    无法连通

    pc1 ping pc3

    可以通信

  • 相关阅读:
    新建立了个集邮 Blog
    删除8848的mysearch
    VS2005的中国发布会
    免费的PDF生成工具
    FreeBASIC
    今天收到了WinZip发来的免费License
    简洁的 Bash 编程技巧
    benhuan039sblog.wordpress.20121111.xml_.txt
    新浪微博除掉推荐微博
    自制力也是一种力量
  • 原文地址:https://www.cnblogs.com/knightysa/p/9177011.html
Copyright © 2020-2023  润新知