1、华为基础实验指导书交换基础实验指导书 ISSUE 1.1实验目的掌握VLAN的基本配置掌握端口的三种类型实验任务VLAN的基本配置Trunk的基本配置VLAN间的互通第1章 VLAN的基本配置1.1 如何登陆到交换机进行配置?请看:1.2 Switch组网及业务描述图1-1 VLAN基本配置上机组网图本实验的主要目的是掌握VLAN的基本配置。在同一交换机内,要求能够达到同一VLAN内的PC可以互通,不同VLAN间的PC不能互通。1.3 命令行列表操 作命 令创建VLANvlan vlan-id alias vlan-alias 删除VLANundo vlan vlan-id |all接口视图下
2、配置接口类型port link-type trunk/access/hybridVLAN视图下将Access类型接口加入VLANport interface-type interface-number1 to interface-number2 &接口视图下配置该端口属于某个VLANport default vlan vlan-id1.4 配置流程图1.5 配置步骤1.5.1 配置各PC的IP地址按照上图连接各实验设备,配置PCA IP地址为10.1.1.2/24,PCB IP地址为10.1.1.3/24,PCC IP地址为10.1.2.2/24,PCD IP地址为10.1.2.3/24。1.
3、5.2 配置VLAN及所属端口创建两个VLAN:VLAN 2和VLAN 3,配置端口Ethernet 0/1到Ethernet0/8属于VLAN2,端口Ethernet0/9到Ethernet0/16属于VLAN3。1.6 结果验证同一VLAN内部的PC可以互相访问,在PCA上ping PCB,结果如下:C:Documents and Settingsx99270ping 10.1.1.3Pinging 10.1.1.3 with 32 bytes of data:Reply from 10.1.1.3: bytes=32 time1ms TTL=128Reply from 10.1.1.3:
4、 bytes=32 time1ms TTL=128Reply from 10.1.1.3: bytes=32 time1ms TTL=128Reply from 10.1.1.3: bytes=32 timeping 10.1.2.3Pinging 10.1.2.3 with 32 bytes of data:Reply from 10.1.2.3: bytes=32 time1ms TTL=128Reply from 10.1.2.3: bytes=32 time1ms TTL=128Reply from 10.1.2.3: bytes=32 time1ms TTL=128Reply fro
5、m 10.1.2.3: bytes=32 timeping 10.1.2.3Pinging 10.1.2.3 with 32 bytes of data:Destination host unreachable.Destination host unreachable.Destination host unreachable.Destination host unreachable.Ping statistics for 10.1.2.3: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss), 1.7 配置参考在交换机上做如下配置:sys
6、tem-viewEnter system view , return user view with Ctrl+Z.Quidwaysysname SwitchSwitchvlan 2Switch-Ethernet0/0/1port link-type accessSwitch-Ethernet0/0/1port default vlan 2Switch-Ethernet0/0/8port link-type accessSwitch-Ethernet0/0/8port default vlan 2Switchvlan 3Switch-Ethernet0/0/9port link-type acc
7、essSwitch-Ethernet0/0/9port default vlan 2Switch-Ethernet0/0/16port link-type accessSwitch-Ethernet0/0/16port default vlan 2第2章 Trunk的基本配置2.1 组网及业务描述2.2 Switch BSwitch A图2-1 Trunk的基本配置上机组网图本实验的主要目的是掌握trunk的基本配置。跨越多台交换机同一VLAN内的主机可以互通。 2.3 命令行列表操 作命 令指定端口类型:trunk, access, hybridport link-type trunk/ac
8、cess/hybrid取消端口类型的设置undo port link-type trunk/access/hybrid设置Trunk端口可以通过的VLANundo port trunk allow-pass vlan vlan-id to vlan-id & | all 显示VLAN的信息display vlan vlan-id /all2.4 配置流程图2.5 配置步骤(1) 配置各PC的IP地址首先按照上图连接各实验设备,然后配置PCA IP地址为10.1.1.2/24,PCB IP地址为10.1.2.2/24,PCC IP地址为10.1.1.3/24,PCD IP地址为10.1.2.3/
9、24。(2) 配置VLAN及所属端口创建两个VLAN:VLAN 2和VLAN 3,配置端口Ethernet 0/1到Ethernet0/8属于VLAN2,端口Ethernet0/9到Ethernet0/16属于VLAN3。(3) 配置交换机之间的端口为Trunk端口,并且允许所能通过的VLAN指定端口Ethernet0/17为Trunk端口,并允许所有VLAN可以通过。2.6 结果验证配置完成后,可以看到,同一VLAN内部的PC可以互相访问,在PCA上ping PCC,结果如下:C:Documents and Settingsx99270ping 10.1.1.3Pinging 10.1.1.
10、3 with 32 bytes of data:Reply from 10.1.1.3: bytes=32 time1ms TTL=128Reply from 10.1.1.3: bytes=32 time1ms TTL=128Reply from 10.1.1.3: bytes=32 time1ms TTL=128Reply from 10.1.1.3: bytes=32 timeping 10.1.2.3Pinging 10.1.2.3 with 32 bytes of data:Destination host unreachable.Destination host unreachab
11、le.Destination host unreachable.Destination host unreachable.Ping statistics for 10.1.2.3: Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),2.7 配置参考2.7.1 配置VLAN及所属端口1. 配置Switch Asystem-viewEnter system view , return user view with Ctrl+Z.Quidwaysysname Switch ASwitch Avlan 2Switch A-Ethernet0/0
12、/1port link-type accessSwitch A-Ethernet0/0/1port default vlan 2Switch A-Ethernet0/0/8port link-type accessSwitch A-Ethernet0/0/8port default vlan 22. 配置Switch Bsystem-viewEnter system view , return user view with Ctrl+Z.Quidwaysysname Switch BSwitch Bvlan 2Switch B-Ethernet0/0/1port link-type acces
13、sSwitch B-Ethernet0/0/1port default vlan 2Switch B-Ethernet0/0/9port link-type accessSwitch B-Ethernet0/0/9port default vlan 22.7.2 配置Trunk端口1. 配置Switch ASwitch A interface Ethernet 0/0/17Switch A-Ethernet0/17 port link-type trunkSwitch A-Ethernet0/17 port trunk allow-pass vlan all /允许所有VLAN通过Trunk端
14、口2. 配置Switch BSwitch B interface Ethernet 0/0/17Switch B-Ethernet0/0/17 port link-type trunkSwitch B-Ethernet0/0/17 port trunk allow-pass vlan all /允许所有VLAN通过Trunk端口第3章 VLAN间的三层互通3.1 Switch ASwitch B组网及业务描述图3-1 VLAN间互通的上机组网图PCA,PCB,PCC.PCD属于不同的vlan, 在SwithcA 上配置去vlan5和vlan6的 静态路由, 在SwithcB 上配置去vlan2
15、和vlan3的 静态路由。3.2 命令行列表操 作命 令进入vlan三层虚接口视图interface vlan-interface vlan-id配置静态路由ip route-static | interface_name | preference reject |backhole 显示路由信息display ip routing-table3.3 配置流程图3.4 配置步骤(4) 配置各PC的IP地址及网关地址首先按照上图连接各实验设备,然后配置PCA IP地址为10.1.2.2/24,网关地址为10.1.2.1/24,PCB IP地址为10.1.3.2/24,网关地址为10.1.3.1/2
16、4,PCC IP地址为10.1.5.2/24,网关地址为10.1.5.1/24,PCD IP地址为10.1.6.2/24,网关地址为10.1.6.1/24。(5) 配置VLAN及所属端口在交换机A上创建三个VLAN:VLAN 2、VLAN 3和VLAN 4,配置端口Ethernet 0/1到端口Ethernet0/8属于VLAN 2,端口Ethernet0/9到Ethernet0/16属于VLAN 3,端口Ethernet0/17属于VLAN 4。在交换机B上创建三个VLAN:VLAN 5、VLAN 6和VLAN 4,配置端口Ethernet 0/1到端口Ethernet0/8属于VLAN 5
17、,端口Ethernet0/9到Ethernet0/16属于VLAN 6,端口Ethernet0/17 属于VLAN 4。(6) 创建三层接口,并配置IP地址在Switch A上创建三个三层虚接口,并配置IP地址VLAN2的IP地址是10.1.2.1,掩码是255.255.255.0 VLAN3的IP地址是10.1.3.1,掩码是255.255.255.0 VLAN4的IP地址是10.1.4.1,掩码是255.255.255.0 在Switch B上创建三个三层虚接口,并配置IP地址VLAN5的IP地址是10.1.5.1,掩码是255.255.255.0 VLAN6的IP地址是10.1.6.1,
18、掩码是255.255.255.0 VLAN4的IP地址是10.1.4.2,掩码是255.255.255.0 在交换机上配置非直连网段静态路由在Switch A上配置两静态路由:ip route-static 10.1.5.0 255.255.255.0 10.1.4.2ip route-static 10.1.6.0 255.255.255.0 10.1.4.2在Switch B上配置两静态路由:ip route-static 10.1.2.0 255.255.255.0 10.1.4.1ip route-static 10.1.3.0 255.255.255.0 10.1.4.13.5 结果
19、验证通过display ip routing-table 查看路由表display ip routing-table Routing Table: public netDestination/Mask Protocol Pre Cost Nexthop Interface10.1.2.0/24 DIRECT 0 0 10.1.2.1 Vlan-interface210.1.2.1/32 DIRECT 0 0 127.0.0.1 InLoopBack010.1.3.0/24 DIRECT 0 0 10.1.3.1 Vlan-interface310.1.3.1/32 DIRECT 0 0 127
20、.0.0.1 InLoopBack010.1.4.0/24 DIRECT 0 0 10.1.4.1 Vlan-interface410.1.4.1/32 DIRECT 0 0 127.0.0.1 InLoopBack010.1.5.0/24 STATIC 60 0 10.1.4.2 Vlan-interface410.1.6.0/24 STATIC 60 0 10.1.4.2 Vlan-interface4127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0 在PCA上
21、ping PCC,可以得到:C:Documents and Settingsx99270ping 10.1.5.2Pinging 10.1.5.2 with 32 bytes of data:Reply from 10.1.5.2: bytes=32 time1ms TTL=126Reply from 10.1.5.2: bytes=32 time1ms TTL=126Reply from 10.1.5.2: bytes=32 time1ms TTL=126Reply from 10.1.5.2: bytes=32 time1ms TTL=126Ping statistics for 10.1
22、.5.2: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms同样,在PCA 上可以ping 通PCC、PCD。全网可互通。3.6 配置参考3.6.1 配置VLAN及所属端口1. 配置Switch Asystem-viewEnter system view , return user view with Ctrl+Z.Quidwaysysname Switch A
23、Switch Avlan batch 2,3,4Switch A-Ethernet0/0/1port link-type accessSwitch A-Ethernet0/0/1port default vlan 2Switch A-Ethernet0/0/8port link-type accessSwitch A-Ethernet0/0/8port default vlan 3Switch A interface Ethernet 0/0/17Switch A-Ethernet0/17 port link-type trunkSwitch A-Ethernet0/17 port trunk
24、 allow-pass vlan all /允许所有VLAN通过Trunk端口2. 配置Switch Bsystem-viewEnter system view , return user view with Ctrl+Z.Quidwaysysname Switch BSwitch Bvlan batch 4,5,6Switch B-Ethernet0/0/1port link-type accessSwitch B-Ethernet0/0/1port default vlan 5Switch B-Ethernet0/0/9port link-type accessSwitch B-Ether
25、net0/0/9port default vlan 6Switch B interface Ethernet 0/0/17Switch B-Ethernet0/17 port link-type trunkSwitch B-Ethernet0/17 port trunk allow-pass vlan all /允许所有VLAN通过Trunk端口3.6.2 创建三层接口1. 配置Switch ASwitch Ainterface Vlanif 2 Switch A-Vlanif 2ip address 10.1.2.1 255.255.255.0 Switch Ainterface Vlani
26、f 3 Switch A-Vlanif 3ip address 10.1.3.1 255.255.255.0 Switch Ainterface Vlanif 4 Switch A-Vlanif 4ip address 10.1.4.1 255.255.255.0 2. 配置Switch BSwitch Binterface Vlanif 5 Switch B-Vlanif 5ip address 10.1.5.1 255.255.255.0 Switch Binterface Vlanif 6 Switch B-Vlanif 6ip address 10.1.6.1 255.255.255.
27、0 Switch Binterface Vlanif 4 Switch B-Vlanif 4ip address 10.1.4.2 255.255.255.03.6.3 配置静态路由1. 配置Switch ASwitch Aip route-static 10.1.5.0 255.255.255.0 10.1.4.2Switch Aip route-static 10.1.6.0 255.255.255.0 10.1.4.22. 配置Switch BSwitch Bip route-static 10.1.2.0 255.255.255.0 10.1.4.1Switch Bip route-static 10.1.3.0 255.255.255.0 10.1.4.1
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2