如何配置华为OSPF多区域认证
华为的产品主要涉及通信网络中的交换网络、传输网络、无线及有线固定接入网络和数据通信网络及无线终端产品,其出产的路由器功能强大,那么你知道如何配置华为动态路由RIP吗?下面是www.886abc.com整理的一些关于如何配置华为动态路由RIP的相关资料,供你参考。
什么是OSPF?
OSPF(Open Shortest Path First开放式最短路径优先)是一个内部网关协议(Interior Gateway Protocol,简称IGP),用于在单一自治系统(autonomous system,AS)内决策路由。是对链路状态路由协议的一种实现,隶属内部网关协议(IGP),故运作于自治系统内部。著名的迪克斯加算法(Dijkstra)被用来计算最短路径树。OSPF分为OSPFv2和OSPFv3两个版本,其中OSPFv2用在IPv4网络,OSPFv3用在IPv6网络。OSPFv2是由RFC 2328定义的,OSPFv3是由RFC 5340定义的。与RIP相比,OSPF是链路状态协议,而RIP是距离矢量协议。
IETF为了满足建造越来越大基于IP网络的需要,形成了一个工作组,专门用于开发开放式的链路状态路由协议,以便用在大型、异构的I P网络中。新的路由协议已经取得一些成功的一系列私人的、和生产商相关的、最短路径优先(SPF )路由协议为基础, 在市场上广泛使用。包括OSPF在内,所有的S P F路由协议基于一个数学算法—Dijkstra算法。这个算法能使路由选择基于链路状态,而不是距离向量。OSPF由IETF在20世纪80年代末期开发,OSPF是SPF类路由协议中的开放式版本。最初的OSPF规范体如今RFC1131中。这个第1版( OSPF版本1 )很快被进行了重大改进的版本所代替,这个新版本体如今RFC1247文档中。RFC 1247OSPF称为OSPF版本2是为了明确指出其在稳定性和功能性方面的实质性改进。这个OSPF版本有许多更新文档,每一个更新都是对开放标准的精心改进。接下来的一些规范出如今RFC 1583、2178和2328中。OSPF版本2的最新版体如今RFC 2328中。最新版只会和由RFC 2138、1583和1247所规范的版本进行互操作。
配置华为OSPF多区域认证的案例:
此实验主要实现以下目的:
1、了解OSPF多区域设计的优点。
2、理解OSPF多区域路由信息的交换方式。
3、掌握OSPF多区域配置命令。
4、掌握OSPF的认证配置方法。
5、掌握OSPF邻居无法建立的故障排除方法。
拓扑图:
你是公司的网络管理员。现在公司的网络准备OSPF协议来进行路由信息的传递。为应对网络规模日益增大的问题,你决定使用OSPF的多区域模式来规划网络。此外为保证信息安全,你采用了OSPF的认证。在配置过程中你也了解了OSPF中各种了性LSA的作用。
学习任务:
步骤一.基本配置:
[Huawei]sysnameR1
[R1]interfaces1/0/0
[R1-Serial1/0/0]ipadd 10.0.12.1 24
[R1-Serial1/0/0]descthis port connect to R2-S1/0/0
[R1-Serial1/0/0]interfacegi0/0/0
[R1-GigabitEthernet0/0/0]ipadd 10.0.13.1 24
[R1-GigabitEthernet0/0/0]
Jun 292014 16:29:10-05:13 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP o
n theinterface GigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/0]descthis port connect to R3-Gi0/0/0
[R1-GigabitEthernet0/0/0]interfaceloopback0
[R1-LoopBack0]ipadd 10.0.1.1 24
[R1-LoopBack0]q
其它路由器参照R1的配置进行配置。
步骤二.OSPF多区域配置
R1为ABR,10.0.12.0/24网段属于区域0,10.0.13.0/24与10.0.1.0/24网段属于区域1.
[R1]ospf1 router-id 10.0.1.1
[R1-ospf-1]area0
[R1-ospf-1-area-0.0.0.0]network10.0.12.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]q
[R1-ospf-1]area1
[R1-ospf-1-area-0.0.0.1]network10.0.13.0 0.0.0.255
[R1-ospf-1-area-0.0.0.1]network10.0.1.0 0.0.0.255
[R1-ospf-1-area-0.0.0.1]
R2为骨干区域普通内部路由器,属于区域0.
[R2]ospf1 router-id 10.0.2.2
[R2-ospf-1]area0
[R2-ospf-1-area-0.0.0.0]network10.0.12.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network10.0.2.0 0.0.0.255
R3为ASBR,10.0.13.0/24和10.0.3.0/24两个网段属于区域1,172.64.0.0/24网段不属于ospf路由域,不通告进OSPF进程。
[R3]ospf1 router-id 10.0.3.3
[R3-ospf-1]area1
[R3-ospf-1-area-0.0.0.1]network10.0.3.0 0.0.0.255
[R3-ospf-1-area-0.0.0.1]network10.0.13.0 0.0.0.255
步骤三.OSPF路由验证
查看R1、R2、R3的路由表,确认各路由器已学习到如下红色突出显示部分路由条目。
[R1]disip routing-table protocol ospf
RouteFlags: R - relay, D - download to fib
------------------------------------------------------------------------------
Publicrouting table : OSPF
Destinations : 2 Routes : 2
OSPFrouting table status :
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.2.2/32 OSPF 10 48 D 10.0.12.2 Serial1/0/0
10.0.3.3/32 OSPF 10 1 D 10.0.13.3 GigabitEthernet0/0/0
OSPFrouting table status :
Destinations : 0 Routes : 0
[R2]disip routing-table protocol ospf
RouteFlags: R - relay, D - download to fib
------------------------------------------------------------------------------
Publicrouting table : OSPF
Destinations : 3 Routes : 3
OSPFrouting table status :
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.1.1/32 OSPF 10 48 D 10.0.12.1 Serial1/0/0
10.0.3.3/32 OSPF 10 49 D 10.0.12.1 Serial1/0/0
10.0.13.0/24 OSPF 10 49 D 10.0.12.1 Serial1/0/0
OSPFrouting table status :
Destinations : 0 Routes : 0
[R3]disip routing-table protocol ospf
RouteFlags: R - relay, D - download to fib
------------------------------------------------------------------------------
Publicrouting table : OSPF
Destinations : 3 Routes : 3
OSPFrouting table status :
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.1.1/32 OSPF 10 1 D 10.0.13.1 GigabitEthernet/0/0
10.0.2.2/32 OSPF 10 49 D 10.0.13.1 GigabitEthernet0/0/0
10.0.12.0/24 OSPF 10 49 D 10.0.13.1 GigabitEthernet0/0/0
OSPFrouting table status :
Destinations : 0 Routes : 0
[R3]ping10.0.1.1
PING 10.0.1.1: 56 data bytes, press CTRL_C to break
Reply from 10.0.1.1: bytes=56 Sequence=1ttl=255 time=20 ms
Reply from 10.0.1.1: bytes=56 Sequence=2ttl=255 time=10 ms
Reply from 10.0.1.1: bytes=56 Sequence=3ttl=255 time=10 ms
Reply from 10.0.1.1: bytes=56 Sequence=4ttl=255 time=10 ms
Reply from 10.0.1.1: bytes=56 Sequence=5ttl=255 time=10 ms
--- 10.0.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/12/20 ms
[R3]ping10.0.2.2
PING 10.0.2.2: 56 data bytes, press CTRL_C to break
Reply from 10.0.2.2: bytes=56 Sequence=1ttl=254 time=30 ms
Reply from 10.0.2.2: bytes=56 Sequence=2ttl=254 time=20 ms
Reply from 10.0.2.2: bytes=56 Sequence=3ttl=254 time=20 ms
Reply from 10.0.2.2: bytes=56 Sequence=4ttl=254 time=10 ms
Reply from 10.0.2.2: bytes=56 Sequence=5ttl=254 time=20 ms
--- 10.0.2.2 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
查看OSPF邻居状态
[R1]displayospf peer brief
OSPF Process 1 with Router ID 10.0.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Serial1/0/0 10.0.2.2 Full
0.0.0.1 GigabitEthernet0/0/0 10.0.3.3 Full
----------------------------------------------------------------------------
[R1]
[R2]displayospf peer brief
OSPF Process 1 with Router ID 10.0.2.2
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Serial1/0/0 10.0.1.1 Full
----------------------------------------------------------------------------
[R2]
[R3]disospf peer brief
OSPF Process 1 with Router ID 10.0.3.3
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.1 GigabitEthernet0/0/0 10.0.1.1 Full
----------------------------------------------------------------------------
[R3]
确认以上个路由器ospf进程和Router ID正确,且邻居关系全部达到full状态。
步骤四.OSPF外部路由引入及验证
在R3上使inport-router命令引入直连外部路由。
[R3]ospf1
[R3-ospf-1]import-routedirect
查看R1和R2的路由表,确认已学到引入的路由10.0.3.0/24和172.64.0.0/24.
[R1]disip routing-table protocol ospf
RouteFlags: R - relay, D - download to fib
------------------------------------------------------------------------------
Publicrouting table : OSPF
Destinations : 4 Routes : 4
OSPFrouting table status :
Destinations : 4 Routes : 4
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.2.2/32 OSPF 10 48 D 10.0.12.2 Serial1/0/0
10.0.3.0/24 O_ASE 150 1 D 10.0.13.3 GigabitEthernet0/0/0
10.0.3.3/32 OSPF 10 1 D 10.0.13.3 GigabitEthernet0/0/0
172.64.0.0/24 O_ASE 150 1 D 10.0.13.3 GigabitEthernet0/0/0
OSPFrouting table status :
Destinations : 0 Routes : 0
[R2]disip routing-table protocol ospf
RouteFlags: R - relay, D - download to fib
------------------------------------------------------------------------------
Publicrouting table : OSPF
Destinations : 5 Routes : 5
OSPFrouting table status :
Destinations : 5 Routes : 5
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.1.1/32 OSPF 10 48 D 10.0.12.1 Serial1/0/0
10.0.3.0/24 O_ASE 150 1 D 10.0.12.1 Serial1/0/0
10.0.3.3/32 OSPF 10 49 D 10.0.12.1 Serial1/0/0
10.0.13.0/24 OSPF 10 49 D 10.0.12.1 Serial1/0/0
172.64.0.0/24 O_ASE 150 1 D 10.0.12.1 Serial1/0/0
OSPFrouting table status :
Destinations : 0 Routes : 0
以上红色部分显示为引入的外部路由。Proto字段为O_ASE表示OSPF外部路由。
使用带源参数的ping命令测试网络的连通性。
[R2]ping-a 10.0.2.2 10.0.3.3
PING 10.0.3.3: 56 data bytes, press CTRL_C to break
Reply from 10.0.3.3: bytes=56 Sequence=1ttl=254 time=30 ms
Reply from 10.0.3.3: bytes=56 Sequence=2ttl=254 time=20 ms
Reply from 10.0.3.3: bytes=56 Sequence=3ttl=254 time=20 ms
Reply from 10.0.3.3: bytes=56 Sequence=4ttl=254 time=20 ms
Reply from 10.0.3.3: bytes=56 Sequence=5ttl=254 time=30 ms
--- 10.0.3.3 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/24/30 ms
[R2]ping -a 10.0.2.2 172.64.0.1
PING 172.64.0.1: 56 data bytes, press CTRL_C to break
Reply from 172.64.0.1:bytes=56 Sequence=1 ttl=254 time=20 ms
Reply from 172.64.0.1:bytes=56 Sequence=2 ttl=254 time=20 ms
Reply from 172.64.0.1:bytes=56 Sequence=3 ttl=254 time=10 ms
Reply from 172.64.0.1:bytes=56 Sequence=4 ttl=254 time=10 ms
Reply from 172.64.0.1:bytes=56 Sequence=5 ttl=254 time=20 ms
--- 172.64.0.1 pingstatistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max =10/16/20 ms