R1:
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[R1-GigabitEthernet0/0/0]int s4/0/0
[R1-Serial4/0/0]ip address 12.1.1.1 24
[R1-Serial4/0/0]quit
[R1]
R2:
[R2]int s4/0/0
[R2-Serial4/0/0]ip address 12.1.1.2 24
[R2-Serial4/0/0]int s4/0/1
[R2-Serial4/0/1]ip address 23.1.1.2 24
[R2-Serial4/0/1]int s3/0/0
[R2-Serial3/0/0]ip address 34.1.1.2 24
[R2-Serial3/0/0]int l0
[R2-LoopBack0]ip address 1.1.1.1 24
[R2-LoopBack0]quit
[R2]
R3:
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[R3-GigabitEthernet0/0/0]int s4/0/0
[R3-Serial4/0/0]ip address 23.1.1.1 24
[R3-Serial4/0/0]quit
[R3]
R4:
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[R4-GigabitEthernet0/0/0]int s4/0/0
[R4-Serial4/0/0]ip address 34.1.1.1 24
[R4-Serial4/0/0]quit
[R4]
查看接口配置情况
R1:
[R1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 3
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 3
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.1/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
Serial4/0/0 12.1.1.1/24 up up
Serial4/0/1 unassigned down down
[R1]
R2:
[R2]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 4
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 4
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 unassigned down down
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
Serial3/0/0 34.1.1.2/24 up up
Serial3/0/1 unassigned down down
Serial4/0/0 12.1.1.2/24 up up
Serial4/0/1 23.1.1.2/24 up up
[R2]
R3:
[R3]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 3
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 3
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.2.1/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
Serial4/0/0 23.1.1.1/24 up up
Serial4/0/1 unassigned down down
[R3]
[R3]
R4:
[R4]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 3
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 3
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.3.1/24 up up
GigabitEthernet0/0/1 unassigned down down
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
Serial4/0/0 34.1.1.1/24 up up
Serial4/0/1 unassigned down down
[R4]
首先我们需要查看R1与R2之间的封装类型:
[R1]display interface Serial4/0/0
Serial4/0/0 current state : UP
Line protocol current state : UP
Last line protocol up time : 2023-07-21 22:03:55 UTC-08:00
Description:HUAWEI, AR Series, Serial4/0/0 Interface
Route Port,The Maximum Transmit Unit is 1500, Hold timer is 10(sec)
Internet Address is 12.1.1.1/24
`Link layer protocol is PPP`
LCP opened, IPCP opened
Last physical up time : 2023-07-21 21:55:06 UTC-08:00
Last physical down time : 2023-07-21 21:55:00 UTC-08:00
Current system time: 2023-07-21 22:13:09-08:00
Physical layer is synchronous, Virtualbaudrate is 64000 bps
Interface is DTE, Cable type is V11, Clock mode is TC
Last 300 seconds input rate 6 bytes/sec 48 bits/sec 0 packets/sec
Last 300 seconds output rate 2 bytes/sec 16 bits/sec 0 packets/sec
Input: 223 packets, 7146 bytes
Broadcast: 0, Multicast: 0
Errors: 0, Runts: 0
Giants: 0, CRC: 0
Alignments: 0, Overruns: 0
Dribbles: 0, Aborts: 0
No Buffers: 0, Frame Error: 0
Output: 224 packets, 2716 bytes
Total Error: 0, Overruns: 0
Collisions: 0, Deferred: 0
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%
[R1]
这里我们可以看到封装类型为PPP封装,所以我们需要进行修改:
R1:
[R1]int s4/0/0
[R1-Serial4/0/0]link-protocol hdlc
R2:
[R2]int s4/0/0
[R2-Serial4/0/0]link-protocol hdlc
由于华为设备默认为PPP,所以我们不需要进行修改,这里我们可以进行查看:
[R2]display interface Serial4/0/1
Serial4/0/1 current state : UP
Line protocol current state : UP
Last line protocol up time : 2023-07-21 22:06:46 UTC-08:00
Description:HUAWEI, AR Series, Serial4/0/1 Interface
Route Port,The Maximum Transmit Unit is 1500, Hold timer is 10(sec)
Internet Address is 23.1.1.2/24
`Link layer protocol is PPP`
LCP opened, IPCP opened
Last physical up time : 2023-07-21 21:55:06 UTC-08:00
Last physical down time : 2023-07-21 21:55:02 UTC-08:00
Current system time: 2023-07-21 22:18:58-08:00
Physical layer is synchronous, Virtualbaudrate is 64000 bps
Interface is DTE, Cable type is V11, Clock mode is TC
Last 300 seconds input rate 6 bytes/sec 48 bits/sec 0 packets/sec
Last 300 seconds output rate 2 bytes/sec 16 bits/sec 0 packets/sec
Input: 297 packets, 9506 bytes
Broadcast: 0, Multicast: 0
Errors: 0, Runts: 0
Giants: 0, CRC: 0
Alignments: 0, Overruns: 0
Dribbles: 0, Aborts: 0
No Buffers: 0, Frame Error: 0
Output: 297 packets, 3594 bytes
Total Error: 0, Overruns: 0
Collisions: 0, Deferred: 0
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%
[R2]
[R2]display interface Serial3/0/0
Serial3/0/0 current state : UP
Line protocol current state : UP
Last line protocol up time : 2023-07-21 22:08:03 UTC-08:00
Description:HUAWEI, AR Series, Serial3/0/0 Interface
Route Port,The Maximum Transmit Unit is 1500, Hold timer is 10(sec)
Internet Address is 34.1.1.2/24
`Link layer protocol is PPP`
LCP opened, IPCP opened
Last physical up time : 2023-07-21 21:55:09 UTC-08:00
Last physical down time : 2023-07-21 21:55:01 UTC-08:00
Current system time: 2023-07-21 22:19:12-08:00
Physical layer is synchronous, Virtualbaudrate is 64000 bps
Interface is DTE, Cable type is V11, Clock mode is TC
Last 300 seconds input rate 6 bytes/sec 48 bits/sec 0 packets/sec
Last 300 seconds output rate 2 bytes/sec 16 bits/sec 0 packets/sec
Input: 300 packets, 9600 bytes
Broadcast: 0, Multicast: 0
Errors: 0, Runts: 0
Giants: 0, CRC: 0
Alignments: 0, Overruns: 0
Dribbles: 0, Aborts: 0
No Buffers: 0, Frame Error: 0
Output: 300 packets, 3632 bytes
Total Error: 0, Overruns: 0
Collisions: 0, Deferred: 0
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%
[R2]
R2:
[R2]aaa
[R2-aaa]local-user huawei password cipher huawei
[R2-aaa]local-user huawei service-type ppp
[R2-aaa]int s4/0/1
[R2-Serial4/0/1]ppp authentication-mode pap
[R2-Serial4/0/1]quit
[R2]
R3:
[R3]int s4/0/0
[R3-Serial4/0/0]ppp pap local-user huawei password cipher huawei
[R3-Serial4/0/0]quit
[R3]
R2:
[R2]int s3/0/0
[R2-Serial3/0/0]ppp authentication-mode chap
[R2-Serial3/0/0]quit
[R2]
R4:
[R4]int s4/0/0
[R4-Serial4/0/0]ppp chap user huawei
[R4-Serial4/0/0]ppp chap password cipher huawei
[R4-Serial4/0/0]quit
[R4]
R1:
[R1]IP route-static 0.0.0.0 0 12.1.1.2
R3:
[R3]IP route-static 0.0.0.0 0 23.1.1.2
R4:
[R4]ip route-static 0.0.0.0 0 34.1.1.2
R1:
[R1]acl 2000
[R1-acl-basic-2000]rule 1 permit source any
[R1-acl-basic-2000]int g0/0/0
[R1-GigabitEthernet0/0/0]nat outbound 2000
[R1-GigabitEthernet0/0/0]quit
[R1]
R3:
[R3]acl 2000
[R3-acl-basic-2000]rule 1 permit source any
[R3-acl-basic-2000]int g0/0/0
[R3-GigabitEthernet0/0/0]nat outbound 2000
[R3-GigabitEthernet0/0/0]quit
[R3]
R4:
[R4]acl 2000
[R4-acl-basic-2000]rule 1 permit source any
[R4-acl-basic-2000]int g0/0/0
[R4-GigabitEthernet0/0/0]nat outbound 2000
[R4-GigabitEthernet0/0/0]quit
[R4]
由于R1的IP地址固定,这里我们让R1来做中心站点。
中心站点:
R1:
[R1]int t0/0/0
[R1-Tunnel0/0/0]ip address 10.1.1.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 12.1.1.1
[R1-Tunnel0/0/0]nhrp network-id 100
[R1-Tunnel0/0/0]nhrp entry multicast dynamic
[R1-Tunnel0/0/0]quit
[R1]
分支站点:
R3:
[R3]int t0/0/0
[R3-Tunnel0/0/0]ip address 10.1.1.2 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source 23.1.1.1
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry multicast dynamic
[R3-Tunnel0/0/0]nhrp entry 10.1.1.1 12.1.1.1 register
[R3-Tunnel0/0/0]quit
[R3]
R4:
[R4]int t0/0/0
[R4-Tunnel0/0/0]ip address 10.1.1.3 24
[R4-Tunnel0/0/0]tunnel-protocol gre p2mp
[R4-Tunnel0/0/0]source 34.1.1.1
[R4-Tunnel0/0/0]nhrp network-id 100
[R4-Tunnel0/0/0]nhrp entry multicast dynamic
[R4-Tunnel0/0/0]nhrp entry 10.1.1.1 12.1.1.1 register
[R4-Tunnel0/0/0]quit
[R4]
查看NHRP注册表:
[R1]display nhrp peer all
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
10.1.1.2 32 23.1.1.1 10.1.1.2 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:02:34
Expire time : 01:57:26
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
10.1.1.3 32 34.1.1.1 10.1.1.3 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:00:12
Expire time : 01:59:48
Number of nhrp peers: 2
[R1]
R1:
[R1]rip 1
[R1-rip-1]version 2
[R1-rip-1]undo summary
[R1-rip-1]network 192.168.1.0
[R1-rip-1]network 10.0.0.0
[R1-rip-1]quit
[R1]
R3:
[R3]rip 1
[R3-rip-1]version 2
[R3-rip-1]network 192.168.2.0
[R3-rip-1]network 10.0.0.0
[R3-rip-1]quit
[R3]
R4:
[R4]rip 1
[R4-rip-1]version 2
[R4-rip-1]network 192.168.3.0
[R4-rip-1]network 10.0.0.0
[R4-rip-1]quit
[R4]
R1:
[R1-Tunnel0/0/0]undo rip split-horizon
查看路由表:
R1:
[R1]display ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.2.0/24 RIP 100 1 D 10.1.1.2 Tunnel0/0/0
192.168.3.0/24 RIP 100 1 D 10.1.1.3 Tunnel0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
[R1]
R3:
[R3]display ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.1.0/24 RIP 100 1 D 10.1.1.1 Tunnel0/0/0
192.168.3.0/24 RIP 100 2 D 10.1.1.3 Tunnel0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
[R3]
R4:
[R4]display ip routing-table protocol rip
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : RIP
Destinations : 2 Routes : 2
RIP routing table status : <Active>
Destinations : 2 Routes : 2
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.1.0/24 RIP 100 1 D 10.1.1.1 Tunnel0/0/0
192.168.2.0/24 RIP 100 2 D 10.1.1.2 Tunnel0/0/0
RIP routing table status : <Inactive>
Destinations : 0 Routes : 0
[R4]
R1:
[R1]int g0/0/2
[R1-GigabitEthernet0/0/2]ip address 12.1.1.1 24
[R1-GigabitEthernet0/0/2]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 21.1.1.1 24
[R1-GigabitEthernet0/0/1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[R1-GigabitEthernet0/0/0]quit
[R1]
R2:
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.2.1 24
[R2-GigabitEthernet0/0/0]int g0/0/1
[R2-GigabitEthernet0/0/1]ip address 23.1.1.1 24
[R2-GigabitEthernet0/0/1]quit
[R2]
R3:
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.3.1 24
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip address 34.1.1.1 24
[R3-GigabitEthernet0/0/1]quit
[R3]
R4:
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 21.1.1.2 24
[R4-GigabitEthernet0/0/0]int g3/0/0
[R4-GigabitEthernet3/0/0]ip address 12.1.1.2 24
[R4-GigabitEthernet3/0/0]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 23.1.1.2 24
[R4-GigabitEthernet0/0/1]int g0/0/2
[R4-GigabitEthernet0/0/2]ip address 34.1.1.2 24
[R4-GigabitEthernet0/0/2]int g2/0/0
[R4-GigabitEthernet2/0/0]ip address 56.1.1.2 24
[R4-GigabitEthernet2/0/0]int g1/0/0
[R4-GigabitEthernet1/0/0]ip address 45.1.1.2 24
[R4-GigabitEthernet1/0/0]quit
[R4]
R5:
[R5]int g0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.4.1 24
[R5-GigabitEthernet0/0/0]int g0/0/1
[R5-GigabitEthernet0/0/1]ip address 45.1.1.1 24
[R5-GigabitEthernet0/0/1]quit
[R5]
R6:
[R6]int g0/0/0
[R6-GigabitEthernet0/0/0]ip address 192.168.5.1 24
[R6-GigabitEthernet0/0/0]int g0/0/1
[R6-GigabitEthernet0/0/1]ip address 56.1.1.1 24
[R6-GigabitEthernet0/0/1]quit
[R6]
查看接口配置情况:
R1:
[R1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 0
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.1/24 up up
GigabitEthernet0/0/1 21.1.1.1/24 up up
GigabitEthernet0/0/2 12.1.1.1/24 up up
NULL0 unassigned up up(s)
[R1]
R2:
[R2]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.2.1/24 up up
GigabitEthernet0/0/1 23.1.1.1/24 up up
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
[R2]
R3:
[R3]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.3.1/24 up up
GigabitEthernet0/0/1 34.1.1.1/24 up up
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
[R3]
R4:
[R4]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 7
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 7
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 21.1.1.2/24 up up
GigabitEthernet0/0/1 23.1.1.2/24 up up
GigabitEthernet0/0/2 34.1.1.2/24 up up
GigabitEthernet1/0/0 45.1.1.2/24 up up
GigabitEthernet2/0/0 56.1.1.2/24 up up
GigabitEthernet3/0/0 12.1.1.2/24 up up
GigabitEthernet4/0/0 unassigned down down
NULL0 unassigned up up(s)
[R4]
R5:
[R5]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.4.1/24 up up
GigabitEthernet0/0/1 45.1.1.1/24 up up
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
[R5]
R6:
[R6]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.5.1/24 up up
GigabitEthernet0/0/1 56.1.1.1/24 up up
GigabitEthernet0/0/2 unassigned down down
NULL0 unassigned up up(s)
[R6]
R1:
[R1]ip route-static 0.0.0.0 0 12.1.1.2
[R1]ip route-static 0.0.0.0 0 21.1.1.2
R2:
[R2]ip route-static 0.0.0.0 0 23.1.1.2
R3:
[R3]ip route-static 0.0.0.0 0 34.1.1.2
R5:
[R5]ip route-static 0.0.0.0 0 45.1.1.2
R6:
[R6]ip route-static 0.0.0.0 0 56.1.1.2
R1:
[R1]acl 2000
[R1-acl-basic-2000]rule 1 permit source any
[R1-acl-basic-2000]int g0/0/2
[R1-GigabitEthernet0/0/2]nat ou
[R1-GigabitEthernet0/0/2]nat outbound 2000
[R1-GigabitEthernet0/0/2]quit
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]nat ou
[R1-GigabitEthernet0/0/1]nat outbound 2000
[R1-GigabitEthernet0/0/1]quit
[R1]
R2:
[R2]acl 2000
[R2-acl-basic-2000]rule 1 permit source any
[R2-acl-basic-2000]int g0/0/1
[R2-GigabitEthernet0/0/1]nat outbound 2000
[R2-GigabitEthernet0/0/1]quit
[R2]
R3:
[R3]acl 2000
[R3-acl-basic-2000]rule 1 permit source any
[R3-acl-basic-2000]int g0/0/1
[R3-GigabitEthernet0/0/1]nat outbound 2000
[R3-GigabitEthernet0/0/1]quit
[R3]
R5:
[R5]acl 2000
[R5-acl-basic-2000]rule 1 permit source any
[R5-acl-basic-2000]int g0/0/1
[R5-GigabitEthernet0/0/1]nat outbound 2000
[R5-GigabitEthernet0/0/1]quit
[R5]
R6:
[R6]acl 2000
[R6-acl-basic-2000]rule 1 permit source any
[R6-acl-basic-2000]int g0/0/1
[R6-GigabitEthernet0/0/1]nat outbound 2000
[R6-GigabitEthernet0/0/1]quit
[R6]
R1中心站点配置:
[R1]int t0/0/0
[R1-Tunnel0/0/0]ip address 192.168.6.1 24
[R1-Tunnel0/0/0]tunnel-protocol gre p2mp
[R1-Tunnel0/0/0]source 12.1.1.1
[R1-Tunnel0/0/0]nhrp network-id 100
[R1-Tunnel0/0/0]nhrp entry multicast dynamic
[R1-Tunnel0/0/0]quit
[R1]
R2分支站点配置:
[R2]int t0/0/0
[R2-Tunnel0/0/0]ip address 192.168.6.2 24
[R2-Tunnel0/0/0]tunnel-protocol gre p2mp
[R2-Tunnel0/0/0]source 23.1.1.1
[R2-Tunnel0/0/0]nhrp network-id 100
[R2-Tunnel0/0/0]nhrp entry multicast dynamic
[R2-Tunnel0/0/0]nhrp entry 192.168.6.1 12.1.1.1 register
[R2-Tunnel0/0/0]quit
[R2]
R3分支站点配置:
[R3]int t0/0/0
[R3-Tunnel0/0/0]ip address 192.168.6.3 24
[R3-Tunnel0/0/0]tunnel-protocol gre p2mp
[R3-Tunnel0/0/0]source 34.1.1.1
[R3-Tunnel0/0/0]nhrp network-id 100
[R3-Tunnel0/0/0]nhrp entry multicast dynamic
[R3-Tunnel0/0/0]nhrp entry 192.168.6.1 12.1.1.1 register
[R3-Tunnel0/0/0]quit
[R3]
查看NHRP注册表:
R1:
[R1]display nhrp peer all
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
192.168.6.2 32 23.1.1.1 192.168.6.2 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:01:38
Expire time : 01:58:22
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
192.168.6.3 32 34.1.1.1 192.168.6.3 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:00:12
Expire time : 01:59:48
Number of nhrp peers: 2
[R1]
R1:
[R1]int t0/0/1
[R1-Tunnel0/0/1]ip address 192.168.7.1 24
[R1-Tunnel0/0/1]tunnel-protocol gre p2mp
[R1-Tunnel0/0/1]source 21.1.1.1
[R1-Tunnel0/0/1]nhrp network-id 10
[R1-Tunnel0/0/1]nhrp entry multicast dynamic
[R1-Tunnel0/0/1]nhrp entry 192.168.7.2 45.1.1.1 register
[R1-Tunnel0/0/1]nhrp entry 192.168.7.3 56.1.1.1 register
[R1-Tunnel0/0/1]quit
[R1]
R5:
[R5]int t0/0/1
[R5-Tunnel0/0/1]ip address 192.168.7.2 24
[R5-Tunnel0/0/1]tunnel-protocol gre p2mp
[R5-Tunnel0/0/1]source 45.1.1.1
[R5-Tunnel0/0/1]nhrp network-id 10
[R5-Tunnel0/0/1]nhrp entry multicast dynamic
[R5-Tunnel0/0/1]nhrp entry 192.168.7.1 21.1.1.1 register
[R5-Tunnel0/0/1]nhrp entry 192.168.7.3 56.1.1.1 register
[R5-Tunnel0/0/1]quit
[R5]
R6:
[R6]int t0/0/1
[R6-Tunnel0/0/1]ip address 192.168.7.3 24
[R6-Tunnel0/0/1]tunnel-protocol gre p2mp
[R6-Tunnel0/0/1]source 56.1.1.1
[R6-Tunnel0/0/1]nhrp network-id 10
[R6-Tunnel0/0/1]nhrp entry multicast dynamic
[R6-Tunnel0/0/1]nhrp entry 192.168.7.1 21.1.1.1 register
Info: This peer protocol address conflicts with hub register peer protocol address.
[R6-Tunnel0/0/1]nhrp entry 192.168.7.2 45.1.1.1 register
[R6-Tunnel0/0/1]quit
[R6]
查看它们的NHRP注册表:
R1:
[R1]display nhrp peer all
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
192.168.6.2 32 23.1.1.1 192.168.6.2 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:09:55
Expire time : 01:50:05
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
192.168.6.3 32 34.1.1.1 192.168.6.3 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/0
Created time : 00:08:29
Expire time : 01:51:31
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
192.168.7.2 32 45.1.1.1 192.168.7.2 static hub
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/1
Created time : 00:04:13
Expire time : --
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
192.168.7.3 32 56.1.1.1 192.168.7.3 static hub
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/1
Created time : 00:04:01
Expire time : --
Number of nhrp peers: 4
[R1]
R5:
[R5]display nhrp peer all
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
192.168.7.1 32 21.1.1.1 192.168.7.1 static hub
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/1
Created time : 00:03:51
Expire time : --
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
192.168.7.3 32 56.1.1.1 192.168.7.3 static hub
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/1
Created time : 00:03:41
Expire time : --
Number of nhrp peers: 2
[R5]
R6:
[R6]display nhrp peer all
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
192.168.7.2 32 45.1.1.1 192.168.7.2 static hub
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/1
Created time : 00:01:52
Expire time : --
-------------------------------------------------------------------------------
Protocol-addr Mask NBMA-addr NextHop-addr Type Flag
-------------------------------------------------------------------------------
192.168.7.1 32 21.1.1.1 192.168.7.1 dynamic route tunnel
-------------------------------------------------------------------------------
Tunnel interface: Tunnel0/0/1
Created time : 00:02:41
Expire time : 01:57:19
Number of nhrp peers: 2
[R6]
R1:
[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.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
[R1-ospf-1-area-0.0.0.0]quit
[R1-ospf-1]quit
[R1]
R2:
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
[R2-ospf-1-area-0.0.0.0]quit
[R2-ospf-1]quit
[R2]
R3:
[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.3.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]network 192.168.6.0 0.0.0.255
[R3-ospf-1-area-0.0.0.0]quit
[R3-ospf-1]
R5:
[R5]ospf 1 router-id 4.4.4.4
[R5-ospf-1]area 0
[R5-ospf-1-area-0.0.0.0]network 192.168.4.0 0.0.0.255
[R5-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
[R5-ospf-1-area-0.0.0.0]quit
[R5-ospf-1]quit
[R5]
R6:
[R6]ospf 1 router-id 5.5.5.5
[R6-ospf-1]area 0
[R6-ospf-1-area-0.0.0.0]network 192.168.5.0 0.0.0.255
[R6-ospf-1-area-0.0.0.0]network 192.168.7.0 0.0.0.255
[R6-ospf-1-area-0.0.0.0]quit
[R6-ospf-1]quit
[R6]
R1:
[R1-Tunnel0/0/0]ospf network-type broadcast
[R1-Tunnel0/0/0]int t0/0/1
[R1-Tunnel0/0/1]ospf network-type broadcast
R2:
[R2-Tunnel0/0/0]ospf network-type broadcast
R3:
[R3-Tunnel0/0/0]ospf network-type broadcast
R5:
[R5-Tunnel0/0/1]ospf network-type broadcast
R6:
[R6-Tunnel0/0/1]ospf network-type broadcast
R2:
[R2-Tunnel0/0/0]ospf dr-priority 0
R3:
[R3-Tunnel0/0/0]ospf dr-priority 0
R1:
[R1]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 4 Routes : 4
OSPF routing table status : <Active>
Destinations : 4 Routes : 4
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.2.0/24 OSPF 10 1563 D 192.168.6.2 Tunnel0/0/0
192.168.3.0/24 OSPF 10 1563 D 192.168.6.3 Tunnel0/0/0
192.168.4.0/24 OSPF 10 1563 D 192.168.7.2 Tunnel0/0/1
192.168.5.0/24 OSPF 10 1563 D 192.168.7.3 Tunnel0/0/1
OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
[R1]
R2:
[R2]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 5 Routes : 5
OSPF routing table status : <Active>
Destinations : 5 Routes : 5
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.1.0/24 OSPF 10 1563 D 192.168.6.1 Tunnel0/0/0
192.168.3.0/24 OSPF 10 1563 D 192.168.6.3 Tunnel0/0/0
192.168.4.0/24 OSPF 10 3125 D 192.168.6.1 Tunnel0/0/0
192.168.5.0/24 OSPF 10 3125 D 192.168.6.1 Tunnel0/0/0
192.168.7.0/24 OSPF 10 3124 D 192.168.6.1 Tunnel0/0/0
OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
[R2]
R3:
[R3]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 5 Routes : 5
OSPF routing table status : <Active>
Destinations : 5 Routes : 5
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.1.0/24 OSPF 10 1563 D 192.168.6.1 Tunnel0/0/0
192.168.2.0/24 OSPF 10 1563 D 192.168.6.2 Tunnel0/0/0
192.168.4.0/24 OSPF 10 3125 D 192.168.6.1 Tunnel0/0/0
192.168.5.0/24 OSPF 10 3125 D 192.168.6.1 Tunnel0/0/0
192.168.7.0/24 OSPF 10 3124 D 192.168.6.1 Tunnel0/0/0
OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
[R3]
R5:
[R5]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 5 Routes : 5
OSPF routing table status : <Active>
Destinations : 5 Routes : 5
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.1.0/24 OSPF 10 1563 D 192.168.7.1 Tunnel0/0/1
192.168.2.0/24 OSPF 10 3125 D 192.168.7.1 Tunnel0/0/1
192.168.3.0/24 OSPF 10 3125 D 192.168.7.1 Tunnel0/0/1
192.168.5.0/24 OSPF 10 1563 D 192.168.7.3 Tunnel0/0/1
192.168.6.0/24 OSPF 10 3124 D 192.168.7.1 Tunnel0/0/1
OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
[R5]
R6:
[R6]display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 5 Routes : 5
OSPF routing table status : <Active>
Destinations : 5 Routes : 5
Destination/Mask Proto Pre Cost Flags NextHop Interface
192.168.1.0/24 OSPF 10 1563 D 192.168.7.1 Tunnel0/0/1
192.168.2.0/24 OSPF 10 3125 D 192.168.7.1 Tunnel0/0/1
192.168.3.0/24 OSPF 10 3125 D 192.168.7.1 Tunnel0/0/1
192.168.4.0/24 OSPF 10 1563 D 192.168.7.2 Tunnel0/0/1
192.168.6.0/24 OSPF 10 3124 D 192.168.7.1 Tunnel0/0/1
OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
[R6]
display ospf peer
命令用来显示OSPF
中各区域邻居的信息
R1:
[R1]display ospf peer brief
OSPF Process 1 with Router ID 1.1.1.1
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Tunnel0/0/0 2.2.2.2 Full
0.0.0.0 Tunnel0/0/0 3.3.3.3 Full
0.0.0.0 Tunnel0/0/1 4.4.4.4 Full
0.0.0.0 Tunnel0/0/1 5.5.5.5 Full
----------------------------------------------------------------------------
[R1]
R2:
[R2]display ospf peer brief
OSPF Process 1 with Router ID 2.2.2.2
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Tunnel0/0/0 1.1.1.1 Full
----------------------------------------------------------------------------
[R2]
R3:
[R3]display ospf peer brief
OSPF Process 1 with Router ID 3.3.3.3
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Tunnel0/0/0 1.1.1.1 Full
----------------------------------------------------------------------------
[R3]
R5:
[R5]display ospf peer brief
OSPF Process 1 with Router ID 4.4.4.4
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Tunnel0/0/1 1.1.1.1 Full
0.0.0.0 Tunnel0/0/1 5.5.5.5 Full
----------------------------------------------------------------------------
[R5]
R6:
[R6]display ospf peer brief
OSPF Process 1 with Router ID 5.5.5.5
Peer Statistic Information
----------------------------------------------------------------------------
Area Id Interface Neighbor id State
0.0.0.0 Tunnel0/0/1 1.1.1.1 Full
0.0.0.0 Tunnel0/0/1 4.4.4.4 Full
----------------------------------------------------------------------------
[R6]