ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

OSPF动态路由实验

2021-09-14 23:35:01  阅读:211  来源: 互联网

标签:27 r3 OSPF GigabitEthernet0 192.168 0.0 动态 ospf 路由


第一步:分配IP

在192.168.1.0 /24里划分

所以划分8个网段 ---- 借三位     
192.168.1.000 0 0000 /27 --- 192.168.1.0/27
192.168.1.001 0 0000 /27 --- 192.168.1.32/27
192.168.1.010 0 0000 /27 --- 192.168.1.64/27
192.168.1.011 0 0000 /27 --- 192.168.1.96/27
192.168.1.100 0 0000 /27 --- 192.168.1.128/27

192.168.1.101 0 0000 /27
192.168.1.110 0 0000 /27
192.168.1.111 0 0000 /27

第二步:配IP与环回地址

   R1
[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add	
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 27
Sep 14 2021 21:49:28-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r1-GigabitEthernet0/0/0]q
[r1]interface l 1
[r1-LoopBack1]ip add 192.168.1.65 27
[r1-LoopBack1]
    R2
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 27
[r2-GigabitEthernet0/0/0]
Sep 14 2021 21:51:45-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r2-GigabitEthernet0/0/0]q
[r2]interface l 2
[r2-LoopBack2]ip add 192.168.1.97 27
    R3
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.3 27
Sep 14 2021 21:54:08-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r3-GigabitEthernet0/0/0]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.33 27
Sep 14 2021 21:54:26-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 
on the interface GigabitEthernet0/0/1 has entered the UP state. 
[r3-GigabitEthernet0/0/1]q
[r3]interface l1
[r3-LoopBack1]ip add 192.168.1.129 27
[r3-LoopBack1]
    R4
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.34 27
Sep 14 2021 21:55:23-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[r4-GigabitEthernet0/0/0]q
[r4]interface l 1
[r4-LoopBack1]ip add 4.4.4.1 24
[r4-LoopBack1]

第三步:配置OSPF      分三步走:启动、创建、宣告。

[r1]ospf 1 router-id 1.1.1.1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]network 192.168.1.1 0.0.0.255
[r1-ospf-1-area-0.0.0.0]network 192.168.1.65 0.0.0.255
[r1-ospf-1-area-0.0.0.0]


[r2]ospf 1 router-id 2.2.2.2	
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]net	
[r2-ospf-1-area-0.0.0.0]network 192.168.1.97 0.0.0.255
[r2-ospf-1-area-0.0.0.0]


[r3]ospf 1 router-id 3.3.3.3
[r3-ospf-1]area 0 
[r3-ospf-1-area-0.0.0.0]network 192.168.1.129 0.0.0.255
[r3-ospf-1-area-0.0.0.0]q
[r3-ospf-1]area 1
[r3-ospf-1-area-0.0.0.1]net	
[r3-ospf-1-area-0.0.0.1]network 192.168.1.33 0.0.0.0
[r3-ospf-1-area-0.0.0.1]

第四步:设置优先级(r1/r2)


[r1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ospf dr-priority 0
<r1>reset ospf 1 process 
Warning: The OSPF process will be reset. Continue? [Y/N]:y
Sep 14 2021 22:15:07-08:00 r1 %%01OSPF/3/NBR_CHG_DOWN(l)[16]:Neighbor event:neig
hbor state changed to Down. (ProcessId=256, NeighborAddress=2.2.2.2, NeighborEve
nt=KillNbr, NeighborPreviousState=Full, NeighborCurrentState=Down) 
<r1>


[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ospf dr-priority 0
<r2>reset ospf 1 process
Warning: The OSPF process will be reset. Continue? [Y/N]:y
Sep 14 2021 22:17:58-08:00 r2 %%01OSPF/3/NBR_CHG_DOWN(l)[13]:Neighbor event:neig
hbor state changed to Down. (ProcessId=256, NeighborAddress=1.1.1.1, NeighborEve
nt=KillNbr, NeighborPreviousState=2Way, NeighborCurrentState=Down) 

第五步:配置缺省路由

[r3-ospf-1]default-route-advertise always ---- 强制发缺省路由
[r3-ospf-1]



[r4]ospf 1 router-id 1.1.1.1
[r4-ospf-1]area 1
[r4-ospf-1-area-0.0.0.1]network 192.168.1.32 0.0.0.0 --- area1中宣告0/0/0/0接口

第六步:分别配area1和area0的网络域

[r1]int g 0/0/0 ---area0
[r1-GigabitEthernet0/0/0]ospf auth	
[r1-GigabitEthernet0/0/0]ospf authentication-mode  md5 1 cipher 12345


[r2]int g 0/0/0---area0
[r2-GigabitEthernet0/0/0]ospf authentication-mode  md5 1 cipher 12345


[r3]int g 0/0/0 ---area0
[r3-GigabitEthernet0/0/0]ospf authentication-mode  md5 1 cipher 12345
r3有两个网络域area 0 与area 1
[r3-GigabitEthernet0/0/0]int g 0/0/1 ---area1
[r3-GigabitEthernet0/0/1]ospf authentication-mode  md5 1 cipher 1234578
[r3-GigabitEthernet0/0/1]

[r4]int g 0/0/1 ---area1
[r4-GigabitEthernet0/0/1]ospf authentication-mode  md5 1 cipher 1234578
[r4-GigabitEthernet0/0/1]

第七步:r3作为DR,并给R1-R4配置空接口

[r3-ospf-1]area 0
[r3-ospf-1-area-0.0.0.0]abr-summary 192.168.1.0 255.255.255.0


[r1]ip route-static 192.168.1.64 27 NULL 0

[r2]ip route-static 192.168.1.96 27 NULL 0

[r3]ip route-static 192.168.1.0 24 NULL 0

[r4]ip route-static 4.4.4.0 24 NULL 0

最后一步:测试

标签:27,r3,OSPF,GigabitEthernet0,192.168,0.0,动态,ospf,路由
来源: https://blog.csdn.net/m0_60379130/article/details/120297026

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有