交换机的作用主要有两个:
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. hdu 4059 The Boss on Mars 容斥

    题目链接 求出ai^4+a2^4+......an^4的值, ai为小于n并与n互质的数. 用容斥做, 先求出1^4+2^4+n^4的和的通项公式, 显然是一个5次方程, 然后6个方程6个未知数, 我 ...

  2. cv2.imread BGR模式

    openCV 的cv2.imread()导入图片时是BGR通道顺序,这与Matplotlib的显示,或者读取图片的通道不同,如果需要可以转换为RGB模式,以下代码显示不同之处,但BGR在许多地方使用, ...

  3. OpenCV学习 3:平滑过度与边缘检测

    原创文章,欢迎转载,转载请注明出处  用来记录学习的过程,这个是简单的相关函数的熟悉,内部机制和选择何种选择函数参数才能达到自己的要求还不太清楚,先学者吧..后面会慢慢清楚的.     和前面相比,主 ...

  4. [原创]使用GCC创建 Windows NT 下的内核DLL

    原文链接:使用GCC创建 Windows NT 下的内核DLL 在温习<<Windows 2000 Driving>>分层驱动程序一章的时候,看到了关于紧耦合驱动连接方式,这种 ...

  5. NET Core 的 Views

    NET Core 十种方式扩展你的 Views 原文地址:http://asp.net-hacker.rocks/2016/02/18/extending-razor-views.html作者:Jür ...

  6. windows8设置环境变量

    win8,win8.1如何配置java的环境变量 工具/原料   win8,win8.1 方法/步骤   在你的计算机上右击,选择其中的属性就可以了.如下图所示. 接下来,作出如下图所示的选择. 这个 ...

  7. Oracle EBS-SQL (SYS-24):职责列表

    select B.application_name, TL.responsibility_name from fnd_responsibility_tl tl, fnd_responsibility ...

  8. 占成本85% SSD深度选购教你如何看颗粒

    颗粒是固态硬盘负责容量和传输的介质,在这一方面上与优盘产品是相同的,从外观上看,颗粒占据了整个固态硬盘内部70%左右的空间,其同样做为成本技术,根据厂商的用料不同,成为了固态硬盘内部核心材料. 颗粒的 ...

  9. Cortex-M3学习日志(二)-- 按键实验

    有输出总会有输入,今天测试一下按键的功能,第一节已经说过了与GPIO端口相关的寄存器,这里不在重复,想要从端口读取数据,首先把FIODIR这个寄存器设置为输入,再从FIOPIN寄存器读取数据就可以了, ...

  10. Android之条码扫描二维码扫描

    Android之条码扫描二维码扫描 二维码条形码扫描,参考技术网址: 1.Apache License 2.0 开源的ZXing项目的简化版 http://xinlanzero.iteye.com/b ...