2020-10-03

    科技2022-07-11  71

    OSPF小型实验 ENSP拓扑搭建如下 首先配置四个路由器的接口ip及环回

    [R1] int g0/0/0 ip add 14.1.1.1 24 int loopback 0 ip add 192.168.1.1 24 [r2] int g0/0/1 ip add 24.1.1.1 24 int l0 ip add 192.138.2.1 24 [r3] int g0/0/2 ip add 34.1.1.1 24 int l0 ip add 192.168.3.1 24 [r4] int g0/0/0 ip add 14.1.1.2 24 int g0/0/1 ip add 24.1.1.2 24 int g0/0/2 ip add 34.1.1.2 24

    配置缺省路由

    [r1]ip route-static 0.0.0.0 0 14.1.1.2 [r2]ip route-static 0.0.0.0 0 24.1.1.2 [r3]ip route-static 0.0.0.0 0 34.1.1.2

    配置MGRE,所有路由器都是中心站点

    [r1] int tunnel 0/0/0 ip add 10.1.1.1 24 tunnel-protocol gre p2mp source 14.1.1.1 ospf network-type broadcast nhrp entry multicast dynamic nhrp network-id 100 nhrp entry 10.1.1.2 24.1.1.1 register nhrp entry 10.1.1.3 34.1.1.1 register [r2] int tunnel 0/0/0 ip add 10.1.1.2 24 tunnel-protocol gre p2mp source 24.1.1.1 ospf network-type broadcast nhrp entry multicast dynamic nhrp network-id 100 nhrp entry 10.1.1.3 34.1.1.1 register [r3] int tunnel 0/0/0 ip add 10.1.1.3 24 tunnel-protocol gre p2mp source 34.1.1.1 ospf network-type broadcast nhrp entry multicast dynamic nhrp network-id 100

    启动OSPF

    [r1]ospf 1 router-id 1.1.1.1 area 0 network 192.168.1.1 0.0.0.0 network 10.1.1.1 0.0.0.0 [r2] ospf 1 router-id 2.2.2.2 area 0 network 192.168.2.1 0.0.0.0 network 10.1.1.2 0.0.0.0 [r3] ospf 1 router-id 3.3.3.3 area 0 network 192.168.3.1 0.0.0.0 network 10.1.1.3 0.0.0.0
    Processed: 0.009, SQL: 8