分發列表實現路由(OSPF)過濾控制

分發列表實現路由(OSPF)過濾控制
R1基本配置
interface Loopback0
ip address 172.16.1.1 255.255.255.0
!
interface Loopback1
ip address 172.16.2.1 255.255.255.0
!
interface Loopback2
ip address 10.1.1.1 255.255.255.0

interface FastEthernet1/0
ip address 200.1.1.1 255.255.255.0
no shutdown
router ospf 1
network 10.1.1.0 0.0.0.255 area 10
network 172.16.1.0 0.0.0.255 area 10
network 172.16.2.0 0.0.0.255 area 10
network 200.1.1.0 0.0.0.255 area 0

R2的基本配置
interface Ethernet0/0
ip address 200.1.2.1 255.255.255.0
no shutdown
interface FastEthernet1/0
ip address 200.1.1.2 255.255.255.0
no shutdown

router ospf 1
network 200.1.1.0 0.0.0.255 area 0
network 200.1.2.0 0.0.0.255 area 0

R3基本配置
interface Loopback0
ip address 192.168.1.1 255.255.255.0
!
interface Ethernet0/0
ip address 200.1.2.2 255.255.255.0
no shutdown

router ospf 1

network 192.168.1.0 0.0.0.255 area 0
network 200.1.2.0 0.0.0.255 area 0


R2上配置分發列表路由過濾
第一步創建需要控制的路由
access-list 10 deny 172.16.1.0 0.0.0.255
access-list 10 permit any
第二步應用分發列表調用10號列表
router ospf 1
distribute-list 10 in FastEthernet1/0

在R2查看路由信息,看不到172.16.1.0的路由
R2#show ip route
C 200.1.1.0/24 is directly connected, FastEthernet1/0
C 200.1.2.0/24 is directly connected, Ethernet0/0
172.16.0.0/32 is subnetted, 1 subnets
O IA 172.16.2.1 [110/2] via 200.1.1.1, 00:08:15, FastEthernet1/0
10.0.0.0/32 is subnetted, 1 subnets
O IA 10.1.1.1 [110/2] via 200.1.1.1, 00:08:15, FastEthernet1/0
192.168.1.0/32 is subnetted, 1 subnets
O 192.168.1.1 [110/11] via 200.1.2.2, 00:08:15, Ethernet0/0
R2#
在R3查看路由信息,可以看到172.16.1.0的路由
R3#show ip route
O 200.1.1.0/24 [110/11] via 200.1.2.1, 00:09:09, Ethernet0/0
C 200.1.2.0/24 is directly connected, Ethernet0/0
172.16.0.0/32 is subnetted, 2 subnets
O IA 172.16.1.1 [110/12] via 200.1.2.1, 00:09:09, Ethernet0/0
O IA 172.16.2.1 [110/12] via 200.1.2.1, 00:09:09, Ethernet0/0
10.0.0.0/32 is subnetted, 1 subnets
O IA 10.1.1.1 [110/12] via 200.1.2.1, 00:09:09, Ethernet0/0
C 192.168.1.0/24 is directly connected, Loopback0


結論:
說明了OSPF的分發列表應用的IN方向是由本地數據庫到路由表的方向,R3和其他路由器的鏈路狀態數據庫是同步FULL狀態的。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章