实验目的:学习和分析单臂路由
 
实验原理:大家都知道vlan之间是不能互相通讯的,我们可以通过路由器来让两个不同的vlan之间通讯,叫单臂路由,如果是三层交换机也可以用三层交换来实现。
 
实验拓扑:
 

实验步骤:
1.为各个PC配置IP 以及网关:
PC0:192.168.1.2/24 GW:192.168.1.1
PC1:192.168.2.2/24 GW:192.168.2.1
PC2:192.168.1.3/24 GW:192.168.1.1
PC3:192.168.2.3/24 GW:192.168.2.1 
2. 交换机上的配置
SW0上的配置:
新建VLAN2和VLAN3
把端口Fa0/2, Fa0/3的访问模式设置为静态访问模式(switchport mode acc)
把端口Fa0/2加入VLAN2 ;  Fa0/3加入VLAN3
把端口Fa0/1设置为Trunk模式 ,Fa0/4也必须设置为Trunk模式
Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#vlan 3
Switch(config-vlan)#name v3
Switch(config-vlan)#exit
Switch(config)#vlan 2
Switch(config-vlan)#name v2
Switch(config-vlan)#^Z
%SYS-5-CONFIG_I: Configured from console by console
Switch#show vlan
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24
                                                Gig1/1, Gig1/2
2    v2                               active   
3    v3                               active   
1002 fddi-default                     active   
1003 token-ring-default               active   
1004 fddinet-default                  active   
1005 trnet-default                    active   
VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0
2    enet  100002     1500  -      -      -        -    -        0      0
3    enet  100003     1500  -      -      -        -    -        0      0
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int fa0/2
Switch(config-if)#sw
Switch(config-if)#switchport mode acc
Switch(config-if)#switchport mode access
Switch(config-if)#sw
Switch(config-if)#switchport acc vlan 2
Switch(config-if)#no sh
Switch(config-if)#no shutdown
Switch(config-if)#int fa0/3
Switch(config-if)#sw
Switch(config-if)#switchport mode acc
Switch(config-if)#sw acc vlan 3
Switch(config-if)#no sh
Switch(config-if)#no shutdown
Switch(config-if)#int fa0/1
Switch(config-if)#sw
Switch(config-if)#switchport mode trun
Switch(config-if)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Switch(config-if)#
Switch(config-if)#no sh
Switch(config-if)#no shutdown
Switch(config-if)#int fa0/4
Switch(config-if)#sw mode tru
Switch(config-if)#sw mode trunk
Switch(config-if)#no sh
Switch(config-if)#no shutdown
SW1上的配置:
新建VLAN2和VLAN3
把端口Fa0/2, Fa0/3的访问模式设置为静态访问模式(switchport mode acc)
把端口Fa0/2加入VLAN2 ;  Fa0/3加入VLAN3
把端口Fa0/1,设置为Trunk模式
同理配置如SW0.
3.路由器的配置:
配置接口Fa0/0 打开该端口
配置Fa0/0的子接口 Fa0/0.1 Fa0/0.2 
Fa0/0.1 配置IP为:192.168.1.1 并且封装802.1Q
Fa0/0.2 配置IP为:192.168.2.1 并且封装802.1Q
先打开父端口fa0/0
Router(config)#int fa0/0
Router(config-if)#no sh
Router(config-if)#no shutdown
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

配置子端口 先封装802.1Q 再配置IP 才有效 
Router(config)#int fa0/0.1
Router(config-subif)#en
Router(config-subif)#encapsulation do
Router(config-subif)#encapsulation dot1Q 2
Router(config-subif)#ip add 192.168.1.1 255.255.255.0
Router(config-subif)#no sh
Router(config)#int fa0/0.2
%LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to up
Router(config-subif)#
Router(config-subif)#en
Router(config-subif)#encapsulation do
Router(config-subif)#encapsulation dot1Q 3
Router(config-subif)#ip add 192.168.2.1 255.255.255.0
Router(config-subif)#no sh

转载于:https://blog.51cto.com/linking/132145

CCNA之单臂路由实验相关推荐

  1. 用boson做vlan的单臂路由实验

    用boson做vlan的单臂路由实验 2007-11-22 09:04 这次用boson做的vlan单臂路由实验比较简单,有人说用Dynamips说比较真实,可是vlan小实验用boson做已经足够了 ...

  2. 华为路由三层交互:单臂路由实验

    一.实验拓扑 二.概述解释 前面我们学到VLAN,我们知道,同一VLAN的计算机之间是可以进行二层通信的,而不同VLAN的计算机是无法进行通信的. 虽然,不同VLAN不能通信,但并不代表就没办法通信, ...

  3. 实验六 交换机TRUNK口和单臂路由实验

    文章目录 一.实验目的 二.实验的网络拓扑结构图 三.实验内容 1.交换机VLAN实验 2.交换机TRUNK口实验 3.单臂路由实验 一.实验目的 1.理解交换机VLAN口的工作原理: 2.理解交换机 ...

  4. 华为交换机链路聚合与静态路由 ,三层交换机代替单臂路由实验

    一,链路捆绑 1,目的 实现高宽带传输速率 2,实验步骤 拓扑图 配置IP地址 PC1:192.168.1.2 PC2: 192.168.1.23 交换机配置 SW1: vlan 2interface ...

  5. 利用单臂路由实验VLAN间路由

    拓扑图 命令 初始化: S2: sys sysname S2 vlan 10 description HR vlan 20 description Market int e0/0/1 port lin ...

  6. 单臂路由实验(cisco packet tracer 5.2)

    下图是本次实验的拓扑图,所用的模拟器为CISCO PACKET TRACER 5.2版本. 按照如果图所示的拓扑搭建好网络.PC1的IP地址为:192.168.1.2 PC2的IP地址为:192.16 ...

  7. 单臂路由实验-VTP

    步骤0--配置PC: 分别按图中参数,配置两台PC机. 步骤1--启用trunk:在server f0/1 f0/2 f0/3 启用trunk                              ...

  8. nat,acl及单臂路由实验(ensp)

    拓扑: S1: 添加vl10 添加vl20 all:所有 <Huawei>sy Enter system view, return user view with Ctrl+Z. [Huaw ...

  9. Cisco单臂路由实验

    重拾记忆的碎片我只是不想遗忘曾经的网络 配置子接口要先封装协议再配ip Router#show run Building configuration... Current configuration ...

最新文章

  1. Ignoring unused library classes...java.io.IOException: You have to specify '-keep' options for the s
  2. resttemplate 文件上传 上传文件
  3. 熟练掌握Word2003中的突出显示功能
  4. Cisco PT模拟实验(12) 路由器静态路由的配置
  5. dos命令行设置网络优先级_计算机网络故障及其维修方法
  6. 数据分析:度量数据散布的四分位数
  7. Poj 1284 Primitive Roots
  8. [No000014A]Linux简介与shell编程
  9. 开源项目如何挣钱? Spark 商业化公司创始人曝光心路历程
  10. 输出有样式的php,PHP导出带样式的Excel
  11. 【汇编优化】之X86汇编优化
  12. 从一个实例(整数幂指数)进行算法时间复杂度的分析
  13. 33.启动流程,模块管理与 Loader
  14. sentinel3数据批量下载——sentinelsat
  15. 关于boot.ini文件里的/noexecute=optin
  16. C#中另类自定义公式计算 字符串转换为计算公式,并得出计算结果【转载】
  17. 卡巴斯基最新激活码、授权文件,可用卡巴斯基
  18. Python 智能银行卡识别系统的实现 (2)—系统的实现
  19. Feb14 小白《Linux就该这么学》学习笔记1
  20. 三国演义人名爬取与处理

热门文章

  1. 我所理解的性能测试是什么?
  2. java封装为so,java挪用.so文件
  3. python里的pip有什么用_python的pip有什么用
  4. linux kvm图标需要安装的软件,KVM 图形化安装
  5. python3没有decode_我如何在Python3中使用.decode('string-escape')?
  6. 零基础学web前端难吗?新手该怎么学?
  7. python与室内设计_基于树莓派和Python的智能家居系统设计
  8. python爬虫怎么挣钱_买不到口罩怎么办?Python爬虫帮你时刻盯着自动下单!| 原力计划...
  9. java final resource_java 中的常量定义,final 的问题
  10. PSIM软件学习---07 元件参数动态扫描