华为ensp路由器的配置(华为模拟器ensp单臂路由实验笔记)
实验背景
某公司三个部门人事部 市场部 经理需要跨vlan通讯
首先将pc的ip和子网掩码和网关设置好
然后来设置s1
s1配置<Huawei>sy
Enter system view, return user view with Ctrl Z.
[Huawei]vlan 1 【创建vlan】
[Huawei-vlan1]des
[Huawei-vlan1]description hr 【vlan标签表明vlan1是属于hr人事】
[Huawei-vlan1]
Jul 7 2018 10:50:28-08:00 Huawei 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, th
e change loop count is 0, and the maximum number of records is 4095.
[Huawei-vlan1]q
[Huawei]undo info
[Huawei]undo info-center en
[Huawei]undo info-center enable 【关闭上述特别长的提示信息】
Info: Information center is disabled.
[Huawei]vlan 2
[Huawei-vlan2]des
[Huawei-vlan2]description market
[Huawei-vlan2]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access 【配置接口的类型 接口类型的区别有不明白的朋友点击三种类型的应用】
s2配置[Huawei]vlan 3
[Huawei-vlan3]des
[Huawei-vlan3]description manage
[Huawei-vlan3]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port defa
[Huawei-Ethernet0/0/2]port default vlan 3
[Huawei-Ethernet0/0/2]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk all
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all
[Huawei-Ethernet0/0/1]
<Huawei>sys
Enter system view, return user view with Ctrl Z.
[Huawei]sys s2 【修改交换机名】
[s2]int e 0/0/1
s1配置<Huawei>sy
Enter system view, return user view with Ctrl Z.
[Huawei]undo info
[Huawei]undo info-center en
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sys name s1
[name s1]sys s1
[s1]int g0/0/1
[s1-GigabitEthernet0/0/1]q
[s1]vlan 1
[s1-vlan1]vlan 2
[s1-vlan2]vlsn 3
^
Error: Unrecognized command found at '^' position.
[s1-vlan2]vlan 3
[s1-vlan3]int g0/0/11
[s1-GigabitEthernet0/0/11]q
[s1]int g0/0/1
[s1-GigabitEthernet0/0/1]port link-type trunk
[s1-GigabitEthernet0/0/1]port trunk all
[s1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[s1-GigabitEthernet0/0/1]int g0/0/2
[s1-GigabitEthernet0/0/2]port link-type trunk
[s1-GigabitEthernet0/0/2]port trunk all
[s1-GigabitEthernet0/0/2]port trunk allow-pass vlan
^
Error:Incomplete command found at '^' position.
[s1-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[s1-GigabitEthernet0/0/2] User interface con0 is available
Please Press ENTER.
<s1>sys
Enter system view, return user view with Ctrl Z.
[s1]int g0/0/3
[s1-GigabitEthernet0/0/3]port link-type trunk
[s1-GigabitEthernet0/0/3]port trunk all
[s1-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[s1-GigabitEthernet0/0/3]
[Huawei-Ethernet0/0/2]port default vlan 1 【将接口划分到vlan下】
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]port link-type access
[Huawei-Ethernet0/0/3]port defa
[Huawei-Ethernet0/0/3]port default vlan 2
[Huawei-Ethernet0/0/3]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk all
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all 【可以通过所有vlan的数据】
s2配置[Huawei]vlan 3
[Huawei-vlan3]des
[Huawei-vlan3]description manage
[Huawei-vlan3]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port defa
[Huawei-Ethernet0/0/2]port default vlan 3
[Huawei-Ethernet0/0/2]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk all
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all
[Huawei-Ethernet0/0/1]
<Huawei>sys
Enter system view, return user view with Ctrl Z.
[Huawei]sys s2
[s2]int e 0/0/1
[s2-Ethernet0/0/1]dis this
s3配置[Huawei]undo info
[Huawei]undo info-center en
[Huawei]undo info-center enable
Info: Information center is disabled.
[Huawei]sys name s1
[name s1]sys s1
[s1]int g0/0/1
[s1-GigabitEthernet0/0/1]q
[s1]vlan 1
[s1-vlan1]vlan 2
[s1-vlan2]vlsn 3
^
Error: Unrecognized command found at '^' position.
[s1-vlan2]vlan 3
[s1-vlan3]int g0/0/11
[s1-GigabitEthernet0/0/11]q
[s1]int g0/0/1
[s1-GigabitEthernet0/0/1]port link-type trunk
[s1-GigabitEthernet0/0/1]port trunk all
[s1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[s1-GigabitEthernet0/0/1]int g0/0/2
[s1-GigabitEthernet0/0/2]port link-type trunk
[s1-GigabitEthernet0/0/2]port trunk all
[s1-GigabitEthernet0/0/2]port trunk allow-pass vlan
^
Error:Incomplete command found at '^' position.
[s1-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[s1-GigabitEthernet0/0/2] User interface con0 is available
Please Press ENTER.
<s1>sys
Enter system view, return user view with Ctrl Z.
[s1]int g0/0/3
[s1-GigabitEthernet0/0/3]port link-type trunk
[s1-GigabitEthernet0/0/3]port trunk all
[s1-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[s1-GigabitEthernet0/0/3]
<s1>sys s3
^
Error:Too many parameters found at '^' position.
<s1>undo sys s1
^
Error: Unrecognized command found at '^' position.
<s1>sys
Enter system view, return user view with Ctrl Z.
[s1]sys s3
[s3]int g0/0/2
[s3-GigabitEthernet0/0/2]dis this 【查看当前接口信息】
#
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
r1配置<Huawei>sys
Enter system view, return user view with Ctrl Z.
[Huawei]sys r1
[r1]int g0/0/1.1
[r1-GigabitEthernet0/0/1.1]ip add 10.0.1.254 24
[r1-GigabitEthernet0/0/1.1]undo ip add
[r1-GigabitEthernet0/0/1.1]q
[r1]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]ip add 10.0.1.254 24 【配置网关】
[r1-GigabitEthernet0/0/0.1]int g0/0/0.2
[r1-GigabitEthernet0/0/0.2]ip add 10.0.2.254 24
[r1-GigabitEthernet0/0/0.2]int g0/0/0.3
[r1-GigabitEthernet0/0/0.3]ip add 10.0.3.254 24
[r1-GigabitEthernet0/0/0.3]dot
[r1-GigabitEthernet0/0/0.3]dot1q term
[r1-GigabitEthernet0/0/0.3]dot1q termination vid
[r1-GigabitEthernet0/0/0.3]dot1q termination vid 1 【接收时剥离tag报文进行转发 向外发送时添加vlan tag】
Jul 7 2018 11:22:54-08:00 r1 %IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0.3 has entered the UP state.
[r1-GigabitEthernet0/0/0.3]arp bro
[r1-GigabitEthernet0/0/0.3]arp broadcast en
[r1-GigabitEthernet0/0/0.3]arp broadcast enable 【开启arp广播功能】
[r1-GigabitEthernet0/0/0.3]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]dot
[r1-GigabitEthernet0/0/0.1]dot1q ter
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 1
Error: Failed to configure the interface because the VLAN has been configured on
interface GigabitEthernet0/0/0.3.
[r1-GigabitEthernet0/0/0.1]int g0/0/0.3
[r1-GigabitEthernet0/0/0.3]undo dot
[r1-GigabitEthernet0/0/0.3]undo dot1q ter
[r1-GigabitEthernet0/0/0.3]undo dot1q termination vid
[r1-GigabitEthernet0/0/0.3]undo dot1q termination vid 1
Jul 7 2018 11:24:29-08:00 r1 %IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0.3 has entered the DOWN state.
[r1-GigabitEthernet0/0/0.3]dot
[r1-GigabitEthernet0/0/0.3]dot1q ter
[r1-GigabitEthernet0/0/0.3]dot1q termination vid 3
Jul 7 2018 11:24:45-08:00 r1 %IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/0.3 has entered the UP state.
[r1-GigabitEthernet0/0/0.3]arp bro
[r1-GigabitEthernet0/0/0.3]arp broadcast en
[r1-GigabitEthernet0/0/0.3]arp broadcast enable
[r1-GigabitEthernet0/0/0.3]int g0/0/0.1
[r1-GigabitEthernet0/0/0.1]dot
[r1-GigabitEthernet0/0/0.1]dot1q ter
[r1-GigabitEthernet0/0/0.1]dot1q termination vid 1
Jul 7 2018 11:25:20-08:00 r1 %IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/0.1 has entered the UP state.
[r1-GigabitEthernet0/0/0.1]arp
[r1-GigabitEthernet0/0/0.1]arp bro
[r1-GigabitEthernet0/0/0.1]arp broadcast en
[r1-GigabitEthernet0/0/0.1]arp broadcast enable
[r1-GigabitEthernet0/0/0.1]int g0/0/0.2
[r1-GigabitEthernet0/0/0.2]dot
[r1-GigabitEthernet0/0/0.2]dot1q ter
[r1-GigabitEthernet0/0/0.2]dot1q termination vid 2
Jul 7 2018 11:26:08-08:00 r1 %IFNET/4/LINK_STATE(l)[4]:The line protocol IP
on the interface GigabitEthernet0/0/0.2 has entered the UP state.
[r1-GigabitEthernet0/0/0.2]arp bro
[r1-GigabitEthernet0/0/0.2]arp broadcast en
[r1-GigabitEthernet0/0/0.2]arp broadcast enable
[r1-GigabitEthernet0/0/0.2]q
[r1]dis
[r1]display ip int bri
[r1]display ip int brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 3
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 unassigned up down
GigabitEthernet0/0/0.1 10.0.1.254/24 up up
GigabitEthernet0/0/0.2 10.0.2.254/24 up up
GigabitEthernet0/0/0.3 10.0.3.254/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/1.1 unassigned down down
NULL0 unassigned up up(s)
现在来测试
不通!!然后又ping了网关 还是不通!
然后我就查看了vlan1的接口配置。发现:
[s1-Ethernet0/0/1]dis this
#
interface Ethernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
#
它配置为trunk类型之后 通过的数据是从vlan2开始的 不是从vlan1
所以重新创建了vlan4
然后再各个设备上重新设置之后
重新测试数据时候能够正常通讯
ok完成
若有错误之处请广大网友指正
,免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com