交换机的作用主要有两个:
1.维护CAM(ContextAddress Memory)表,该表是MAC地址和交换机端口的映射表
2.根据CAM进行数据帧的转发

交换机对数据帧的处理有三种:
1.Forward:查询CAM表,有目的计算机所在的端口,且不是入端口
2.Filter:目的端口是入端口
3.Flood:查询不到目的计算机所在端口,或者收到广播帧或者组播帧

以太网交换机转发数据帧有三种交换方式:
1.存储转发(Store-and-Forward)
2.直接转发(Cut-Through)
3.无碎片(Fragment-Free):读取数据帧前64个字节后,开始转发该帧。

1.VLAN的划分
2.VLAN间路由
3.生成树

enable
conf t
no ip do lo
enable pass cisco
line con 0
logg sync
exec-t 0 0
line vty 0 4
pass cisco
logg sync
exit
host

1.VLAN的划分
------------------------------------------------------------------------------

SW1:
vlan database
vlan 2
vlan 3
apply

int f0/1
switchport mode access
switchport access vlan 2
exit

int f0/2
switchport mode access
switchport access vlan 3
exit

R1:
int f0/0
ip add 123.1.1.1 255.255.255.0
no shut
exit

R2:
int f0/0
ip add 123.1.1.1 255.255.255.0
no shut
exit

SW1:
show vlan-switch brief

2.VLAN的路由
--------------------------------------------------------------------------

R1:
int e0/0
no ip address
no shutdown
exit

int e0/0.10
encapsulation dot1Q 10
ip add 10.1.1.1 255.255.255.0
exit

int e0/0.20
encapsulation dot1Q 20
ip add 20.1.1.1 255.255.255.0
exit

SW1:
int f0/10
switchport mode trunk
switchport trunk encapsulation dot1q
no shutdown
exit

end

vlan database
vlan 10
vlan 20
apply
exit

conf t

int f0/1
switchport mode access
switchport access vlan 10
no shutdown
exit

int f0/2
switch mode access
switch access vlan 20
no shutdown
exit

PC1:
no ip routing
int e0/1
ip add 10.1.1.2 255.255.255.0
no shut
exit
ip default-gateway 10.1.1.1

PC2:
no ip routing
int e0/2
ip add 20.1.1.2 255.255.255.0
no shut
exit
ip default-gateway 20.1.1.1

3.生成树
-----------------------------------------------------------------------------

SW1:
int range f0/1 , f0/5
switchport mode trunk
switchport trunk encapsulation dot1q
no shutdown
exit

SW2:
int range f0/2 , f0/5
switchport mode trunk
switchport trunk encapsulation dot1q
no shutdown
exit

SW3:
int range f0/1 , f0/2
switchport mode trunk
switchport trunk encapsulation dot1q
no shutdown
exit

SW1:
vlan database
vlan 2
vtp server
vtp domain yeslab
vtp pass cisco
apply
exit

SW2:
vlan database
vtp client
vtp domain yeslab
vtp pass cisco
apply
exit

SW3:
vlan database
vtp client
vtp domain yeslab
vtp pass cisco
apply
exit

SW1:
show spanning-tree brief

SW1:
spanning-tree vlan 1 priority 4096
spanning-tree vlan 2 priority 8192

SW2:
spanning-tree vlan 2 priority 4096
spanning-tree vlan 1 priority 8192

CCNA实验(6) -- VLAN & SPT的更多相关文章

  1. CCNA实验2.VLAN

    一. 二.配置主VTP上的信息 sw2上配置为domain server,sw1上配置为domain client,sw2上增加vlan并命名和添加描述 conf t vtp domain corp ...

  2. Packet Tracer 5.0 构建CCNA实验(2)—— 配置VLAN

    Packet Tracer 5.0 构建CCNA实验(2)—— 配置VLAN Vlan(Virtual Local Area Network) 即虚拟局域网.VLAN可以把同一个物理网络划分为多个逻辑 ...

  3. 【网络】CCNA实验一:Vlan、Trunk

    要求: 1:不同楼层物理隔离,但逻辑相连 2:相同楼层物理相连,但逻辑隔离 3:主机可以动态获取IP地址 4:不同VLAN间可以进行通信 5:主机最终访问www.esafenet.com弹出" ...

  4. Packet Tracer 5.0 构建CCNA实验(3)—— 路由器实现vlan间通信

    --交换机配置 --交换机和路由器连接的接口 switchport mode trunk --路由器配置 enable conf t int fa0/0.1 --路由器接口的子接口 encapsula ...

  5. CCNA实验4:HDLC和PPP

    一.HDLC封装 router9和11上分别配置s0/0如下 conf t int s0/0 encapsulation hdlc do show int s0/0 ip address x.x.x. ...

  6. CCNA实验1.port-security

    一, 二,MAC地址绑定 3550-1#conf t3550-1(config)#int f0/13550-1(config-if)#switchport mode access /指定端口模式.35 ...

  7. CCNA实验3.单臂路由器

    拓扑图: 一.交换机配置 通过路由器子接口的方式实现vlan之间的路由. conf t vlan 10 vlan 20 int f0/1 switchport access vlan 10 int f ...

  8. CCNA实验(1) -- 基本配置

    Ctrl+A: 到行首(Ahead)Ctrl+E: 到行尾(End)Esc+B: 回退一个单词(Back)Esc+F: 前进一个单词(Forward) 1.三种配置模式2.时间时区配置3.设置超时时间 ...

  9. CCNA实验(2) -- Static Route

    1.静态路由R1:ip route 22.1.1.0 255.255.255.0 12.1.1.2 2.静态汇总路由R1:ip route 22.1.0.0 255.255.0.0 12.1.1.2 ...

随机推荐

  1. leetcode Merge Two Sorted Lists python

    # Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = ...

  2. sp<> 强指针类的用法

    在android 中可以广泛看到的template<typename T>,  class Sp 句柄类实际上是android 为实现垃圾回收机制的智能指针.智能指针是c++ 中的一个概念 ...

  3. MVC3 带查询的分页Helper

    接上篇mvc3 分页Helper. 带查询的分页Helper是在上一篇分页的基础上来的.下面看代码: 首先,在System.Web.Mvc命名空间下的自定义类HtmlPage下面添加一个用于处理“查询 ...

  4. html---id,name和value

    id是唯一标识符,不允许有重复值(类似数据表的主键,pk),可以通过它的值来获得对应的html标签对象.(如果在同一页面代码中,出现重复的id,会导致不可预料的错误) js代码可通过document. ...

  5. Delphi组件开发-在窗体标题栏添加按钮(使用MakeObjectInstance(NewWndProc),并处理好多消息)

    这是一个在窗体标题栏添加自定义按钮的组件(TTitleBarButton)开发实例,标题栏按钮组件TTitleBarButton以TComponent为直接继承对象,它是一个可以在窗体标题栏上显示按钮 ...

  6. Microsoft Azure 在北美 TechEd 大会上发布令人振奋的更新,帮助客户开始使用云服务

    云计算因其速度.规模和成本节省等优势而备受众多企业青睐.但企业需帮助,才能以安全可靠的方式使用云,同时还要利用企业的现有投资, 才能实现这些优势.因此,在TechEd 大会上,我们推出了一些新的服务, ...

  7. 一个基于Qt的截屏程序

    最近有一个arm板上的程序需要重写用户手册,在网上找了许久,没找到合适的截屏工具.于是只好自己动手做一个了. 因为arm板上有已经有了Qt环境,于是想到用 Qt的QPixmap::grabWindow ...

  8. Qt编写端口扫描工具

    Qt提供了QTcpSocket类,可以方便地建立TCP连接.利用这一功能,Maxiee编写了一个简单地端口扫描工具. 软件的功能就是,扫描某一网段的固定端口,如80端口,若目的地址开放了这一端口,那么 ...

  9. 浅谈POSIX线程的私有数据

    当线程中的一个函数需要创建私有数据时,该私有数据在对函数的调用之间保持一致,数据能静态地分配在存储器中,当我们采用命名范围也许可以实现它使用在函数或是文件(静态),或是全局(EXTERN).但是当涉及 ...

  10. 统计分析SQL Server Profiler 跟踪的SQL

    --跟踪文件读入到表中分析 SELECT * INTO ZGSJY FROM fn_trace_gettable('E:\wxxcdbprofiler.trc', default); --某时间内,最 ...