华为eNSP配置access、trunk、hybrid接口的配置实验

拓扑图如下:

(1)sw1的配置:

<Huawei>
<Huawei>system-view            //切换到系统视图
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname sw1             //配置主机名
Oct 25 2019 16:29:31-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 4, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1]vlan batch 10 20            //创建vlan10 、vlan20
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw1]display vlan               //查看vlan
Oct 25 2019 16:30:21-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 5, the c
hange loop count is 0, and the maximum number of records is 4095.
The total number of vlans is : 3
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------

VID  Type    Ports
--------------------------------------------------------------------------------
1    common  UT:Eth0/0/1(U)     Eth0/0/2(U)     Eth0/0/3(D)     Eth0/0/4(D)
                Eth0/0/5(D)     Eth0/0/6(D)     Eth0/0/7(D)     Eth0/0/8(D)
                Eth0/0/9(D)     Eth0/0/10(D)    Eth0/0/11(D)    Eth0/0/12(D)
                Eth0/0/13(D)    Eth0/0/14(D)    Eth0/0/15(D)    Eth0/0/16(D)
                Eth0/0/17(D)    Eth0/0/18(D)    Eth0/0/19(D)    Eth0/0/20(D)
                Eth0/0/21(D)    Eth0/0/22(D)    GE0/0/1(U)      GE0/0/2(U)      

10   common                  //vlan10
20   common                  //vlan20

VID  Status  Property      MAC-LRN Statistics Description
--------------------------------------------------------------------------------

1    enable  default       enable  disable    VLAN 0001
10   enable  default       enable  disable    VLAN 0010
20   enable  default       enable  disable    VLAN 0020
[sw1]
[sw1]int e0/0/1                    //切换接口
[sw1-Ethernet0/0/1]port hybrid pvid vlan 10            //hybrid口的pvid配置
[sw1-Ethernet0/0/1]
Oct 25 2019 16:30:51-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 6, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/1]port hybrid untagged vlan 10    //hybrid口的untapped表配置
[sw1-Ethernet0/0/1]
Oct 25 2019 16:32:11-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 7, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/1]
[sw1-Ethernet0/0/1]undo shutdown           //开启接口
Info: Interface Ethernet0/0/1 is not shutdown.
[sw1-Ethernet0/0/1]
[sw1-Ethernet0/0/1]int e0/0/2            //切换接口
[sw1-Ethernet0/0/2]
[sw1-Ethernet0/0/2]port hybrid pvid vlan 20            //hybrid口的pvid配置
[sw1-Ethernet0/0/2]
Oct 25 2019 16:32:41-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 8, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/2]port hybrid untagged vlan 20    //hybrid口的untapped表配置
[sw1-Ethernet0/0/2]
[sw1-Ethernet0/0/2]undo shutdown           //开启接口
Info: Interface Ethernet0/0/2 is not shutdown.
[sw1-Ethernet0/0/2]
Oct 25 2019 16:33:11-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 9, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/2]int g0/0/1       //切换接口
[sw1-GigabitEthernet0/0/1]port link-type access               //配置接口类型access
[sw1-GigabitEthernet0/0/1]port default vlan 10                //接口添加到vlan10
[sw1-GigabitEthernet0/0/1]
Oct 25 2019 16:34:41-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 11, the
change loop count is 0, and the maximum number of records is 4095.
[sw1-GigabitEthernet0/0/1]undo shutdown                //开启接口
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[sw1-GigabitEthernet0/0/1]int g0/0/2                   //切换接口
[sw1-GigabitEthernet0/0/2]
[sw1-GigabitEthernet0/0/2]port hybrid tagged vlan 10 20      //配置hybrid口的tagged表
[sw1-GigabitEthernet0/0/2]
[sw1-GigabitEthernet0/0/2]
Oct 25 2019 16:35:51-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 12, the
change loop count is 0, and the maximum number of records is 4095.
[sw1-GigabitEthernet0/0/2]
[sw1-GigabitEthernet0/0/2]undo shutdown       //开启接口
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[sw1-GigabitEthernet0/0/2]
[sw1-GigabitEthernet0/0/2]
[sw1-GigabitEthernet0/0/2]display this                  //查看当前视图配置信息
#
interface GigabitEthernet0/0/2
 port hybrid tagged vlan 10 20
#
return
[sw1-GigabitEthernet0/0/2]quit       //退出

(2)sw2的配置


<Huawei>system-view             //切换到系统视图
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname sw2                //配置主机名
Oct 25 2019 16:37:22-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 4, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw2]vlan batch 10 20                      //创建vlan10、vlan20
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw2]dis vlan
The total number of vlans is : 3
--------------------------------------------------------------------------------
U: Up;         D: Down;         TG: Tagged;         UT: Untagged;
MP: Vlan-mapping;               ST: Vlan-stacking;
#: ProtocolTransparent-vlan;    *: Management-vlan;
--------------------------------------------------------------------------------

VID  Type    Ports
--------------------------------------------------------------------------------
1    common  UT:Eth0/0/1(U)     Eth0/0/2(U)     Eth0/0/3(D)     Eth0/0/4(D)
                Eth0/0/5(D)     Eth0/0/6(D)     Eth0/0/7(D)     Eth0/0/8(D)
                Eth0/0/9(D)     Eth0/0/10(D)    Eth0/0/11(D)    Eth0/0/12(D)
                Eth0/0/13(D)    Eth0/0/14(D)    Eth0/0/15(D)    Eth0/0/16(D)
                Eth0/0/17(D)    Eth0/0/18(D)    Eth0/0/19(D)    Eth0/0/20(D)
                Eth0/0/21(D)    Eth0/0/22(D)    GE0/0/1(U)      GE0/0/2(U)      

10   common                             //vlan10
20   common                             //vlan20

VID  Status  Property      MAC-LRN Statistics Description
--------------------------------------------------------------------------------

1    enable  default       enable  disable    VLAN 0001
10   enable  default       enable  disable    VLAN 0010
20   enable  default       enable  disable    VLAN 0020
[sw2]
Oct 25 2019 16:37:52-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 5, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw2]int e0/0/1             //切换接口视图
[sw2-Ethernet0/0/1]port link-type access          //配置接口类型为access
Oct 25 2019 16:38:32-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 6, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw2-Ethernet0/0/1]port default vlan 10            //接口加入到vlan10
[sw2-Ethernet0/0/1]undo shutdown                  //开启接口
Info: Interface Ethernet0/0/1 is not shutdown.
Oct 25 2019 16:38:52-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 7, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw2-Ethernet0/0/1]int e0/0/2              //切换接口
[sw2-Ethernet0/0/2]
[sw2-Ethernet0/0/2]port link-type access       //配置接口类型为access
[sw2-Ethernet0/0/2]
[sw2-Ethernet0/0/2]port default vlan 20             //接口加入vlan20
Oct 25 2019 16:39:12-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 8, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw2-Ethernet0/0/2]undo shutdown                   //开启接口
Info: Interface Ethernet0/0/2 is not shutdown.
Oct 25 2019 16:39:22-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 9, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw2-Ethernet0/0/2]int g0/0/1                //切换接口
[sw2-GigabitEthernet0/0/1]
[sw2-GigabitEthernet0/0/1]port link-type access        //配置接口类型为access
Oct 25 2019 16:40:02-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 10, the
change loop count is 0, and the maximum number of records is 4095.
[sw2-GigabitEthernet0/0/1]port default vlan 20         //接口加入vlan20
[sw2-GigabitEthernet0/0/1]
[sw2-GigabitEthernet0/0/1]undo shutdown             //开启接口
Oct 25 2019 16:40:12-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 11, the
change loop count is 0, and the maximum number of records is 4095.
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[sw2-GigabitEthernet0/0/1]
Oct 25 2019 16:41:02-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 12, the
change loop count is 0, and the maximum number of records is 4095.
[sw2-GigabitEthernet0/0/2]int g0/0/2                 //切换接口
[sw2-GigabitEthernet0/0/2]
Oct 25 2019 16:45:52-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 13, the
change loop count is 0, and the maximum number of records is 4095.
[sw2-GigabitEthernet0/0/2]
[sw2-GigabitEthernet0/0/2]port link-type trunk        //配置接口类型为trunk
[sw2-GigabitEthernet0/0/2]
Oct 25 2019 16:46:22-08:00 sw2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 14, the
change loop count is 0, and the maximum number of records is 4095.v
[sw2-GigabitEthernet0/0/2]port trunk allow-pass vlan 10 20       //允许vlan10、vlan20通过
[sw2-GigabitEthernet0/0/2]
[sw2-GigabitEthernet0/0/2]undo shutdown           //开启接口
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[sw2-GigabitEthernet0/0/2]

(3)R1的配置

<Huawei>system-view      //切换系统视图
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R1        //配置主机名
[R1]
Oct 25 2019 16:41:21-08:00 R1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 1, the ch
ange loop count is 0, and the maximum number of records is 4095.
[R1]int g0/0/1               //切换接口
[R1-GigabitEthernet0/0/1]
[R1-GigabitEthernet0/0/1]ip address 192.168.10.1 24      //配置IP地址
[R1-GigabitEthernet0/0/1]
Oct 25 2019 16:41:46-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
Oct 25 2019 16:41:51-08:00 R1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 2, the ch
ange loop count is 0, and the maximum number of records is 4095.
[R1-GigabitEthernet0/0/1]
[R1-GigabitEthernet0/0/1]undo shutdown         //开启接口
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R1-GigabitEthernet0/0/1]int g0/0/0               //切换接口
[R1-GigabitEthernet0/0/0]
[R1-GigabitEthernet0/0/0]ip address 12.0.0.1 30       //配置IP地址
[R1-GigabitEthernet0/0/0]
Oct 25 2019 16:42:47-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/0]
[R1-GigabitEthernet0/0/0]undo shutdown           //开启接口
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R1-GigabitEthernet0/0/0]
Oct 25 2019 16:42:51-08:00 R1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 3, the ch
ange loop count is 0, and the maximum number of records is 4095.
[R1-GigabitEthernet0/0/0]
[R1-GigabitEthernet0/0/0]quit               //退出
[R1]ip route-static 192.168.20.0 24 12.0.0.2              //配置静态路由

(4)R2的配置

<Huawei>system-view            //切换系统视图
Enter system view, return user view with Ctrl+Z.
[Huawei]
[Huawei]sysname R2             //配置主机名
[R2]
[R2]int g0/0/0                          // 切换接口
[R2-GigabitEthernet0/0/0]ip
Oct 25 2019 16:44:04-08:00 R2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 1, the ch
ange loop count is 0, and the maximum number of records is 4095.add
[R2-GigabitEthernet0/0/0]ip address 12.0.0.2 30             //配置IP地址
[R2-GigabitEthernet0/0/0]
Oct 25 2019 16:44:13-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
Oct 25 2019 16:44:14-08:00 R2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 2, the ch
ange loop count is 0, and the maximum number of records is 4095.
[R2-GigabitEthernet0/0/0]
[R2-GigabitEthernet0/0/0]undo shutdown           //开启接口
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R2-GigabitEthernet0/0/0]
[R2-GigabitEthernet0/0/0]int g0/0/1              //切换接口
[R2-GigabitEthernet0/0/1]
[R2-GigabitEthernet0/0/1]ip address 192.168.20.1 24          //配置IP地址
[R2-GigabitEthernet0/0/1]
Oct 25 2019 16:44:41-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R2-GigabitEthernet0/0/1]
[R2-GigabitEthernet0/0/1]undo shutdown             //开启接口
Oct 25 2019 16:44:44-08:00 R2 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.
191.3.1 configurations have been changed. The current change number is 3, the ch
ange loop count is 0, and the maximum number of records is 4095.
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R2-GigabitEthernet0/0/1]quit             //退出
[R2]ip route-static 192.168.10.0 24 12.0.0.1         //配置静态路由

(5)分别给每个PC机,配置IP地址、子网掩码和网关

PC1配置

PC2配置

PC3配置

PC4配置

(6)实验测试

用PC1去pingPC3的IP地址,可以互通。用抓包软件在sw2的GE0/0/2接口能够抓到数据包。

用PC1去pingPC4的IP地址,可以互通。用抓包软件在R2的GE0/0/0接口能够抓到数据包。

原文地址:https://blog.51cto.com/14449541/2445821

时间: 2024-10-30 09:43:43

华为eNSP配置access、trunk、hybrid接口的配置实验的相关文章

VLAN之access,trunk,hybrid三种模式区别

tag报文结构是在源mac地址和目的mac地址之后,加上了4bytes的vlan信息,普通的PC网卡是不能识别 的. Access端口只属于1个VLAN,一般用于连接计算机端口. Trunk类型的端口可用于多VLAN通信. Hybrid类型的端口允许多VLAN通过,可以接收发送多VLAN报文,可用于交换机与交换机的连接,也可用于交换机和计算机的连接. Hybrid类型的端口和trunk端口在处理数据包时,方法是一样的.唯一不同之处在于发送数据包时,hybrid端口可以允许多个VLAN的数据包发送

华为设备的交换机Hybrid接口详解

通常情况下,公司对内网的使用远远高于对外网的使用.公司的内部网络是由二层交换网络构建的,所以二层网络设计的好坏直接影响公司的正常业务.好的设计不仅使 功能得到体现,还可以应对一些未知的隐患,如线路损坏.设备损坏等.下面我们主要对华为的二层设备进行了解,不过首先要了解的就是二层设备(交换机)主要的就是--VLAN. 一.VLAN的基本概念 在传统的交换机以太网中,所有的用户都在同一个广播域中,当网络规模较大时,广播包的数量会急剧增加,当广播包的数量占到总量的30%时,网络的传输的效率会明显的下降,

配置ACL TRUNK RIP

要求:确保每个终端都可以访问www.ntd1711.com(192.168.30.88) 思路及步骤: 1.配置sw3,创建vlan10 20  将1和2端口分别加入各自vlan,13和22端口配置为 trunk模式: 2.配置sw4,创建vlan10 将3端口加入vlan10.14和22端口配置为trunk模式 3.配置sw5,创建vlan40 将4,5,6端口加入vlan40  10端口配置为trunk模式 4.配置sw1,创建vlan10 20 30 ,将12 13 14端口配置为trun

用华为eNSP模拟器配置Hybrid、Trunk和Access三种链路类型端口

上一篇文章写到三层交换机实现多个VLAN之间互相通讯,有朋友提问要如何进行配置,可有案例分析.其实那天我在写的时候也有做过模拟,只是后来没有保存.今天重新模拟一次,并附上详细配置命令,希望能够帮助到大家. 首先回忆下VLAN间数据传输的三种端口模式各自代表的含义: Access 类型的端口只能属于1个VLAN,一般用于连接计算机的端口,也可以连接交换机和交换机. Trunk 类型的端口可以允许多个VLAN通过,可以接收和发送多个VLAN的报文,trunk口一般用于连接两台交换机,这样可以只用一条

华为交换机Hybrid接口及基础配置

一.回顾VLAN VLAN基本概念 VLAN即虚拟局域网,是将一个物理的LAN在逻辑上划分成多个广播域(多个VLAN)的通信技术.VLAN内的主机间可以直接通信,而VLAN间不能直接互通,从而将广播报文限制在一个VLAN内.由于VLAN之间的隔离,所以一些类似蠕虫病毒等的攻~击被限制在一个VLAN中,提高了安全性,同时也方便管理人员对网络进行管理. VLAN隔离广播的方式 物理隔离:通过三层设备实现路由器逻辑隔离:交换机通过VLAN划分广播域,将接口加入指定VLAN进行隔离 为什么要使用VLAN

华为ensp,VLAN与trunk配置

实验拓扑! 实验需求:pc9与pc12配置为vlan5.pc10与pc11配置为vlan10.使同一vlan的pc能够正常ping通. 下面开始进行实验配置: sysname lsw3 左边交换机 [lsw3] vlan batch 5 10 在lsw3交换机上创建vlan5和vlan10 pc9: [lsw3]interface e0/0/1 进入pc9连接lws3的端口 [lsw3-Ethernet0/0/1]port link-type access 在pc9与lsw3的端口配置acces

交换机三种端口模式Access、Hybrid和Trunk的理解

untag就是普通的ethernet报文,普通PC机的网卡是可以识别这样的报文进行通讯:tag报文结构的变化是在源mac地址和目的mac地址之后,加上了4bytes的vlan信息,也就是vlan tag头:一般来说这样的报文普通PC机的网卡是不能识别的下图说明了802.1Q封装tag报文帧结构带802.1Q的帧是在标准以太网帧上插入了4个字节的标识.其中包含:2个字节的协议标识符(TPID),当前置0x8100的固定值,表明该帧带有802.1Q的标记信息.2个字节的标记控制信息(TCI),包含了

谈谈华为的二层接口类型hybrid接口的详细解读

Hybrid的配置 port hybrid pvid vlan 2---给端口打上我们的PVID port hybrid untagged vlan 2 100---其中有二层含义 1.第一层含义就是vlan 2和vlan 100在允许的列表中2.第二层含义就是我发送数据帧的时候 其中vlan 2和vlan 100是untag形式发送的 port hybrid tagged vlan 2 to 3 100---其中有二层含义 1.第一层含义就是vlan 2和vlan 3和vlan 100在允许的

eNSP仿真模拟软件之理解Hybrid接口的应用

1. 实验原理 Hybrid接口既可以连接普通终端的接入链路又可以连接交换机间的干道链路,它允许多个VLAN的帧通过,并可以在出接口方向将某些VLAN帧的标签剥掉. Hybrid接口处理VLAN帧的过程如下: (1)收到一个二层帧,判断是否有VLAN标签.没有标签,则标记上Hybrid接口的PVID,进行下一一步处理:有标签,判断该Hybrid接口是否允许该VLAN的帧进入,允许则进行下一步处理,否则丢弃. (2)当数据帧从Hybrid接口发出时,交换机判断VLAN在本接口的属性是Untagge