ospf实现多区域互通实例

在这里插入图片描述

R6

undo ter
undo terminal mo
undo terminal monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R6
[R6]user-int
[R6]user-interface co
[R6]user-interface console 0
[R6-ui-console0]idle-t
[R6-ui-console0]idle-timeout 0 0
[R6-ui-console0]quit

配置接口ID

[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip add 10.1.1.1 24
[R6-GigabitEthernet0/0/0]undo shut
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R6-GigabitEthernet0/0/0]int g0/0/1
[R6-GigabitEthernet0/0/1]ip add 10.1.2.1 24
[R6-GigabitEthernet0/0/1]undo shut
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R6-GigabitEthernet0/0/1]int loop0
[R6-LoopBack0]ip add 1.1.1.1 32
[R6-LoopBack0]quit

R6路由器的ID

[R6]ro
[R6]router id 1.1.1.1
Info: Router ID has been modified, please reset the relative protocols manually
to update the Router ID.

进入ospf各个接口在所在区域要宣告一下,这里要用反掩码,正掩码只能知道我要传到哪个网段,但不知道我是哪个主机号,要精确到具体地址

[R6]ospf
[R6-ospf-1]area 1
[R6-ospf-1-area-0.0.0.1]net
[R6-ospf-1-area-0.0.0.1]network 1.1.1.1 0.0.0.0
[R6-ospf-1-area-0.0.0.1]net
[R6-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.255
[R6-ospf-1-area-0.0.0.1]area 0
[R6-ospf-1-area-0.0.0.0]net
[R6-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[R6-ospf-1-area-0.0.0.0]quit
[R6-ospf-1]ping -a 1.1.1.1 3.3.3.3
PING 3.3.3.3: 56 data bytes, press CTRL_C to break
Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=255 time=20 ms
Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=255 time=20 ms

— 3.3.3.3 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/22/30 ms

[R6-ospf-1]ping 10.1.1.3
PING 10.1.1.3: 56 data bytes, press CTRL_C to break
Reply from 10.1.1.3: bytes=56 Sequence=1 ttl=255 time=50 ms
Reply from 10.1.1.3: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 10.1.1.3: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 10.1.1.3: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 10.1.1.3: bytes=56 Sequence=5 ttl=255 time=20 ms

— 10.1.1.3 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/28/50 ms
[R6-ospf-1]
[R6-ospf-1]ping -a 1.1.1.1 4.4.4.4
PING 4.4.4.4: 56 data bytes, press CTRL_C to break
Reply from 3.3.3.3: bytes=56 Sequence=1 ttl=255 time=20 ms
Reply from 3.3.3.3: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 3.3.3.3: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 3.3.3.3: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 3.3.3.3: bytes=56 Sequence=5 ttl=255 time=20 ms
最后用命令display ip routing-table 查看其他路由器的信息.

R7

<Huawei

undo ter
undo terminal mo
undo terminal monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R7
[R7]user-int
[R7]user-interface co
[R7]user-interface console 0
[R7-ui-console0]idle-t
[R7-ui-console0]idle-timeout 0 0
[R7-ui-console0]quit
[R7]int g0/0/0
[R7-GigabitEthernet0/0/0]ip add 10.1.2.2 24
[R7-GigabitEthernet0/0/0]undo shut
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R7-GigabitEthernet0/0/0]int g0/0/1
[R7-GigabitEthernet0/0/1]ip add 10.1.3.2 24
[R7-GigabitEthernet0/0/1]undo shut
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[R7-GigabitEthernet0/0/1]int loop 0
[R7-LoopBack0]ip add 3.3.3.3 32
[R7-LoopBack0]quit
[R7]ping 10.1.2.1
PING 10.1.2.1: 56 data bytes, press CTRL_C to break
Reply from 10.1.2.1: bytes=56 Sequence=1 ttl=255 time=20 ms
Reply from 10.1.2.1: bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 10.1.2.1: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 10.1.2.1: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 10.1.2.1: bytes=56 Sequence=5 ttl=255 time=30 ms

— 10.1.2.1 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/22/30 ms

[R7]ping 10.1.3.4
PING 10.1.3.4: 56 data bytes, press CTRL_C to break
Reply from 10.1.3.4: bytes=56 Sequence=1 ttl=255 time=70 ms
Reply from 10.1.3.4: bytes=56 Sequence=2 ttl=255 time=10 ms
Reply from 10.1.3.4: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 10.1.3.4: bytes=56 Sequence=4 ttl=255 time=30 ms
Reply from 10.1.3.4: bytes=56 Sequence=5 ttl=255 time=20 ms

— 10.1.3.4 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/30/70 ms

[R7]ro
[R7]router id 3.3.3.3
Info: Router ID has been modified, please reset the relative protocols manually
to update the Router ID.
[R7]ospf
[R7-ospf-1]area 0
[R7-ospf-1-area-0.0.0.0]net
[R7-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0
[R7-ospf-1-area-0.0.0.0]net
[R7-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[R7-ospf-1-area-0.0.0.0]return
ping -a 3.3.3.3 2.2.2.2
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=254 time=40 ms
Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=254 time=20 ms
Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=254 time=20 ms
Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=254 time=20 ms
Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=254 time=20 ms

— 2.2.2.2 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/24/40 ms

ping -a 3.3.3.3 1.1.1.1
PING 1.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=255 time=40 ms
Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=255 time=30 ms
Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms
Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=255 time=10 ms

— 1.1.1.1 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 10/24/40 ms

R8

<Huawei
undo ter
undo terminal mo
undo terminal monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R8
[R8]user-int
[R8]user-interface co
[R8]user-interface console 0
[R8-ui-console0]idle-t
[R8-ui-console0]idle-timeout 0 0
[R8-ui-console0]quit
[R8]int g0/0/0
[R8-GigabitEthernet0/0/0]ip add 10.1.1.3 24
[R8-GigabitEthernet0/0/0]undo shut
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R8-GigabitEthernet0/0/0]int loop 0
[R8-LoopBack0]ip add 2.2.2.2 32
[R8-LoopBack0]quit
[R8]ro
[R8]router id 2.2.2.2
Info: Router ID has been modified, please reset the relative protocols manually
to update the Router ID.
[R8]ospf
[R8-ospf-1]area 1
[R8-ospf-1-area-0.0.0.1]net
[R8-ospf-1-area-0.0.0.1]network 10.1.1.0 0.0.0.255
[R8-ospf-1-area-0.0.0.1]net
[R8-ospf-1-area-0.0.0.1]network 2.2.2.2 0.0.0.0
[R8-ospf-1-area-0.0.0.1]return

R9

<Huawei

undo ter
undo terminal mo
undo terminal monitor
Info: Current terminal monitor is off.
sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname R9
[R9]user-in
[R9]user-interface co
[R9]user-interface console 0
[R9-ui-console0]idle-t
[R9-ui-console0]idle-timeout 0 0
[R9-ui-console0]quit
[R9]int g0/0/0
[R9-GigabitEthernet0/0/0]ip add 10.1.3.4 24
[R9-GigabitEthernet0/0/0]undo shut
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[R9-GigabitEthernet0/0/0]int loop 0
[R9-LoopBack0]ip add 4.4.4.4 32
[R9-LoopBack0]quit
[R9]ro
[R9]router id 4.4.4.4
Info: Router ID has been modified, please reset the relative protocols manually
to update the Router ID.
[R9]ospf
[R9-ospf-1]area 2
[R9-ospf-1-area-0.0.0.2]net
[R9-ospf-1-area-0.0.0.2]network 4.4.4.4 0.0.0.0
[R9-ospf-1-area-0.0.0.2]net
[R9-ospf-1-area-0.0.0.2]network 10.1.3.0 0.0.0.255
[R9-ospf-1-area-0.0.0.2]return
ping -a 4.4.4.4 1.1.1.1
PING 1.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=254 time=40 ms
Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=254 time=20 ms
Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=254 time=30 ms
Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=254 time=30 ms
Reply from 1.1.1.1: bytes=56 Sequence=5 ttl=254 time=30 ms

— 1.1.1.1 ping statistics —
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/30/40 ms

完整实验就做好了

猜你喜欢

转载自blog.csdn.net/weixin_48185643/article/details/107593287