HCIP实验---OSPF实验2

HCIP实验---OSPF实验2_第1张图片

 

1.如图连接,合理规划IP地址,所有路由器各自创建一个loopback接口
2.R1再创建三个接口IP地址为201.1.1.1/24、201.1.2.1/24、201.1.3.1/24
   R5再创建三个接口IP地址为202.1.1.1/24、202.1.2.1/24、202.1.3.1/24
   R7再创建三个接口IP地址为203.1.1.1/24、203.1.2.1/24、203.1.3.1/24
3.如图运行路由协议
  R1 -R2  -R3之间使用MGRE网络,为hub-spoke 网络结构,R1为hub端 ,
部署OSPF网络,MGRE修改为BMA网络类型
4.area  1  区域不得出现4.5类LSA 
5.其他区域优先通过R3访问R1 三个环回接口
6.尽量减少路由条目数量
7.area 1 区域增加安全性
8.全网可达

配置路由

[R1]INT G 0/0/0
[R1-GigabitEthernet0/0/0]ip add  18.1.1.1 24
Jul  9 2023 18:04:16-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]int lo0
[R1-LoopBack0]ip add 201.1.1.1 24
[R1-LoopBack0]int lo 1
[R1-LoopBack1]ip add 201.1.2.1 24
[R1-LoopBack1]int lo 2
[R1-LoopBack2]ip add 201.1.3.1 24
[R1-LoopBack2]int lo 3
[R1-LoopBack3]ip add 1.1.1.1 24
[R1-LoopBack3]
[R2]int g 0/0/1
[R2-GigabitEthernet0/0/1]ip add 28.1.1.2 24
[R2-GigabitEthernet0/0/1]int s 4/0/0
[R2-Serial4/0/0]ip add 24.1.1.1 24
[R2-Serial4/0/0]int lo0 
[R2-LoopBack0]ip add 2.2.2.1 24
[R2-LoopBack0]
[r3]int g 0/0/2
[r3-GigabitEthernet0/0/2]ip add 38.1.1.2 24
[r3-GigabitEthernet0/0/2]
[r3-GigabitEthernet0/0/2]int lo 0
[r3-LoopBack0]ip add 3.3.3.1 24
[r3-LoopBack0]int s 4/0/0
[r3-Serial4/0/0]ip add 34.1.1.1 24
[r3-Serial4/0/0]
[R4]int s 4/0/0
[R4-Serial4/0/0]ip add 24.1.1.2 24
[R4-Serial4/0/0]
[R4-Serial4/0/0]int s 4/0/1
[R4-Serial4/0/1]ip add 34.1.1.2 24
[R4-Serial4/0/1]int g 0/0/0
[R4-GigabitEthernet0/0/0]ip add 45.1.1.1 24
[R4-GigabitEthernet0/0/0]int g 0/0/1
[R4-GigabitEthernet0/0/1]ip add 46.1.1.1 24
[R4-GigabitEthernet0/0/1]
[R4-GigabitEthernet0/0/1]int lo 0
[R4-LoopBack0]ip add 4.4.4.1 24
[R4-LoopBack0]
[R5]int g 0/0/0
[R5-GigabitEthernet0/0/0]ip add 45.1.1.2 24
[R5-GigabitEthernet0/0/0]int lo0 
[R5-LoopBack0]ip add 5.5.5.1 24
[R5]int lo 1
[R5-LoopBack1]ip add 202.1.1.1 24
[R5-LoopBack1]int lo 2
[R5-LoopBack2]ip add 202.1.2.1 24
[R5-LoopBack2]int lo3
[R5-LoopBack3]ip add 202.1.3.1 24
[R6]int g 0/0/1
[R6-GigabitEthernet0/0/1]ip add 46.1.1.2 24
[R6-GigabitEthernet0/0/1]int g 0/0/0
[R6-GigabitEthernet0/0/0]ip add 67.1.1.1 24
[R6-GigabitEthernet0/0/0]int lo0
[R6-LoopBack0]ip add 6.6.6.1 24
[R7]int g 0/0/0
[R7-GigabitEthernet0/0/0]ip add 67.1.1.2 24
[R7-GigabitEthernet0/0/0]int lo 0
[R7-LoopBack0]ip add 7.7.7.1 24
[R7]int lo1
[R7-LoopBack1]ip add 203.1.1.1 24
[R7-LoopBack1]int lo2
[R7-LoopBack2]ip add 203.1.2.1 24
[R7-LoopBack2]int lo3
[R7-LoopBack3]ip add 203.1.3.1 24
[R8]int g 0/0/0 
[R8-GigabitEthernet0/0/0]ip add 18.1.1.2 24
[R8-GigabitEthernet0/0/0]int g 0/0/1
[R8-GigabitEthernet0/0/1]ip add 28.1.1.1 24
[R8-GigabitEthernet0/0/1]int g 0/0/2
[R8-GigabitEthernet0/0/2]ip add 38.1.1.1 24
[R8-GigabitEthernet0/0/2]
[R8-GigabitEthernet0/0/2]int lo 0 
[R8-LoopBack0]ip add 8.8.8.1 24
[R8-LoopBack0]

配置缺省路由

[R1]ip route-	
[R1]ip route-static 0.0.0.0 0 18.1.1.2
[R1]
[R2]ip ro	
[R2]ip route-	
[R2]ip route-static 0.0.0.0 0 28.1.1.1
[R2]
[r3]ip ro	
[r3]ip route-	
[r3]ip route-static 0.0.0.0 0 38.1.1.1
[r3]

 检测缺省配置是否成功

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

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

[R1]ping 38.1.1.1
  PING 38.1.1.1: 56  data bytes, press CTRL_C to break
    Reply from 38.1.1.1: bytes=56 Sequence=1 ttl=255 time=10 ms
    Reply from 38.1.1.1: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 38.1.1.1: bytes=56 Sequence=3 ttl=255 time=20 ms
    Reply from 38.1.1.1: bytes=56 Sequence=4 ttl=255 time=20 ms

  --- 38.1.1.1 ping statistics ---
    4 packet(s) transmitted
    4 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 10/17/20 ms

[R1]

由于area1为特殊区域(NSSA),所以我们需要配置tunnel隧道来链接3台路由器,使其能够正常通信。

[R1]int t 0/0/0
[R1-Tunnel0/0/0]ip add 100.1.1.1 24
[R1-Tunnel0/0/0]tu	
[R1-Tunnel0/0/0]tunnel-protocol g	
[R1-Tunnel0/0/0]tunnel-protocol gre p
[R1-Tunnel0/0/0]
[R1-Tunnel0/0/0]nhr	
[R1-Tunnel0/0/0]nhrp ne	
[R1-Tunnel0/0/0]nhrp network-id 100
[R1-Tunnel0/0/0]nh	
[R1-Tunnel0/0/0]nhrp en	
[R1-Tunnel0/0/0]nhrp entry mu	
[R1-Tunnel0/0/0]nhrp entry multicast dy	
[R1-Tunnel0/0/0]nhrp entry multicast dynamic 
[R1-Tunnel0/0/0]dis this
[V200R003C00]
#
interface Tunnel0/0/0
 ip address 100.1.1.1 255.255.255.0 
 tunnel-protocol gre p2mp
 source 18.1.1.1
 nhrp entry multicast dynamic
 nhrp network-id 100
#
return
[R1-Tunnel0/0/0]
[R2]int t 0/0/0
[R2-Tunnel0/0/0]ip add 100.1.1.2 24
[R2-Tunnel0/0/0]tu	
[R2-Tunnel0/0/0]tunnel-protocol g	
[R2-Tunnel0/0/0]tunnel-protocol gre p	
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp 
[R2-Tunnel0/0/0]so	
[R2-Tunnel0/0/0]source 28.1.1.2 
[R2-Tunnel0/0/0]nh	
[R2-Tunnel0/0/0]nhrp ne	
[R2-Tunnel0/0/0]nhrp network-id 100
[R2-Tunnel0/0/0]nhr	
[R2-Tunnel0/0/0]nhrp en	
[R2-Tunnel0/0/0]nhrp entry mu	
[R2-Tunnel0/0/0]nhrp entry 100.1.1.1 18.1.1.1  re	
[R2-Tunnel0/0/0]nhrp entry 100.1.1.1 18.1.1.1  register 
[R2-Tunnel0/0/0]dis this
[V200R003C00]
#
interface Tunnel0/0/0
 ip address 100.1.1.2 255.255.255.0 
 tunnel-protocol gre p2mp
 source 28.1.1.2
 nhrp network-id 100
 nhrp entry 100.1.1.1 18.1.1.1 register
#
return
[r3]int t 0/0/0
[r3-Tunnel0/0/0]ip add 100.1.1.3 24
[r3-Tunnel0/0/0]tu	
[r3-Tunnel0/0/0]tunnel-protocol g	
[r3-Tunnel0/0/0]tunnel-protocol gre p	
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp 
[r3-Tunnel0/0/0]s	
[r3-Tunnel0/0/0]so	
[r3-Tunnel0/0/0]source 38.1.1.2
[r3-Tunnel0/0/0]
[r3-Tunnel0/0/0]nh	
[r3-Tunnel0/0/0]nhrp ne	
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nh	
[r3-Tunnel0/0/0]nhrp en	
[r3-Tunnel0/0/0]nhrp entry 100.1.1.1 18.1.1.1 re	
[r3-Tunnel0/0/0]nhrp entry 100.1.1.1 18.1.1.1 register 
[r3-Tunnel0/0/0]dis this
[V200R003C00]
#
interface Tunnel0/0/0
 ip address 100.1.1.3 255.255.255.0 
 tunnel-protocol gre p2mp
 source 38.1.1.2
 nhrp network-id 100
 nhrp entry 100.1.1.1 18.1.1.1 register
#
return

查看nhrp配置情况

[R1]dis nhrp peer all
------------------------------------------------------------------------------- 
Protocol-addr   Mask  NBMA-addr       NextHop-addr    Type         Flag         
------------------------------------------------------------------------------- 
100.1.1.2       32    28.1.1.2        100.1.1.2       dynamic      route tunnel 
------------------------------------------------------------------------------- 
Tunnel interface: Tunnel0/0/0
Created time    : 00:05:14
Expire time     : 01:54:46
------------------------------------------------------------------------------- 
Protocol-addr   Mask  NBMA-addr       NextHop-addr    Type         Flag         
------------------------------------------------------------------------------- 
100.1.1.3       32    38.1.1.2        100.1.1.3       dynamic      route tunnel 
------------------------------------------------------------------------------- 
Tunnel interface: Tunnel0/0/0
Created time    : 00:01:01
Expire time     : 01:58:59

Number of nhrp peers: 2
[R1]ping 100.1.1.2
  PING 100.1.1.2: 56  data bytes, press CTRL_C to break
    Reply from 100.1.1.2: bytes=56 Sequence=1 ttl=255 time=30 ms
    Reply from 100.1.1.2: bytes=56 Sequence=2 ttl=255 time=30 ms
    Reply from 100.1.1.2: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 100.1.1.2: bytes=56 Sequence=4 ttl=255 time=30 ms

  --- 100.1.1.2 ping statistics ---
    4 packet(s) transmitted
    4 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/30/30 ms

[R1]ping 100.1.1.3
  PING 100.1.1.3: 56  data bytes, press CTRL_C to break
    Reply from 100.1.1.3: bytes=56 Sequence=1 ttl=255 time=40 ms
    Reply from 100.1.1.3: bytes=56 Sequence=2 ttl=255 time=50 ms
    Reply from 100.1.1.3: bytes=56 Sequence=3 ttl=255 time=30 ms

  --- 100.1.1.3 ping statistics ---
    3 packet(s) transmitted
    3 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/40/50 ms

[R1]

开启OSPF和RIP通告路由,并设置环回接口类型


[R1]ospf 100 ro	
[R1]ospf 100 router-id 91.1.1.1
[R1-ospf-100]area 0
[R1-ospf-100-area-0.0.0.0]net	
[R1-ospf-100-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R1-ospf-100-area-0.0.0.0]net	
[R1-ospf-100-area-0.0.0.0]network 201.1.0.0 0.0.255.255
[R1-ospf-100-area-0.0.0.0]net	
[R1-ospf-100-area-0.0.0.0]network 100.1.1.1 0.0.0.0
[R1-ospf-100-area-0.0.0.0]int lo 0
[R1-LoopBack0]ospf ne	
[R1-LoopBack0]ospf network-type b	
[R1-LoopBack0]ospf network-type broadcast 
[R1-LoopBack0]int lo1
[R1-LoopBack1]ospf ne	
[R1-LoopBack1]ospf network-type b	
[R1-LoopBack1]ospf network-type broadcast 
[R1-LoopBack1]int lo2
[R1-LoopBack2]ospf net	
[R1-LoopBack2]ospf network-type b	
[R1-LoopBack2]ospf network-type broadcast 
[R1-LoopBack2]int lo 3 
[R1-LoopBack3]ospf ne	
[R1-LoopBack3]ospf network-type b	
[R1-LoopBack3]ospf network-type broadcast 
[R1-LoopBack3]
[R2]ospf ro	
[R2]ospf 100  router-id 92.1.1.1
[R2-ospf-100]area 0
[R2-ospf-100-area-0.0.0.0]net	
[R2-ospf-100-area-0.0.0.0]network 100.1.1.2 0.0.0.0
[R2-ospf-100-area-0.0.0.0]q
[R2-ospf-100]area 1
[R2-ospf-100-area-0.0.0.1]net	
[R2-ospf-100-area-0.0.0.1]network 24.1.1.1 0.0.0.0
[R2-ospf-100-area-0.0.0.1]net	
[R2-ospf-100-area-0.0.0.1]network 2.2.2.2 0.0.0.0
[R2-ospf-100-area-0.0.0.1]int lo 0
[R2-LoopBack0]ospf ne	
[R2-LoopBack0]ospf network-type b	
[R2-LoopBack0]ospf network-type broadcast 
[R2-LoopBack0]
r3-Tunnel0/0/0]ospf 100 ro	
[r3-Tunnel0/0/0]ospf 100 router	
[r3-Tunnel0/0/0]ospf 100 router-id 93.3.3.3
[r3-ospf-100]area 0
[r3-ospf-100-area-0.0.0.0]net	
[r3-ospf-100-area-0.0.0.0]network 100.1.1.3 0.0.0.0
[r3-ospf-100-area-0.0.0.0]q
[r3-ospf-100]area 1
[r3-ospf-100-area-0.0.0.1]net	
[r3-ospf-100-area-0.0.0.1]network 
[r3-ospf-100-area-0.0.0.1]network 34.1.1.1 0.0.0.0
[r3-ospf-100-area-0.0.0.1]net	
[r3-ospf-100-area-0.0.0.1]network 3.3.3.3 0.0.0.0
[r3-ospf-100-area-0.0.0.1]int lo 0
[r3-LoopBack0]ospf ne	
[r3-LoopBack0]ospf network-type b	
[r3-LoopBack0]ospf network-type broadcast 
[r3-LoopBack0]
[R4]ospf 100 ro	
[R4]ospf 100 router-id 94.4.4.4
[R4-ospf-100]area 1
[R4-ospf-100-area-0.0.0.1] net	
[R4-ospf-100-area-0.0.0.1]network 4.4.4.4 0.0.0.0
[R4-ospf-100-area-0.0.0.1]neet	
[R4-ospf-100-area-0.0.0.1]net	
[R4-ospf-100-area-0.0.0.1]network 24.1.1.2 0.0.0.0
[R4-ospf-100-area-0.0.0.1]net	
[R4-ospf-100-area-0.0.0.1]network 34.1.1.2 0.0.0.0
[R4-ospf-100-area-0.0.0.1]q
[R4-ospf-100]area 2
[R4-ospf-100-area-0.0.0.2]net	
[R4-ospf-100-area-0.0.0.2]network 46.1.1.1 0.0.0.0
[R4-ospf-100-area-0.0.0.1]int lo 9
[R4-LoopBack9]int lo0 
[R4-LoopBack0]ospf ne	
[R4-LoopBack0]ospf network-type b	
[R4-LoopBack0]ospf network-type broadcast 
[R4-LoopBack0]
[R5]rip 200
[R5-rip-200]ver	
[R5-rip-200]verify-source
[R5-rip-200]version 2
[R5-rip-200]net	
[R5-rip-200]network 5.0.0.0
[R5-rip-200]net	
[R5-rip-200]network 45.0.0.0
[R5-rip-200]net	
[R5-rip-200]network 202.1.1.0
[R5-rip-200]network 202.1.2.0
[R5-rip-200]network 202.1.3.0
[R5-rip-200]
[R6]ospf 100 ro	
[R6]ospf 100 router-id 96.1.1.1
[R6-ospf-100]are	
[R6-ospf-100]area 2
[R6-ospf-100-area-0.0.0.2]ne	
[R6-ospf-100-area-0.0.0.2]network 6.6.6.6 0.0.0.0
[R6-ospf-100-area-0.0.0.2]net	
[R6-ospf-100-area-0.0.0.2]network 46.1.1.2 0.0.0.0
[R6-ospf-100-area-0.0.0.2]int lo 0
[R6-LoopBack0]ospf net	
[R6-LoopBack0]ospf network-type b	
[R6-LoopBack0]ospf network-type broadcast 
[R6-LoopBack0]q
[R6]rip 100
[R6-rip-100]vers	
[R6-rip-100]version 2
[R6-rip-100]net	
[R6-rip-100]network 67.0.0.0
[R6-rip-100]
[R7-LoopBack3]rip 100
[R7-rip-100]ver 2
[R7-rip-100]net	
[R7-rip-100]network 67.0.0.0
[R7-rip-100]net	
[R7-rip-100]network 7.0.0.0
[R7-rip-100]net	
[R7-rip-100]network 203.1.1.0
[R7-rip-100]network 203.1.2.0
[R7-rip-100]network 203.1.3.0
[R7-rip-100]

修改R2、R3的DR优先级,保证网络中有且只有R1是DR设备,随后修改R1、R2、R3的tunnel接口的链接方式为broadcast ,以实现MGRE网络的需求

[R2-Tunnel0/0/0]ospf dr	
[R2-Tunnel0/0/0]ospf dr-priority 0

[r3-Tunnel0/0/0]ospf dr	
[r3-Tunnel0/0/0]ospf dr-priority 0

为使得AREA1内不存在4、5类LSA,我们需要将AREA1改为特殊区域NSSA

[R2-Tunnel0/0/0]ospf 100
[R2-ospf-100]area 1
[R2-ospf-100-area-0.0.0.1]nssa

[r3-Tunnel0/0/0]ospf 100
[r3-ospf-100]area 1
[r3-ospf-100-area-0.0.0.1]nssa

[R4-rip-200]ospf 100 
[R4-ospf-100]area 1
[R4-ospf-100-area-0.0.0.1]nssa

查看AREA1内的LSA类型,这里删掉了AREA0的LSA。 

[r3-ospf-100-area-0.0.0.1]dis ospf lsdb

	 OSPF Process 100 with Router ID 93.3.3.3
		 Link State Database 
 
		         Area: 0.0.0.1
 Type      LinkState ID    AdvRouter          Age  Len   Sequence   Metric
 Router    94.4.4.4        94.4.4.4            94  72    80000004      48
 Router    92.1.1.1        92.1.1.1            95  48    80000003      48
 Router    93.3.3.3        93.3.3.3            97  48    80000003      48
 Sum-Net   100.1.1.0       93.3.3.3           108  28    80000001    1562
 Sum-Net   100.1.1.0       92.1.1.1           153  28    80000001    1562
 Sum-Net   1.1.1.0         93.3.3.3           108  28    80000001    1562
 Sum-Net   1.1.1.0         92.1.1.1           153  28    80000001    1562
 Sum-Net   201.1.3.0       93.3.3.3           108  28    80000001    1562
 Sum-Net   201.1.3.0       92.1.1.1           153  28    80000001    1562
 Sum-Net   201.1.2.0       93.3.3.3           108  28    80000001    1562
 Sum-Net   201.1.2.0       92.1.1.1           153  28    80000001    1562
 Sum-Net   201.1.1.0       93.3.3.3           108  28    80000001    1562
 Sum-Net   201.1.1.0       92.1.1.1           153  28    80000001    1562
 NSSA      0.0.0.0         93.3.3.3           108  36    80000001       1
 NSSA      0.0.0.0         92.1.1.1           153  36    80000001       1
 
 
[r3-ospf-100-area-0.0.0.1]

为实现优先通过R3来访问R1的三个环回,我们需要修改开销值,这个过程可以再路由汇总时同时进行

[R2-ospf-100] are 0
[R2-ospf-100-area-0.0.0.0]abr	
[R2-ospf-100-area-0.0.0.0]abr-summary 201.1.0.0 255.255.252.0 cost 10
[R2-ospf-100-area-0.0.0.0]abr	
[R2-ospf-100-area-0.0.0.0]abr-summary 1.1.1.0 255.255.255.0 co	
[R2-ospf-100-area-0.0.0.0]abr-summary 1.1.1.0 255.255.255.0 cost 10
[R2-ospf-100-area-0.0.0.0]


[r3-ospf-100-area-0.0.0.0]abr	
[r3-ospf-100-area-0.0.0.0]abr-summary 201.1.0.0 255.255.252.0 co	
[r3-ospf-100-area-0.0.0.0]abr-summary 201.1.0.0 255.255.252.0 cost 5
[r3-ospf-100-area-0.0.0.0]abr	
[r3-ospf-100-area-0.0.0.0]abr-summary 1.1.1.0 255.255.255.0 c	
[r3-ospf-100-area-0.0.0.0]abr-summary 1.1.1.0 255.255.255.0 cost 5



[r3-ospf-100-area-0.0.0.0]dis ip ro pro ospf 
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
         Destinations : 5        Routes : 5        

OSPF routing table status : 
         Destinations : 5        Routes : 5

Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface

        1.1.1.0/24  OSPF    10   1562        D   100.1.1.1       Tunnel0/0/0
       24.1.1.0/24  OSPF    10   96          D   34.1.1.2        Serial4/0/0
      201.1.1.0/24  OSPF    10   1562        D   100.1.1.1       Tunnel0/0/0
      201.1.2.0/24  OSPF    10   1562        D   100.1.1.1       Tunnel0/0/0
      201.1.3.0/24  OSPF    10   1562        D   100.1.1.1       Tunnel0/0/0

OSPF routing table status : 
         Destinations : 0        Routes : 0

[r3-ospf-100-area-0.0.0.0]

为增加area1的安全性,我们需要配置tunnel隧道提供给area1的路由器进行路由数据传递

[R2-ospf-100-area-0.0.0.0]int t 0/0/1
[R2-Tunnel0/0/1]ip add 200.1.1.1 24
[R2-Tunnel0/0/1]tu	
[R2-Tunnel0/0/1]tunnel-protocol g	
[R2-Tunnel0/0/1]tunnel-protocol gre p	
[R2-Tunnel0/0/1]tunnel-protocol gre p2mp 
[R2-Tunnel0/0/1]so	
[R2-Tunnel0/0/1]source 2.2.2.2
[R2-Tunnel0/0/1]de	
[R2-Tunnel0/0/1]description 4.4.4.4
[R2-Tunnel0/0/1]dis this
[V200R003C00]
#
interface Tunnel0/0/1
 description 4.4.4.4
 ip address 200.1.1.1 255.255.255.0 
 tunnel-protocol gre p2mp
 source 2.2.2.2
#
return
[R2-Tunnel0/0/1]
[r3]int t 0/0/2
[r3-Tunnel0/0/2]ip add 20.1.1.1 24
[r3-Tunnel0/0/2]tu	
[r3-Tunnel0/0/2]tunnel-protocol g	
[r3-Tunnel0/0/2]tunnel-protocol gre 
[r3-Tunnel0/0/2]so	
[r3-Tunnel0/0/2]source 3.3.3.1
[r3-Tunnel0/0/2]dest	
[r3-Tunnel0/0/2]destination 4.4.4.1
[r3-Tunnel0/0/2]dis this
[V200R003C00]
#
interface Tunnel0/0/2
 ip address 20.1.1.1 255.255.255.0 
 tunnel-protocol gre
 source 3.3.3.1
 destination 4.4.4.1
#
return
[r3-Tunnel0/0/2]
[R4]int t 0/0/2
[R4-Tunnel0/0/2]ip add 20.1.1.2 24
[R4-Tunnel0/0/2]tu	
[R4-Tunnel0/0/2]tunnel-protocol g	
[R4-Tunnel0/0/2]tunnel-protocol gre 
[R4-Tunnel0/0/2]so	
[R4-Tunnel0/0/2]source 4.4.4.1
[R4-Tunnel0/0/2]dest	
[R4-Tunnel0/0/2]destination 3.3.3.1
[R4-Tunnel0/0/2]dis this
[V200R003C00]
#
interface Tunnel0/0/2
 ip address 20.1.1.2 255.255.255.0 
 tunnel-protocol gre
 source 4.4.4.1
 destination 3.3.3.1
#
return
[R4-Tunnel0/0/2]
[R4-Tunnel0/0/2]dis ospf p b

	 OSPF Process 100 with Router ID 94.1.1.1
		  Peer Statistic Information
 ----------------------------------------------------------------------------
 Area Id          Interface                        Neighbor id      State    
 0.0.0.0          Tunnel0/0/1                      92.1.1.1         Full        
 0.0.0.0          Tunnel0/0/2                      93.3.3.3         Full        
 0.0.0.1          Serial4/0/0                      92.1.1.1         Full        
 0.0.0.1          Serial4/0/1                      93.3.3.3         Full        
 0.0.0.2          GigabitEthernet0/0/1             96.1.1.1         Full        
 ----------------------------------------------------------------------------
[R4-Tunnel0/0/2]

全网可达

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

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

[R4]ping 7.7.7.1
  PING 7.7.7.1: 56  data bytes, press CTRL_C to break
   Reply from 7.7.7.1: bytes=56 Sequence=1 ttl=255 time=20 ms
   Reply from 7.7.7.1: bytes=56 Sequence=2 ttl=255 time=20 ms
   Reply from 7.7.7.1: bytes=56 Sequence=3 ttl=255 time=30 ms
   Reply from 7.7.7.1: bytes=56 Sequence=4 ttl=255 time=20 ms

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


  --- 7.7.7.1 ping statistics ---
    5 packet(s) transmitted
    0 packet(s) received
    100.00% packet loss

[R4]ping 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=30 ms
    Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=254 time=30 ms
    Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=254 time=40 ms
    Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=254 time=50 ms

  --- 1.1.1.1 ping statistics ---
    4 packet(s) transmitted
    4 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 30/37/50 ms

[R4]ping 2.2.2.1
  PING 2.2.2.1: 56  data bytes, press CTRL_C to break
    Reply from 2.2.2.1: bytes=56 Sequence=1 ttl=255 time=20 ms
    Reply from 2.2.2.1: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 2.2.2.1: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 2.2.2.1: bytes=56 Sequence=4 ttl=255 time=30 ms

  --- 2.2.2.1 ping statistics ---
    4 packet(s) transmitted
    4 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/25/30 ms

[R4]ping 3.3.3.1
  PING 3.3.3.1: 56  data bytes, press CTRL_C to break
    Reply from 3.3.3.1: bytes=56 Sequence=1 ttl=255 time=20 ms
    Reply from 3.3.3.1: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 3.3.3.1: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 3.3.3.1: bytes=56 Sequence=4 ttl=255 time=20 ms

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

[R4]ping 5.5.5.1
  PING 5.5.5.1: 56  data bytes, press CTRL_C to break
    Reply from 5.5.5.1: bytes=56 Sequence=1 ttl=255 time=20 ms
    Reply from 5.5.5.1: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 5.5.5.1: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 5.5.5.1: bytes=56 Sequence=4 ttl=255 time=30 ms

  --- 5.5.5.1 ping statistics ---
    4 packet(s) transmitted
    4 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/25/30 ms

[R4]ping 8.8.8.1
     Reply from 8.8.8.1: bytes=56 Sequence=1 ttl=255 time=20 ms
    Reply from 8.8.8.1: bytes=56 Sequence=2 ttl=255 time=20 ms
    Reply from 8.8.8.1: bytes=56 Sequence=3 ttl=255 time=30 ms
    Reply from 8.8.8.1: bytes=56 Sequence=4 ttl=255 time=30 ms

  --- 8.8.8.1 ping statistics ---
   4 packet(s) transmitted
    4 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 20/25/30 ms

[R4]

你可能感兴趣的:(网络)