R1(config)#router ospf 1 R1(config-router)#network 172.16.1.0 0.0.0.255 area 0 R1(config-router)#network 1.1.1.1 0.0.0.0 area 0 R1(config-router)#router R1(config-router)#router-id 1.1.1.1
[R2]ospf 1 router-id 2.2.2.2 [R2-ospf-1]area 0 [R2-ospf-1-area-0.0.0.0]network 172.16.1.0 0.0.0.255 [R2-ospf-1-area-0.0.0.0]network 2.2.2.2 0.0.0.0 [R2-ospf-1-area-0.0.0.0]
router ospf 1 router-id 1.1.1.1 log-adjacency-changes redistribute static network 1.1.1.1 0.0.0.0 area 0 network 172.16.1.0 0.0.0.255 area 0 !
ospf 1 router-id 2.2.2.2 area 0.0.0.0 network 172.16.1.0 0.0.0.255 network 2.2.2.2 0.0.0.0 #
ospf 1 router-id 3.3.3.3 area 0.0.0.0 network 3.3.3.0 0.0.0.3 network 172.16.1.0 0.0.0.255 area 0.0.0.1 network 172.16.2.0 0.0.0.3 #
router ospf 1 log-adjacency-changes area 1 stub network 4.4.4.4 0.0.0.0 area 1 network 172.16.2.0 0.0.0.3 area 1 !
Switch#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 2.2.2.2 1 FULL/BDR 00:00:39 172.16.1.2 Vlan100 3.3.3.3 1 FULL/DR 00:00:31 172.16.1.3 Vlan100 Switch#
[R2]ospf 1 [R2-ospf-1]area 0 [R2-ospf-1-area-0.0.0.0]undo network 172.16.1.0 0.0.0.255 [R2-ospf-1-area-0.0.0.0]
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 3.3.3.3 1 FULL/DR 00:00:33 172.16.1.3 Vlan100 R1#
[R3]display ospf peer OSPF Process 1 with Router ID 3.3.3.3 Neighbors Area 0.0.0.0 interface 172.16.1.3(Vlanif100)'s neighbors Router ID: 1.1.1.1 Address: 172.16.1.1 State: Full Mode:Nbr is Slave Priority: 1 !!!!!DR: 172.16.1.3 BDR: 172.16.1.1!!!!! MTU: 1500 Dead timer due in 35 sec Retrans timer interval: 4 Neighbor is up for 00:35:59 Authentication Sequence: [ 0 ] Neighbors Area 0.0.0.1 interface 172.16.2.1(Vlanif101)'s neighbors Router ID: 4.4.4.4 Address: 172.16.2.2 State: Full Mode:Nbr is Master Priority: 1 DR: 172.16.2.2 BDR: 172.16.2.1 MTU: 1500 Dead timer due in 33 sec Retrans timer interval: 5 Neighbor is up for 00:56:48 Authentication Sequence: [ 0 ] [R3]
[R2]ospf 1 [R2-ospf-1]area 0 [R2-ospf-1-area-0.0.0.0]network 172.16.1.0 0.0.0.255 [R2-ospf-1-area-0.0.0.0]
R1#show ip ospf neighbor Neighbor ID Pri State Dead Time Address Interface 2.2.2.2 1 FULL/DROTHER 00:00:36 172.16.1.2 Vlan100 3.3.3.3 1 FULL/DR 00:00:39 172.16.1.3 Vlan100 R1#
R1#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set 1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1 is directly connected, Loopback0 2.0.0.0/32 is subnetted, 1 subnets O 2.2.2.2 [110/1] via 172.16.1.2, 00:05:59, Vlan100 3.0.0.0/32 is subnetted, 1 subnets O 3.3.3.3 [110/1] via 172.16.1.3, 00:05:59, Vlan100 4.0.0.0/32 is subnetted, 1 subnets O IA 4.4.4.4 [110/3] via 172.16.1.3, 00:05:59, Vlan100 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks C 172.16.1.0/24 is directly connected, Vlan100 O IA 172.16.2.0/30 [110/2] via 172.16.1.3, 00:05:59, Vlan100 R1#
[R2]disp ip routing-table Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 10 Routes : 10 Destination/Mask Proto Pre Cost Flags NextHop Interface 1.1.1.1/32 OSPF 10 2 D 172.16.1.1 Vlanif100 2.2.2.2/32 Direct 0 0 D 127.0.0.1 LoopBack0 3.3.3.3/32 OSPF 10 1 D 172.16.1.3 Vlanif100 4.4.4.4/32 OSPF 10 3 D 172.16.1.3 Vlanif100 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 172.16.1.0/24 Direct 0 0 D 172.16.1.2 Vlanif100 172.16.1.2/32 Direct 0 0 D 127.0.0.1 Vlanif100 172.16.2.0/30 OSPF 10 2 D 172.16.1.3 Vlanif100 [R2]
[R2]dis ospf routing OSPF Process 1 with Router ID 2.2.2.2 Routing Tables Routing for Network Destination Cost Type NextHop AdvRouter Area 2.2.2.2/32 0 Stub 2.2.2.2 2.2.2.2 0.0.0.0 172.16.1.0/24 1 Transit 172.16.1.2 2.2.2.2 0.0.0.0 1.1.1.1/32 2 Stub 172.16.1.1 1.1.1.1 0.0.0.0 3.3.3.3/32 1 Stub 172.16.1.3 3.3.3.3 0.0.0.0 4.4.4.4/32 3 Inter-area 172.16.1.3 3.3.3.3 0.0.0.0 172.16.2.0/30 2 Inter-area 172.16.1.3 3.3.3.3 0.0.0.0 Total Nets: 6 Intra Area: 4 Inter Area: 2 ASE: 0 NSSA: 0 [R2]
[R2]ip route-static 8.8.8.8 32 NULL0 [R2]ip route-static 8.8.4.4 32 NULL0
[R2]ospf 1 [R2-ospf-1]import-route static
[R2-ospf-1]di th # ospf 1 router-id 2.2.2.2 import-route static area 0.0.0.0 network 2.2.2.2 0.0.0.0 network 172.16.1.0 0.0.0.255 # return [R2-ospf-1]
R1#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set 1.0.0.0/32 is subnetted, 1 subnets C 1.1.1.1 is directly connected, Loopback0 2.0.0.0/32 is subnetted, 1 subnets O 2.2.2.2 [110/1] via 172.16.1.2, 00:01:49, Vlan100 3.0.0.0/32 is subnetted, 1 subnets O 3.3.3.3 [110/1] via 172.16.1.3, 00:01:49, Vlan100 4.0.0.0/32 is subnetted, 1 subnets O IA 4.4.4.4 [110/3] via 172.16.1.3, 00:01:49, Vlan100 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks C 172.16.1.0/24 is directly connected, Vlan100 O IA 172.16.2.0/30 [110/2] via 172.16.1.3, 00:01:50, Vlan100 8.0.0.0/32 is subnetted, 2 subnets O E2 8.8.8.8 [110/1] via 172.16.1.2, 00:01:50, Vlan100 O E2 8.8.4.4 [110/1] via 172.16.1.2, 00:01:52, Vlan100 9.0.0.0/32 is subnetted, 1 subnets O E2 9.9.9.9 [110/1] via 172.16.1.2, 00:01:52, Vlan100 R1#
[R3]disp ospf routing OSPF Process 1 with Router ID 3.3.3.3 Routing Tables Routing for Network Destination Cost Type NextHop AdvRouter Area 3.3.3.3/32 0 Stub 3.3.3.3 3.3.3.3 0.0.0.0 172.16.1.0/24 1 Transit 172.16.1.3 3.3.3.3 0.0.0.0 172.16.2.0/30 1 Transit 172.16.2.1 3.3.3.3 0.0.0.1 1.1.1.1/32 2 Stub 172.16.1.1 1.1.1.1 0.0.0.0 2.2.2.2/32 1 Stub 172.16.1.2 2.2.2.2 0.0.0.0 4.4.4.4/32 2 Stub 172.16.2.2 4.4.4.4 0.0.0.1 Routing for ASEs Destination Cost Type Tag NextHop AdvRouter 8.8.4.4/32 1 Type2 1 172.16.1.2 2.2.2.2 8.8.8.8/32 1 Type2 1 172.16.1.2 2.2.2.2 Total Nets: 8 Intra Area: 6 Inter Area: 0 ASE: 2 NSSA: 0 [R3]
R4#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set 1.0.0.0/32 is subnetted, 1 subnets O IA 1.1.1.1 [110/3] via 172.16.2.1, 00:02:18, Vlan101 2.0.0.0/32 is subnetted, 1 subnets S 2.2.2.2 [1/0] via 172.16.2.1 3.0.0.0/32 is subnetted, 1 subnets O IA 3.3.3.3 [110/1] via 172.16.2.1, 00:02:18, Vlan101 4.0.0.0/32 is subnetted, 1 subnets C 4.4.4.4 is directly connected, Loopback0 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks O IA 172.16.1.0/24 [110/2] via 172.16.2.1, 00:02:18, Vlan101 C 172.16.2.0/30 is directly connected, Vlan101 8.0.0.0/32 is subnetted, 2 subnets O E2 8.8.8.8 [110/1] via 172.16.2.1, 00:02:19, Vlan101 O E2 8.8.4.4 [110/1] via 172.16.2.1, 00:02:21, Vlan101 C 192.168.254.0/24 is directly connected, Vlan96 R4#
[R3]ospf 1 [R3-ospf-1]area 1 [R3-ospf-1-area-0.0.0.1]stub [R3-ospf-1-area-0.0.0.1]
R4(config)#router ospf 1 R4(config-router)#area 1 stub R4(config-router)#
R4#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is 172.16.2.1 to network 0.0.0.0 1.0.0.0/32 is subnetted, 1 subnets O IA 1.1.1.1 [110/3] via 172.16.2.1, 00:01:54, Vlan101 2.0.0.0/32 is subnetted, 1 subnets O IA 2.2.2.2 [110/2] via 172.16.2.1, 00:00:04, Vlan101 3.0.0.0/32 is subnetted, 1 subnets O IA 3.3.3.3 [110/1] via 172.16.2.1, 00:01:54, Vlan101 4.0.0.0/32 is subnetted, 1 subnets C 4.4.4.4 is directly connected, Loopback0 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks O IA 172.16.1.0/24 [110/2] via 172.16.2.1, 00:01:54, Vlan101 C 172.16.2.0/30 is directly connected, Vlan101 C 192.168.254.0/24 is directly connected, Vlan96 O*IA 0.0.0.0/0 [110/2] via 172.16.2.1, 00:01:54, Vlan101 R4#
[R3]ospf 1 [R3-ospf-1]area 1 [R3-ospf-1-area-0.0.0.1]stub no-summary [R3-ospf-1-area-0.0.0.1]
R4#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is 172.16.2.1 to network 0.0.0.0 4.0.0.0/32 is subnetted, 1 subnets C 4.4.4.4 is directly connected, Loopback0 172.16.0.0/30 is subnetted, 1 subnets C 172.16.2.0 is directly connected, Vlan101 C 192.168.254.0/24 is directly connected, Vlan96 O*IA 0.0.0.0/0 [110/2] via 172.16.2.1, 00:00:03, Vlan101 R4#
Source: https://habr.com/ru/post/153865/
All Articles