OSPF

拓譜圖


每個Area必須與主幹(Area 0)相連,主幹(Area 0)與Area 1 or 2 or 3(上圖的拓譜)相連的 Router 稱 ABR。
如果有 Router 同時有 OSPF 和 RIPv2 的 Protocol,稱為 ASBR。




R39(淺藍與綠色之間的Router)
ip cef

no ipv6 cef

!

!

interface FastEthernet0/0

ip address 192.168.5.2 255.255.255.0

duplex auto

speed auto

!

interface FastEthernet0/1

ip address 192.168.10.1 255.255.255.0

duplex auto

speed auto

!

router ospf 10

log-adjacency-changes

redistribute rip metric 100 subnets 

network 192.168.5.0 0.0.0.255 area 2

!

router rip

version 2

network 192.168.10.0

no auto-summary

!

ip classless

!

ip flow-export version 9

!

!

!

!

!

!

!

line con 0

!

line aux 0

!

line vty 0 4

login

!

!

!


end

R33(深藍與紫色之間) Area 0 與 Area 1 相連

no ip cef
no ipv6 cef
!
!
!
interface FastEthernet0/0
 ip address 172.16.1.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet0/1
 ip address 192.168.2.2 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet1/0
 ip address 172.16.2.1 255.255.255.0
 duplex auto
 speed auto
!
interface FastEthernet1/1
 no ip address
 duplex auto
 speed auto
 shutdown
!
router ospf 10
 log-adjacency-changes
 area 0 range 192.168.0.0 255.255.0.0
 area 1 range 172.16.0.0 255.255.0.0
 network 192.168.2.0 0.0.0.255 area 0
 network 172.16.1.0 0.0.0.255 area 1
 network 172.16.2.0 0.0.0.255 area 1
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

R32(深藍區域右邊)Area 0
路由表
Router#show ip route 
Codes: C - connected, S - static, I - IGRP, 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, 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

     10.0.0.0/24 is subnetted, 4 subnets
O E2    10.0.1.0 [110/100] via 192.168.4.2, 00:03:15, FastEthernet0/1
O E2    10.0.2.0 [110/100] via 192.168.4.2, 00:03:15, FastEthernet0/1
O E2    10.0.3.0 [110/100] via 192.168.4.2, 00:03:15, FastEthernet0/1
O E2    10.0.4.0 [110/100] via 192.168.4.2, 00:03:15, FastEthernet0/1
     172.16.0.0/16 is variably subnetted, 3 subnets, 2 masks
O IA    172.16.0.0/16 [110/3] via 192.168.1.1, 00:33:17, FastEthernet0/0
O IA    172.16.4.0/24 [110/3] via 192.168.4.2, 00:33:27, FastEthernet0/1
O IA    172.16.5.0/24 [110/3] via 192.168.4.2, 00:33:27, FastEthernet0/1
O IA 192.168.0.0/16 [110/3] via 192.168.1.1, 00:33:17, FastEthernet0/0
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, FastEthernet0/0
O    192.168.2.0/24 [110/2] via 192.168.1.1, 00:33:27, FastEthernet0/0
O    192.168.3.0/24 [110/2] via 192.168.1.1, 00:33:27, FastEthernet0/0
C    192.168.4.0/24 is directly connected, FastEthernet0/1
O IA 192.168.5.0/24 [110/3] via 192.168.1.1, 00:33:17, FastEthernet0/0
O IA 192.168.6.0/24 [110/3] via 192.168.1.1, 00:33:17, FastEthernet0/0
O IA 192.168.7.0/24 [110/4] via 192.168.1.1, 00:33:17, FastEthernet0/0
O E2 192.168.10.0/24 [110/100] via 192.168.4.2, 00:03:15, FastEthernet0/1
O IA 192.168.20.0/24 [110/5] via 192.168.1.1, 00:33:17, FastEthernet0/0
O IA 192.168.21.0/24 [110/5] via 192.168.1.1, 00:33:17, FastEthernet0/0
以上全部只有部分顯示!!
設定方式差不多。
最後如下 PC0 (其它也要)能夠 PING 通 10.0.4.0/24 下的 PC 就算成功。
tracert 可看出他走的路徑

留言

熱門文章