Lab kali ini kita akan membahas bagaimana cara melakukan filtering menggunakan distribute-list pada OSPF.
Lab 12 - OSPF - Filtering - Distribute List
Topologi yang digunakan adalah sbb :
Konfigurasi R1 :
interface Loopback0
ip address 1.1.1.1 255.255.255.255
!
interface Loopback1
ip address 100.100.100.1 255.255.255.255
!
interface Loopback2
ip address 100.100.100.2 255.255.255.255
!
interface Loopback3
ip address 100.100.100.3 255.255.255.255
!
interface Loopback4
ip address 100.100.100.4 255.255.255.255
!
interface Serial0/0
ip address 12.12.12.1 255.255.255.0
!
ip address 1.1.1.1 255.255.255.255
!
interface Loopback1
ip address 100.100.100.1 255.255.255.255
!
interface Loopback2
ip address 100.100.100.2 255.255.255.255
!
interface Loopback3
ip address 100.100.100.3 255.255.255.255
!
interface Loopback4
ip address 100.100.100.4 255.255.255.255
!
interface Serial0/0
ip address 12.12.12.1 255.255.255.0
!
router ospf 1
router-id 1.1.1.1
log-adjacency-changes
network 0.0.0.0 255.255.255.255 area 0
router-id 1.1.1.1
log-adjacency-changes
network 0.0.0.0 255.255.255.255 area 0
Konfigurasi R2 :
interface Loopback0
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip address 23.23.23.2 255.255.255.0
!
interface Serial0/0
ip address 12.12.12.2 255.255.255.0
!
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip address 23.23.23.2 255.255.255.0
!
interface Serial0/0
ip address 12.12.12.2 255.255.255.0
!
router ospf 1
router-id 2.2.2.2
log-adjacency-changes
network 0.0.0.0 255.255.255.255 area 0
router-id 2.2.2.2
log-adjacency-changes
network 0.0.0.0 255.255.255.255 area 0
Konfigurasi R3 :
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
ip address 23.23.23.3 255.255.255.0
!
router ospf 1ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
ip address 23.23.23.3 255.255.255.0
!
router-id 3.3.3.3
log-adjacency-changes
network 0.0.0.0 255.255.255.255 area 0
Kita cek routing table di R2 :
R2#sh ip route
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/65] via 12.12.12.1, 00:01:18, Serial0/0
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
100.0.0.0/32 is subnetted, 4 subnetsO 100.100.100.4 [110/65] via 12.12.12.1, 00:01:18, Serial0/0
O 100.100.100.1 [110/65] via 12.12.12.1, 00:01:18, Serial0/0
O 100.100.100.2 [110/65] via 12.12.12.1, 00:01:18, Serial0/0
O 100.100.100.3 [110/65] via 12.12.12.1, 00:01:18, Serial0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/11] via 23.23.23.3, 00:01:18, FastEthernet0/0
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, Serial0/0
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/65] via 12.12.12.1, 00:01:18, Serial0/0
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
100.0.0.0/32 is subnetted, 4 subnetsO 100.100.100.4 [110/65] via 12.12.12.1, 00:01:18, Serial0/0
O 100.100.100.1 [110/65] via 12.12.12.1, 00:01:18, Serial0/0
O 100.100.100.2 [110/65] via 12.12.12.1, 00:01:18, Serial0/0
O 100.100.100.3 [110/65] via 12.12.12.1, 00:01:18, Serial0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/11] via 23.23.23.3, 00:01:18, FastEthernet0/0
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, Serial0/0
Terlihat bahwa untuk IP Loopback R1 sudah diterima oleh R2 via routing OSPF.
Sekarang kita coba untuk filter IP Loopback R1 agar yang diterima hanya IP yang genap saja.
R2(config)#access-list 1 permit 0.0.0.0 255.255.255.254
R2(config)#router ospf 1
R2(config-router)#distribute-list 1 in
Kita coba cek kembali routing table di R2 :
R2(config-router)#do sh ip route
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
100.0.0.0/32 is subnetted, 2 subnetsO 100.100.100.4 [110/65] via 12.12.12.1, 00:00:29, Serial0/0
O 100.100.100.2 [110/65] via 12.12.12.1, 00:00:29, Serial0/0
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, Serial0/0
Gateway of last resort is not set
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
100.0.0.0/32 is subnetted, 2 subnetsO 100.100.100.4 [110/65] via 12.12.12.1, 00:00:29, Serial0/0
O 100.100.100.2 [110/65] via 12.12.12.1, 00:00:29, Serial0/0
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, Serial0/0
Terlihat bahwa untuk routing IP Loopback R1 yang diterima oleh R2 hanya IP yang genap saja. (100.100.100.2 dan 100.100.100.4).
Kita coba rubah agar yang diterima hanya yang ganjil saja.
R2(config)#no access-list 1
R2(config)#access-list 1 permit 0.0.0.1 255.255.255.254
Kita cek lagi di routing table R2 :
R2(config)#do sh ip route
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/65] via 12.12.12.1, 00:00:22, Serial0/0
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
100.0.0.0/32 is subnetted, 2 subnetsO 100.100.100.1 [110/65] via 12.12.12.1, 00:00:22, Serial0/0
O 100.100.100.3 [110/65] via 12.12.12.1, 00:00:22, Serial0/0
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/11] via 23.23.23.3, 00:00:22, FastEthernet0/0
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, FastEthernet0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, Serial0/0
Terlihat bahwa sekarang routing IP Loopback R1 yang diterima oleh R2 hanya yang IP ganjil saja. (100.100.100.1 dan 100.100.100.3)
Sehingga kita simpulkan bahwa konfigurasi filtering menggunakan distribute-list di OSPF sudah berhasil :)
Tidak ada komentar:
Posting Komentar