华为三层交换机配置总结.docx
- 文档编号:23899573
- 上传时间:2023-05-22
- 格式:DOCX
- 页数:17
- 大小:82.78KB
华为三层交换机配置总结.docx
《华为三层交换机配置总结.docx》由会员分享,可在线阅读,更多相关《华为三层交换机配置总结.docx(17页珍藏版)》请在冰豆网上搜索。
华为三层交换机配置总结
一、基本命令:
保存当前配置:
save[configuration-file]
清除当前配置:
重启当前设备:
取消单条配置:
undo+要取消的配置命令
例:
[SwitchA-Ethernet0/3]portlink-typetrunk
[SwitchA-Ethernet0/3]undoportlink-typetrunk
显示命令:
displayinterfacebrief;查看端口状态
displaycurrent-configuration;显示当前设备的所有配置信息
配置静态路由:
iproute-static目标网段子网掩码下一跳地址
例:
iproute-static192.168.1.0255.255.255.0192.168.1.2
例:
iproute-static0.0.0.00.0.0.0172.16.1.2
设置trunk:
[cores9303-1]interfaceGigabitEthernet1/0/5
[cores9303-1-GigabitEthernet1/0/5]combocopper;9300端口默认是光模式,改为电模式
[cores9303-1-GigabitEthernet1/0/5]portlink-typetrunk
---------------------------------------------------------------------------------------
[huawei5328]interfaceGigabitEthernet0/0/2
[huawei5328-GigabitEthernet0/0/2]undoportdefaultvlan
[huawei5328-GigabitEthernet0/0/2]portlink-typetrunk
[huawei5328-GigabitEthernet0/0/2]porttrunkallow-passvlanall;允许所有的vlan从g0/0/2端口透传通过,也可以指定具体的vlan值
telnet登陆设置:
1.
2.[S9300-A]vlan60
3.[S9300-A-vlan2]quit
4.[S9300-A]interfaceGigabitEthernet1/0/1
5.[S9300-A-GigabitEthernet1/0/1]combocopper
6.[S9300-A-GigabitEthernet1/0/1]portlink-typeaccess
7.[S9303-A-GigabitEthernet1/0/1]portdefaultvlan60
8.[S9300-A-GigabitEthernet1/0/1]quit
9.[S9300-A]interfacevlanif60
10.[S9300-A-Vlanif60]ipaddress10.10.10.8255.255.255.0
11.[S9300-A-Vlanif60]quit
12.[S9300-A]
13.[S9300-A]user-interfacevty04
14.[S9300-A-ui-vty0-4]authentication-modepassword
15.[S9300-A-ui-vty0-4]setauthenticationpasswordsimple123456
16.[S9300-A-ui-vty0-4]quit
17.[S9300-A]
二、配置实例
1.实例说明
此实例测试华为三层交换机vrrp以及rip路由协议的启用,
2拓扑图如下:
3.配置命令
交换机名为zuo的配置:
(华为5328设置)
[Quidway]sysnamezuo;给设备命名
[zuo]vlan20;创建vlan
[zuo-vlan20]portGigabitEthernet0/0/20;进入端口模式
[zuo-vlan20]quit
[zuo]interfaceVlanif20;进入vlanif接口模式
[zuo-Vlanif20]ipaddress20.20.20.124;添加ip
[zuo-Vlanif20]quit
[zuo]displayipintbrief;显示接口ip配置
[zuo]interfaceVlanif1
[zuo-Vlanif1]ipaddress10.10.10.124
[zuo-Vlanif1]quit
[zuo]vlan60
[zuo-vlan60]portGigabitEthernet0/0/6;把端口加到vlan中
[zuo-vlan60]quit
[zuo]interfaceVlanif60
[zuo-Vlanif60]ipaddress60.60.60.124
[zuo-Vlanif60]quit
[zuo]interfaceVlanif1
[zuo-Vlanif1]vrrpvrid1virtual-ip10.10.10.111
[zuo-Vlanif1]vrrpvrid1priority120;设置vrrp组1的优先级
[zuo-Vlanif1]vrrpvrid1preempt-modetimerdelay20;
[zuo-Vlanif1]vrrpvrid2virtual-ip10.10.10.112
[zuo-Vlanif1]displayvrrp;显示vrrp配置状态
[zuo]rip;启用rip动态路由协议
[zuo-rip-1]version2
[zuo-rip-1]network10.0.0.0
[zuo-rip-1]network20.0.0.0
[zuo-rip-1]network60.0.0.0
[zuo-rip-1]quit
[zuo-Vlanif1]displayiprouting-table;查看路由表
RouteFlags:
R-relay,D-downloadtofib
------------------------------------------------------------------------------
RoutingTables:
Public
Destinations:
10Routes:
12
Destination/MaskProtoPreCostFlagsNextHopInterface
10.10.10.0/24Direct00D10.10.10.1Vlanif1
10.10.10.1/32Direct00D127.0.0.1InLoopBack0
20.20.20.0/24Direct00D20.20.20.1Vlanif20
20.20.20.1/32Direct00D127.0.0.1InLoopBack0
50.50.50.0/24RIP1001D20.20.20.2Vlanif20
RIP1001D10.10.10.2Vlanif1
RIP1001D60.60.60.2Vlanif60
60.60.60.0/24Direct00D60.60.60.1Vlanif60
60.60.60.1/32Direct00D127.0.0.1InLoopBack0
100.100.100.0/24RIP1001D60.60.60.2Vlanif60
127.0.0.0/8Direct00D127.0.0.1InLoopBack0
127.0.0.1/32Direct00D127.0.0.1InLoopBack0
Vlanif1|VirtualRouter1
state:
Master
VirtualIP:
10.10.10.111
PriorityRun:
120
PriorityConfig:
120
MasterPriority:
120
Preempt:
YESDelayTime:
20
Accept_mode:
NO
V2v3interop:
NO
Timer:
1
MasteradverTimer:
1
AuthType:
NONE
CheckTTL:
YES
Vlanif1|VirtualRouter2
state:
Backup
VirtualIP:
10.10.10.112
PriorityRun:
100
PriorityConfig:
100
MasterPriority:
120
Preempt:
YESDelayTime:
0
Accept_mode:
NO
V2v3interop:
NO
Timer:
1
MasteradverTimer:
1
AuthType:
NONE
CheckTTL:
YES
9300的配置:
[cores9303-1]vlan60
[cores9303-1-vlan60]quit
[cores9303-1]vlan50
[cores9303-1-vlan50]quit
[cores9303-1]interfaceGigabitEthernet1/0/6
[cores9303-1-GigabitEthernet1/0/6]combocopper;9300端口默认是光模式,改成电模式
[cores9303-1-GigabitEthernet1/0/6]portlink-typeaccess;设接口类型为接入模式
[cores9303-1-GigabitEthernet1/0/6]portdefaultvlan60;把端口添加到vlan60中
[cores9303-1-GigabitEthernet1/0/6]quit
[cores9303-1]displayvlan60;查看vlan60的配置
[cores9303-1]interfaceGigabitEthernet1/0/5
[cores9303-1-GigabitEthernet1/0/5]combocopper
[cores9303-1-GigabitEthernet1/0/5]portdefaultvlan50
[cores9303-1-GigabitEthernet1/0/5]quit
[cores9303-1]interfaceVlanif50
[cores9303-1-Vlanif50]ipaddress50.50.50.224
[cores9303-1-Vlanif50]quit
[cores9303-1]interfaceVlanif60
[cores9303-1-Vlanif60]ipaddress60.60.60.224
[cores9303-1-Vlanif60]quit
[cores9303-1]displayvlan50
VLANIDTypeStatusMACLearningBroadcast/Multicast/UnicastProperty
--------------------------------------------------------------------------------
50commonenableenableforwardforwardforwarddefault
----------------
UntaggedPort:
GigabitEthernet1/0/5
----------------
TaggedPort:
GigabitEthernet1/0/1
----------------
InterfacePhysical
GigabitEthernet1/0/1DOWN
GigabitEthernet1/0/5UP
[cores9303-1]interfaceGigabitEthernet1/0/0
[cores9303-1-GigabitEthernet1/0/0]portdefaultvlan100
[cores9303-1-GigabitEthernet1/0/0]quit
[cores9303-1]rip
[cores9303-1-rip-1]network50.0.0.0
[cores9303-1-rip-1]network60.0.0.0
[cores9303-1-rip-1]network100.0.0.0
-------------------------------------------------------------------------------------------------------
交换机you的设置:
(华为5328设置)
[you]vlan20
[you-vlan20]portGigabitEthernet0/0/20;把端口加到vlan中
[you-vlan20]quit
[you]interfaceVlanif20
[you-Vlanif20]ipaddress20.20.20.224
[you-Vlanif20]quit
[you]vlan50
[you-vlan50]portGigabitEthernet0/0/5
[you-vlan50]quit
[you]interfaceVlanif50
[you-Vlanif50]ipaddress50.50.50.124
[you-Vlanif50]quit
[you]interfaceVlanif1
[you-Vlanif1]ipaddress10.10.10.224
[you-Vlanif1]vrrpvrid1virtual-ip10.10.10.111
[you-Vlanif1]vrrpvrid2virtual-ip10.10.10.112
[you-Vlanif1]vrrpvrid2priority120
[you-Vlanif1]vrrpvrid2preempt-modetimerdelay20
[you-Vlanif1]quit
[you]rip;启用rip
[you-rip-1]version2;用rip版本2
[you-rip-1]network10.0.0.0;公布网段
[you-rip-1]network20.0.0.0
[you-rip-1]network50.0.0.0
[you-rip-1]quit
Vlanif1|VirtualRouter1
state:
Backup
VirtualIP:
10.10.10.111
PriorityRun:
100
PriorityConfig:
100
MasterPriority:
120
Preempt:
YESDelayTime:
0
Accept_mode:
NO
V2v3interop:
NO
Timer:
1
MasteradverTimer:
1
AuthType:
NONE
CheckTTL:
YES
Vlanif1|VirtualRouter2
state:
Master
VirtualIP:
10.10.10.112
PriorityRun:
120
PriorityConfig:
120
MasterPriority:
120
Preempt:
YESDelayTime:
20
Accept_mode:
NO
V2v3interop:
NO
Timer:
1
MasteradverTimer:
1
AuthType:
NONE
CheckTTL:
YES
you>displayiprouting-table;查看路由表
RouteFlags:
R-relay,D-downloadtofib
------------------------------------------------------------------------------
RoutingTables:
Public
Destinations:
10Routes:
12
Destination/MaskProtoPreCostFlagsNextHopInterface
10.10.10.0/24Direct00D10.10.10.2Vlanif1
10.10.10.2/32Direct00D127.0.0.1InLoopBack0
20.20.20.0/24Direct00D20.20.20.2Vlanif20
20.20.20.2/32Direct00D127.0.0.1InLoopBack0
50.50.50.0/24Direct00D50.50.50.1Vlanif50
50.50.50.1/32Direct00D127.0.0.1InLoopBack0
60.60.60.0/24RIP1001D20.20.20.1Vlanif20
RIP1001D10.10.10.1Vlanif1
RIP1001D50.50.50.2Vlanif50
100.100.100.0/24RIP1001D50.50.50.2Vlanif50
127.0.0.0/8Direct00D127.0.0.1InLoopBack0
127.0.0.1/32Direct00D127.0.0.1InLoopBack0
4.测试
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
(1)vrrp正常状态下测试
pc1网关设置:
10.10.10.10.111
C:
\Users\0173>tracert100.100.100.2
通过最多30个跃点跟踪
到LJ-2400[100.100.100.2]的路由:
13ms1ms7ms10.10.10.1
22ms2ms2ms60.60.60.2
3<1毫秒<1毫秒1msLJ-2400[100.100.100.2]
跟踪完成。
Pc1网关设置:
10.10.10.112
C:
\Users\0173>tracert100.100.100.2
通过最多30个跃点跟踪
到LJ-2400[100.100.100.2]的路由:
12ms1ms1ms10.10.10.2
22ms2ms2ms50.50.50.2
3<1毫秒<1毫秒<1毫秒LJ-2400[100.100.100.2]
跟踪完成。
C:
\Users\0173>
注:
pc1设置不同的网关,其tracert的路径也不一样,说明vrrp多组配置生效。
(2)只断a,查看俩个交换机vrrp状态并测试pc1如何到pc2
Vlanif1|VirtualRouter1
state:
Initialize
VirtualIP:
10.10.10.111
PriorityRun:
120
PriorityConfig:
120
MasterPriority:
0
Preempt:
YESDelayTime:
20
Accept_mode:
NO
V2v3interop:
NO
Timer:
1
MasteradverTimer:
1
AuthType:
NONE
CheckTTL:
YES
Vlanif1|VirtualRouter2
state:
Initialize
VirtualIP:
10.10.10.112
PriorityRun:
100
PriorityConfig:
100
MasterPriority:
0
Preempt:
YESDelayTime:
0
Accept_mode:
NO
V2v3interop:
NO
Timer:
1
MasteradverTimer:
1
AuthType:
NONE
CheckTTL:
YES
Vlanif1|VirtualRouter1
state:
Master
VirtualIP:
10.10.10.111
PriorityRun:
100
PriorityConfig:
100
MasterPriority:
100
Preempt:
YESDelayTime:
0
Accept_mode:
NO
V2v3interop:
NO
Timer:
1
MasteradverTimer:
1
AuthType:
NONE
CheckTTL:
YES
Vlanif1|VirtualRouter2
state:
Master
VirtualIP:
10.10.10.112
PriorityRun:
120
PriorityConfig:
120
MasterPriority:
120
Preempt:
YESDelayTime:
20
Accept_mode:
NO
V2v3interop:
NO
Timer:
1
MasteradverTimer:
1
A
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 华为 三层 交换机 配置 总结
![提示](https://static.bdocx.com/images/bang_tan.gif)