Cisco. OSPF

Материал из megapuper
Перейти к: навигация, поиск

Пример на стройки OSFP в небольшой сети(головной офис и три отдельно стоящих склада)

Схема будет такая


router ospf 1
router-id 172.16.255.1
network 172.16.0.0 0.0.255.255

01:24:07: %OSPF-5-ADJCHG: Process 1, Nbr 172.16.255.48 on FastEthernet0/1.5 from LOADING to FULL, Loading Done

sh ip protocols 

Routing Protocol is "ospf 1"
 Outgoing update filter list for all interfaces is not set 
 Incoming update filter list for all interfaces is not set 
 Router ID 172.16.255.1
 Number of areas in this router is 1. 1 normal 0 stub 0 nssa
 Maximum path: 4
 Routing for Networks:
   172.16.0.0 0.0.255.255 area 0
 Routing Information Sources:  
   Gateway         Distance      Last Update 
   172.16.255.1         110      00:01:02
   172.16.255.48        110      00:01:02
 Distance: (default is 110)
sh ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
172.16.255.48     1   FULL/BDR        00:00:37    172.16.2.18     FastEthernet0/1.5
sh ip route
    172.16.0.0/16 is variably subnetted, 10 subnets, 4 masks
C       172.16.1.0/24 is directly connected, FastEthernet0/0.2
C       172.16.2.0/30 is directly connected, FastEthernet0/1.4
S       172.16.2.4/30 [1/0] via 172.16.2.2
C       172.16.2.16/30 is directly connected, FastEthernet0/1.5
C       172.16.2.128/30 is directly connected, FastEthernet0/1.7
C       172.16.2.196/30 is directly connected, FastEthernet1/0.911
S       172.16.16.0/21 [1/0] via 172.16.2.2
S       172.16.24.0/24 [1/0] via 172.16.2.18
C       172.16.255.1/32 is directly connected, Loopback0
O       172.16.255.48/32 [110/2] via 172.16.2.18, 00:05:01, FastEthernet0/1.5
    198.51.100.0/28 is subnetted, 1 subnets
C       198.51.100.0 is directly connected, FastEthernet0/1.6
S*   0.0.0.0/0 [1/0] via 198.51.100.1


router ospf 2
router-id 172.16.255.48
network 172.16.0.0 0.0.255.255

02:10:19: %OSPF-5-ADJCHG: Process 2, Nbr 172.16.255.1 on FastEthernet0/0.5 from LOADING to FULL, Loading Done

sh ip protocols 

Routing Protocol is "ospf 2"
 Outgoing update filter list for all interfaces is not set 
 Incoming update filter list for all interfaces is not set 
 Router ID 172.16.255.48
 Number of areas in this router is 1. 1 normal 0 stub 0 nssa
 Maximum path: 4
 Routing for Networks:
   172.16.0.0 0.0.255.255 area 0
 Routing Information Sources:  
   Gateway         Distance      Last Update 
   172.16.255.1         110      00:02:24
   172.16.255.48        110      00:02:24
 Distance: (default is 110)
sh ip ospf neighbor

Neighbor ID     Pri   State           Dead Time   Address         Interface
172.16.255.1      1   FULL/DR         00:00:33    172.16.2.17     FastEthernet0/0.5


sh ip route
    172.16.0.0/16 is variably subnetted, 8 subnets, 3 masks
O       172.16.1.0/24 [110/2] via 172.16.2.17, 00:05:06, FastEthernet0/0.5
O       172.16.2.0/30 [110/2] via 172.16.2.17, 00:05:06, FastEthernet0/0.5
C       172.16.2.16/30 is directly connected, FastEthernet0/0.5
O       172.16.2.128/30 [110/2] via 172.16.2.17, 00:05:06, FastEthernet0/0.5
O       172.16.2.196/30 [110/2] via 172.16.2.17, 00:05:06, FastEthernet0/0.5
C       172.16.24.0/24 is directly connected, FastEthernet0/0.2
O       172.16.255.1/32 [110/2] via 172.16.2.17, 00:05:06, FastEthernet0/0.5
C       172.16.255.48/32 is directly connected, Loopback0
S*   0.0.0.0/0 [1/0] via 172.16.2.17

Передаём маршрут по умолчанию

default-information originate