1配ip写缺省
[r1]ip route-static 0.0.0.0 0 13.1.1.2
[r1]ip route-static 0.0.0.0 0 63.1.1.2
[r2]ip route-static 0.0.0.0 0 53.1.1.2
[r4]ip route-static 0.0.0.0 0 33.1.1.1
测试:
2能访问ar6环回
[r1]acl 2000
[r1-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r1-acl-basic-2000]q
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]nat outbound 2000
[r1-GigabitEthernet0/0/0]nat outbound 2000
3 r1 r4 r5为全连的mgre结构
先建立全连网状mgre
[r1]int t0/0/1
[r1-Tunnel0/0/1]ip add 14.1.1.1 24
[r1-Tunnel0/0/1]tunnel-protocol gre p2mp
[r1-Tunnel0/0/1]source 13.1.1.1
Jan 3 2023 13:12:29-08:00 r1 %%01IFNET/4/LINK_STATE(l)[23]:The line protocol IP
on the interface Tunnel0/0/1 has entered the UP state.
[r1-Tunnel0/0/1]nhrp entry multicast dynamic
[r4]int t0/0/1
[r4-Tunnel0/0/1]ip add 14.1.1.2 2
Error: The specified IP address is invalid.
[r4-Tunnel0/0/1]ip add 14.1.1.2 24
[r4-Tunnel0/0/1]tunnel-protocol gre p2mp
[r4-Tunnel0/0/1]source 33.1.1.2
[r4-Tunnel0/0/1]nhrp entry 14.1.1.1 13.1.1.1 register
[r4-Tunnel0/0/1]nhrp entry 14.1.1.3 23.1.1.2 register
[r5]int t0/0/1
[r5-Tunnel0/0/1]ip add 14.1.1.3 24
[r5-Tunnel0/0/1]tunnel-protocol gre p2mp
[r5-Tunnel0/0/1]source 23.1.1.2
Jan 3 2023 13:17:40-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Tunnel0/0/1 has entered the UP state.
[r5-Tunnel0/0/1]nhrp entry 14.1.1.1 13.1.1.1 register
[r5-Tunnel0/0/1]nhrp entry multicast dynamic
测试:
再把接口改为broadcast
[r1-GigabitEthernet0/0/1]ospf network-type broadcast
再写ospf
[r1]ospf 1
[r1-ospf-1]area 0
[r1-ospf-1-area-0.0.0.0]netw
[r1-ospf-1-area-0.0.0.0]network 14.1.1.0 0.0.0.255
[r1-ospf-1-area-0.0.0.0]netw
[r1-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255
测试:
4 r1 r2 r3为星型结构
[r2]int Tunnel 0/0/0
[r2-Tunnel0/0/0]ip add 15.1.1.2 24
[r2-Tunnel0/0/0]tunnel-protocol gre p2mp
[r2-Tunnel0/0/0]source 53.1.1.1
Jan 3 2023 12:37:25-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]nhrp entry 15.1.1.1 63.1.1.1 register
[r2-Tunnel0/0/0]nhrp network-id 100
先把mgre建立起来
再把接口改为broadcast
[r1-Tunnel0/0/0]ospf network-type broadcast
[r3-Tunnel0/0/0]ospf network-type broadcast
再写ospf
[r1]ospf 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 15.1.1.0 0.0.0.255
[r2]ospf 1
[r2-ospf-1]area 0
[r2-ospf-1-area-0.0.0.0]network 15.1.1.0 0.0.0.255
[r2-ospf-1-area-0.0.0.0]netw
[r2-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255
三个都写完以后测试:
4 全网通测试