Cisco. OSPF — различия между версиями

Материал из megapuper
Перейти к: навигация, поиск
Строка 2: Строка 2:
  
 
Схема будет такая
 
Схема будет такая
 +
 +
[[Файл:Ospf.jpg]]
 +
  
  
 
  router ospf 1
 
  router ospf 1
 
  router-id 192.168.255.1
 
  router-id 192.168.255.1
  network 10.10.10.0 0.0.255.255 area 0
+
  network 10.10.0.0 0.0.255.255 area 0
 
+
  network 192.168.0.0 0.0.255.255 area 0
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 1
 
  router ospf 1
 
  router-id 192.168.255.2
 
  router-id 192.168.255.2
 
  network 10.10.0.0 0.0.255.255 area 0
 
  network 10.10.0.0 0.0.255.255 area 0
 +
network 172.16.1.0 0.255.255.255 area 0
  
02:10:19: %OSPF-5-ADJCHG: Process 2, Nbr 172.16.255.1 on FastEthernet0/0.5 from LOADING to FULL, Loading Done
+
router ospf 1
 
+
  router-id 192.168.255.3
  sh ip protocols
+
network 10.10.0.0 0.0.255.255 area 0
+
  network 172.16.2.0 0.255.255.255 area 0
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
 
  
 +
router ospf 1
 +
router-id 192.168.255.4
 +
network 10.10.0.0 0.0.255.255 area 0
 +
network 172.16.3.0 0.255.255.255 area 0
  
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
 
  
 
Передаём остальным маршрут по умолчанию с корневого маршрутизатора
 
Передаём остальным маршрут по умолчанию с корневого маршрутизатора

Версия 17:16, 7 мая 2014

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

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

Файл:Ospf.jpg


router ospf 1
router-id 192.168.255.1
network 10.10.0.0 0.0.255.255 area 0
network 192.168.0.0 0.0.255.255 area 0
router ospf 1
router-id 192.168.255.2
network 10.10.0.0 0.0.255.255 area 0
network 172.16.1.0 0.255.255.255 area 0
router ospf 1
router-id 192.168.255.3
network 10.10.0.0 0.0.255.255 area 0
network 172.16.2.0 0.255.255.255 area 0
router ospf 1
router-id 192.168.255.4
network 10.10.0.0 0.0.255.255 area 0
network 172.16.3.0 0.255.255.255 area 0


Передаём остальным маршрут по умолчанию с корневого маршрутизатора

default-information originate

Проверяем на любом маршрутизаторе

sh ip route

Gateway of last resort is 10.10.10.1 to network 0.0.0.0

Теперь интернет в удалённых сетях появится(только не забудем про NAT)