eNSP学习——利用三层交换机实现VLAN间路由

目录

背景

实验内容

实验目的

实验步骤

实验拓扑

实验编址

实验步骤

基本配置

配置三层交换机实现VLAN间通信


背景

        虽说单臂路由可以实现不同VLAN之间主机的通信,但该技术存在一些局限性,比如带宽、转发效率等。
    三层交换机在原有二层交换机的基础上增加了路由功能,同时由于数据没有像单臂路由那样经过物理线路进行路由,可以很好的解决带宽瓶颈的问题。
    VLANIF接口是基于网络层的接口,可以配置IP地址。借助VLANIF接口,三层交换机就能实现路由转发功能。

实验内容

        本实验模拟企业网络。公司有销售部和客服部两个部门,分别使用VLAN 10和VLAN 20.所有终端都通过核心交换机相连。现需要让两个部门之间的主机可以相互通信。

实验目的

    1、掌握配置VLANIF接口的方法;
    2、理解数据包跨VLAN路由的原理;
    3、掌握测试多层交换网络连通性的方法。

实验步骤

1、基本配置;
2、配置三层交换机实现VLAN间通信;

实验拓扑

eNSP学习——利用三层交换机实现VLAN间路由_第1张图片

实验编址

设备        接口 IP地址 子网掩码 网关
PC1 Ethernet 0/0/1 192.168.1.1 255.255.255.0 192.168.1.254
PC2 Ethernet 0/0/1 192.168.1.2 255.255.255.0 192.168.1.254
PC3 Ethernet 0/0/1 192.168.2.1 255.255.255.0 192.168.2.254
S1 VLANIF 10 192.168.1.254 255.255.255.0 N/A 
VLANIF 20 192.168.2.254 255.255.255.0 N/A 

实验步骤

基本配置

        按照实验编址对各个PC进行基本的IP地址配置。(记得测试连通性:PC1和PC2通,PC1和PC2不通)此处仅以PC1为例

eNSP学习——利用三层交换机实现VLAN间路由_第2张图片

配置三层交换机实现VLAN间通信

第二步:配置三层交换机实现VLAN间通信
sys
[Huawei]sysname S1
[S1]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1]interface g0/0/1	
[S1-GigabitEthernet0/0/1]port link-type access
[S1-GigabitEthernet0/0/1]port default vlan 10
[S1-GigabitEthernet0/0/1]interface g0/0/2
[S1-GigabitEthernet0/0/2]port link-type access
[S1-GigabitEthernet0/0/2]port default vlan 10
[S1-GigabitEthernet0/0/2]interface g0/0/3
[S1-GigabitEthernet0/0/3]port link-type access
[S1-GigabitEthernet0/0/3]port default vlan 20

在三层交换机上配置VLANIF接口
[S1-GigabitEthernet0/0/3]interface vlanif 10   //指定VLANIF接口所对应的VLAN ID为10
[S1-Vlanif10]ip address 192.168.1.254 24     //在接口视图下配置IP地址
[S1-Vlanif10]interface vlanif 20
[S1-Vlanif20]ip address 192.168.2.254 24


[S1-Vlanif20]display ip interface brief   //查看接口状态
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2

Interface                         IP Address/Mask      Physical   Protocol  
MEth0/0/1                         unassigned           down       down      
NULL0                             unassigned           up         up(s)     
Vlanif1                           unassigned           down       down      
Vlanif10                          192.168.1.254/24     up         up        
Vlanif20                          192.168.2.254/24     up         up        
[S1-Vlanif20]q
[S1]

此时再分别测试PC1与PC2和PC3之间的连通性。(都是通的)
再在PC1上查看ARP信息
PC>arp -a

Internet Address    Physical Address    Type
192.168.1.254       4C-1F-CC-44-2F-1F   dynamic

你可能感兴趣的:(华为,#,交换机相关,学习,网络,服务器)