华为ensp之OSPFS5700.docx
《华为ensp之OSPFS5700.docx》由会员分享,可在线阅读,更多相关《华为ensp之OSPFS5700.docx(20页珍藏版)》请在冰豆网上搜索。
![华为ensp之OSPFS5700.docx](https://file1.bdocx.com/fileroot1/2023-5/23/098376be-6b62-461f-9bef-810c7574cc55/098376be-6b62-461f-9bef-810c7574cc551.gif)
华为ensp之OSPFS5700
ENSP实验OSPF基本功能
组网
如图1所示,所有的S5700都运行OSPF,并将整个自治系统划分为3个区域,其中S5700-A和S5700-B作为ABR来转发区域之间的路由。
配置完成后,每台S5700都能学到自治系统内的到所有网段的路由。
图1OSPF基本配置组网图
S5700
接口
对应的VLANIF
IP地址
S5700-A
GigabitEthernet0/0/1
VLANIF10
S5700-A
GigabitEthernet0/0/2
VLANIF20
S5700-B
GigabitEthernet0/0/1
VLANIF10
S5700-B
GigabitEthernet0/0/2
VLANIF30
S5700-C
GigabitEthernet0/0/1
VLANIF20
S5700-C
GigabitEthernet0/0/2
VLANIF40
S5700-D
GigabitEthernet0/0/1
VLANIF30
S5700-D
GigabitEthernet0/0/2
VLANIF50
S5700-E
GigabitEthernet0/0/1
VLANIF40
S5700-F
GigabitEthernet0/0/1
VLANIF50
配置思路
采用如下的思路配置OSPF基本功能:
1.配置各接口所属VLANID。
2.配置各VLANIF接口的IP地址。
3.在各S5700设备上使能OSPF,指定不同区域内的网段。
4.查看路由表及数据库信息。
数据准备
∙各接口所属的VLANID,具体数据如图1所示。
∙各VLANIF接口的IP地址,具体数据如图1所示。
∙各S5700设备的RouterID,OSPF进程号以及各接口所属的区域。
▪S5700-A的RouterID1.1.1.1,运行的OSPF进程号1,在区域0的网段192.168.0.0/24,在区域1的网段192.168.1.0/24。
▪S5700-B的RouterID2.2.2.2,运行的OSPF进程号1,在区域0的网段192.168.0.0/24,在区域2的网段192.168.2.0/24。
▪S5700-C的RouterID3.3.3.3,运行的OSPF进程号1,在区域1的网段192.168.1.0/24,172.16.1.0/24。
▪S5700-D的RouterID4.4.4.4,运行的OSPF进程号1,在区域2的网段192.168.2.0/24,172.17.1.0/24。
▪S5700-E的RouterID5.5.5.5,运行的OSPF进程号1,在区域1的网段172.16.1.0/24。
▪S5700-F的RouterID6.6.6.6,运行的OSPF进程号1,在区域2的网段172.17.1.0/24。
操作步骤
1.配置各接口所属VLAN
2.system-view
3.[Quidway]sysnameS5700-A
4.[S5700-A]vlanbatch1020
5.[S5700-A]interfacegigabitEthernet0/0/1
6.[S5700-A-GigabitEthernet0/0/1]porthybridpvidvlan10
7.[S5700-A-GigabitEthernet0/0/1]porthybriduntaggedvlan10
8.[S5700-A-GigabitEthernet0/0/1]quit
9.[S5700-A]interfacegigabitEthernet0/0/2
10.[S5700-A-GigabitEthernet0/0/2]porthybridpvidvlan20
11.[S5700-A-GigabitEthernet0/0/2]porthybriduntaggedvlan20
12.[S5700-A-GigabitEthernet0/0/2]quit
S5700-B、S5700-C、S5700-D、S5700-E、S5700-F上的配置同S5700-A(略)
13.配置各VLANIF接口的IP地址
14.[S5700-A]interfacevlanif10
15.[S5700-A-Vlanif10]ipaddress192.168.0.124
16.[S5700-A-Vlanif10]quit
17.[S5700-A]interfacevlanif20
18.[S5700-A-Vlanif20]ipaddress192.168.1.124
[S5700-A-Vlanif20]quit
S5700-B、S5700-C、S5700-D、S5700-E、S5700-F上的配置同S5700-A(略)
19.配置OSPF基本功能
#配置S5700-A。
[S5700-A]
[S5700-A]ospf
[S5700-A-ospf-1]area0
[S5700-A-ospf-1-area-0.0.0.0]
[S5700-A-ospf-1-area-0.0.0.0]quit
[S5700-A-ospf-1]area1
[S5700-A-ospf-1-area-0.0.0.1]
[S5700-A-ospf-1-area-0.0.0.1]quit
[S5700-A-ospf-1]quit
#配置S5700-B。
[S5700-B]
[S5700-B]ospf
[S5700-B-ospf-1]area0
[S5700-B-ospf-1-area-0.0.0.0]
[S5700-B-ospf-1-area-0.0.0.0]quit
[S5700-B-ospf-1]area2
[S5700-B-ospf-1-area-0.0.0.2]
[S5700-B-ospf-1-area-0.0.0.2]quit
[S5700-B-ospf-1]quit
#配置S5700-C。
[S5700-C]
[S5700-C]ospf
[S5700-C-ospf-1]area1
[S5700-C-ospf-1-area-0.0.0.1]
[S5700-C-ospf-1-area-0.0.0.1]
[S5700-C-ospf-1-area-0.0.0.1]quit
[S5700-C-ospf-1]quit
#配置S5700-D。
[S5700-D]
[S5700-D]ospf
[S5700-D-ospf-1]area2
[S5700-D-ospf-1-area-0.0.0.2]
[S5700-D-ospf-1-area-0.0.0.2]
[S5700-D-ospf-1-area-0.0.0.2]quit
[S5700-D-ospf-1]quit
#配置S5700-E。
[S5700-E]
[S5700-E]ospf
[S5700-E-ospf-1]area1
[S5700-E-ospf-1-area-0.0.0.1]
[S5700-E-ospf-1-area-0.0.0.1]quit
[S5700-E-ospf-1]quit
#配置S5700-F。
[S5700-F]
[S5700-F]ospf
[S5700-F-ospf-1]area2
[S5700-F-ospf-1-area-0.0.0.2]
[S5700-F-ospf-1-area-0.0.0.2]quit
[S5700-F-ospf-1]quit
20.验证配置结果。
#查看S5700-A的OSPF邻居。
[S5700-A]displayospfpeer
Neighbors
Area0.0.0.0interface192.168.0.1(Vlanif10)'sneighbors
Address:
192.168.0.2GRState:
Normal
State:
FullMode:
NbrisMasterPriority:
1
DR:
192.168.0.1BDR:
192.168.0.2MTU:
0
Deadtimerduein36sec
Neighborisupfor00:
15:
04
AuthenticationSequence:
[0]
Neighbors
Area0.0.0.1interface192.168.1.1(Vlanif20)'sneighbors
Address:
192.168.1.2GRState:
Normal
State:
FullMode:
NbrisMasterPriority:
1
DR:
192.168.1.1BDR:
192.168.1.2MTU:
0
Deadtimerduein39sec
Neighborisupfor00:
07:
32
AuthenticationSequence:
[0]
#显示S5700-A的OSPF路由信息。
[S5700-A]displayospfrouting
RoutingTables
RoutingforNetwork
DestinationCostTypeNextHopAdvRouterArea
TotalNets:
5
IntraArea:
3InterArea:
2ASE:
0NSSA:
0
#查看S5700-A的LSDB。
[S5700-A]displayospflsdb
LinkStateDatabase
TypeLinkStateIDAdvRouterAgeLenSequenceMetric
Router2.2.2.22.2.2.231748800000031
Router1.1.1.11.1.1.131648800000021
Network192.168.0.11.1.1.131632800000010
Sum-Net172.16.1.01.1.1.125028800000012
Sum-Net172.17.1.02.2.2.220328800000012
Sum-Net192.168.2.02.2.2.223728800000021
Sum-Net192.168.1.01.1.1.129528800000021
TypeLinkStateIDAdvRouterAgeLenSequenceMetric
Router192.168.1.2192.168.1.218848800000021
Router5.5.5.55.5.5.521436800000041
Router3.3.3.33.3.3.321760800000081
Router1.1.1.11.1.1.128948800000021
Network172.16.1.13.3.3.367032800000010
Sum-Net172.17.1.01.1.1.120228800000013
Sum-Net192.168.2.01.1.1.124228800000012
Sum-Net192.168.0.01.1.1.130028800000011
#查看S5700-D的路由表,并使用Ping进行测试连通性。
[S5700-D]displayospfrouting
RoutingTables
RoutingforNetwork
DestinationCostTypeNextHopAdvRouterArea
TotalNets:
5
IntraArea:
2InterArea:
3ASE:
0NSSA:
0
[S5700-D]
PING172.16.1.1:
56databytes,pressCTRL_Ctobreak
Replyfrom172.16.1.1:
bytes=56Sequence=1ttl=253time=60ms
Replyfrom172.16.1.1:
bytes=56Sequence=2ttl=253time=10ms
Replyfrom172.16.1.1:
bytes=56Sequence=3ttl=253time=10ms
Replyfrom172.16.1.1:
bytes=56Sequence=4ttl=253time=11ms
Replyfrom172.16.1.1:
bytes=56Sequence=5ttl=253time=13ms
---172.16.1.1pingstatistics---
5packet(s)transmitted
5packet(s)received
0.00%packetloss
round-tripmin/avg/max=16/59/94ms
配置文件
∙S5700-A的配置文件
displaycurrent-configuration
#
sysnameS5700-A
#
#
vlanbatch1020
#
clusterenable
ntdpenable
ndpenable
#
dropillegal-macalarm
#
diffservdomaindefault
#
drop-profiledefault
#
aaa
authentication-schemedefault
authorization-schemedefault
accounting-schemedefault
domaindefault
domaindefault_admin
local-useradminpasswordsimpleadmin
local-useradminservice-type
#
interfaceVlanif1
#
interfaceVlanif10
#
interfaceVlanif20
#
interfaceMEth0/0/1
#
interfaceGigabitEthernet0/0/1
porthybridpvidvlan10
porthybriduntaggedvlan10
#
interfaceGigabitEthernet0/0/2
porthybridpvidvlan20
porthybriduntaggedvlan20
#
interfaceNULL0
#
ospf1
#
user-interfacecon0
user-interfacevty04
#
return
∙S5700-B的配置文件
displaycurrent-configuration
#
sysnameS5700-B
#
#
vlanbatch1030
#
clusterenable
ntdpenable
ndpenable
#
dropillegal-macalarm
#
diffservdomaindefault
#
drop-profiledefault
#
aaa
authentication-schemedefault
authorization-schemedefault
accounting-schemedefault
domaindefault
domaindefault_admin
local-useradminpasswordsimpleadmin
local-useradminservice-type
#
interfaceVlanif1
#
interfaceVlanif10
#
interfaceVlanif30
#
interfaceMEth0/0/1
#
interfaceGigabitEthernet0/0/1
porthybridpvidvlan10
porthybriduntaggedvlan10
#
interfaceGigabitEthernet0/0/2
porthybridpvidvlan30
porthybriduntaggedvlan30
#
interfaceNULL0
#
ospf1
#
user-interfacecon0
user-interfacevty04
#
return
∙S5700-C的配置文件
displaycurrent-configuration
#
sysnames5700-C
#
#
vlanbatch2040
#
clusterenable
ntdpenable
ndpenable
#
dropillegal-macalarm
#
diffservdomaindefault
#
drop-profiledefault
#
aaa
authentication-schemedefault
authorization-schemedefault
accounting-schemedefault
domaindefault
domaindefault_admin
local-useradminpasswordsimpleadmin
local-useradminservice-type
#
interfaceVlanif1
#
interfaceVlanif20
#
interfaceVlanif40
#
interfaceMEth0/0/1
#
interfaceGigabitEthernet0/0/1
porthybridpvidvlan20
porthybriduntaggedvlan20
#
interfaceGigabitEthernet0/0/2
porthybridpvidvlan40
porthybriduntaggedvlan40
#
interfaceNULL0
#
ospf1
#
user-interfacecon0
user-interfacevty04
#
return
∙S5700-D的配置文件
displaycurrent-configuration
#
sysnames5700-D
#
#
vlanbatch3050
#
clusterenable
ntdpenable
ndpenable
#
dropillegal-macalarm
#
diffservdomaindefault
#
drop-profiledefault
#
aaa
authentication-schemedefault
authorization-schemedefault
accounting-schemedefault
domaindefault
domaindefault_admin
local-useradminpasswordsimpleadmin
local-useradminservice-type
#
interfaceVlanif1
#
interfaceVlanif30
#
interfaceVlanif50
#
interfaceMEth0/0/1
#
interfaceGigabitEthernet0/0/1
porthybridpvidvlan30
porthybriduntaggedvlan30
#
interfaceGigabitEthernet0/0/2
porthybridpvidvlan50
porthybriduntaggedvlan50
#
interfaceNULL0
#
ospf1
#
user-interfacecon0
user-interfacevty04
#
return
∙S5700-E的配置文件
displaycurrent-configuration
#
sysnames5700-E
#
#
vlanbatch40
#
clusterenable
ntdpenable
ndpenable
#
dropillegal-macalarm
#
diffservdomaindefault
#
drop-profiledefault
#
aaa
authentication-schemedefault
authorization-schemedefault
accounting-schemedefault
domaindefault
domaindefault_admin
local-useradminpasswordsimpleadmin
local-useradminservice-type
#
interfaceVlanif1
#
interfaceVlanif40
#
interfaceMEth0/0/1
#
interfaceGigabitEthernet0/0/1
porthybridpvidvlan40
porthybriduntaggedvlan40
#
interfaceGigabitEthernet0/0/2
#
interfaceNULL0
#
ospf1
#
user-interfacecon0
user-interfacevty04
#
return
∙S5700-F的配置文件
displaycurrent-configuration
#
sysnames5700-F
#
#
vlanbatch50
#
clusterenable
ntdpenabl