配置IP
如 r1
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip address 16.0.0.1 24
[r1]interface g0/0/1
[r1-GigabitEthernet0/0/1]ip address 61.0.0.1 24
[r1]interface LoopBack 0
[r1-LoopBack0]ip address 192.168.6.1 24
[r1]interface LoopBack 1
[r1-LoopBack1]ip address 192.168.1.1 24
[r1]ip route-static 0.0.0.0 0 61.0.0.2
[r1]ip route-static 0.0.0.0 0 16.0.0.2
[r1]ip route-static 56.0.0.0 24 61.0.0.2
[r1]ip route-static 56.0.0.0 24 16.0.0.2
[r1]ip route-static 46.0.0.0 24 16.0.0.2
[r1]ip route-static 36.0.0.0 24 16.0.0.2
[r1]ip route-static 26.0.0.0 24 16.0.0.2
[r1]ip route-static 26.0.0.0 24 61.0.0.2
[r1]ip route-static 36.0.0.0 24 61.0.0.2
[r1]ip route-static 46.0.0.0 24 61.0.0.2
r1,r2,r3的hub and spoke架构
r1上
[r1]interface Tunnel 0/0/0
[r1-Tunnel0/0/0]ip ad
[r1-Tunnel0/0/0]ip address 192.168.7.1 24
[r1-Tunnel0/0/0]tunnel-protocol gre p2mp
[r1-Tunnel0/0/0]so
[r1-Tunnel0/0/0]source 16.0.0.1
Apr 16 2024 17:09:56-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r1-Tunnel0/0/0]
[r1-Tunnel0/0/0]nhrp ne
[r1-Tunnel0/0/0]nhrp network-id 100
r2
[r2]in t0/0/0
[r2-Tunnel0/0/0]ip ad
[r2-Tunnel0/0/0]ip address 192.168.7.2 24
[r2-Tunnel0/0/0]tun
[r2-Tunnel0/0/0]tunnel-protocol gre p2
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]sou
[r2-Tunnel0/0/0]source g0/0/0
Apr 16 2024 17:11:45-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r2-Tunnel0/0/0]nh
[r2-Tunnel0/0/0]nhrp n
[r2-Tunnel0/0/0]nhrp network-id 10
[r2-Tunnel0/0/0]nhrp entry 192.168.7.1 16.0.0.1 register
r3
[r3]interface Tunnel 0/0/0
[r3-Tunnel0/0/0]ip ad
[r3-Tunnel0/0/0]ip address 192.168.7.3 24
[r3-Tunnel0/0/0]tu
[r3-Tunnel0/0/0]tunnel-protocol gre p2
[r3-Tunnel0/0/0]tunnel-protocol gre p2mp
[r3-Tunnel0/0/0]so
[r3-Tunnel0/0/0]source g 0/0/0
Apr 16 2024 17:13:38-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/0 has entered the UP state.
[r3-Tunnel0/0/0]nhrp network-id 100
[r3-Tunnel0/0/0]nhrp entry 192.168.7.1 16.0.0.1 register
r1上display一下
[r1-Tunnel0/0/0]display nhrp peer all
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
192.168.7.2 32 26.0.0.1 192.168.7.2 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:02:44
Expire time : 01:57:16
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
192.168.7.3 32 36.0.0.1 192.168.7.3 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:00:54
Expire time : 01:59:06
Number of nhrp peers: 2
r1,r4,r5上两两连接
r1
[r1]interface Tunnel 0/0/1
[r1-Tunnel0/0/1]ip ad
[r1-Tunnel0/0/1]ip address 192.168.8.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 61.0.0.1
[r1-Tunnel0/0/1]nhrp network-id 200
r4
[r4]interface Tunnel 0/0/1
[r4-Tunnel0/0/1] ip ad
[r4-Tunnel0/0/1]ip address 192.168.8.2 242
[r4-Tunnel0/0/1]tunnel-protocol gre p2mp
[r4-Tunnel0/0/1]source g0/0/0
[r4-Tunnel0/0/1]nhrp network-id 200
[r4-Tunnel0/0/1]nhrp entry 192.168.8.1 61.0.0.1 register
r5
[r5]in t0/0/1
[r5-Tunnel0/0/1]ip address 192.168.8.3 24
[r5-Tunnel0/0/1]tunnel-protocol gre p2mp
[r5-Tunnel0/0/1]source g0/0/0
[r5-Tunnel0/0/1]nhrp entry 192.168.8.1 61.0.0.1 register
其他连接类似
开启伪广播
[r1]in t0/0/0
[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到r5上更改type
[r1]interface t0/0/0
[r1-Tunnel0/0/0]ospf network-type broadcast