Redistribusi rute adalah proses berbagi rute yang dipelajari dari satu protokol routing ke protokol routing lainnya. Ini penting untuk menciptakan jaringan yang terpadu di mana beberapa protokol routing dapat bekerja bersama.
Sintaks Dasar
Sintaks dasar untuk meredistribusi rute di Cisco IOS adalah:
router <nama-protokol>
redistribute <protokol-sumber> [metric <nilai>] [subnet]
exit
Contoh:
Mari redistribusikan rute statis ke EIGRP:
router eigrp 100
redistribute static metric 255
exit
Perintah ini mendistribusikan semua rute statis ke EIGRP dengan metrik 255.
Setting IP address pada Interface
R11(config)#interface GigabitEthernet0/0
R11(config-if)#ip address 192.168.11.2 255.255.255.0
R11(config-if)#no shutdown
R11(config-if)#exit
R11(config)#interface GigabitEthernet0/1
R11(config-if)#ip address 192.168.12.1 255.255.255.0
R11(config-if)#no shutdown
R12(config)#interface GigabitEthernet0/0
R12(config-if)#ip address 192.168.12.2 255.255.255.0
R12(config-if)#no shutdown
R21(config)#interface GigabitEthernet0/0
R21(config-if)#ip address 192.168.21.2 255.255.255.0
R21(config-if)#no shutdown
R21(config-if)#exit
R21(config)#interface GigabitEthernet0/1
R21(config-if)#ip address 192.168.22.1 255.255.255.0
R21(config-if)#no shutdown
R22(config)#interface GigabitEthernet0/0
R22(config-if)#ip address 192.168.22.2 255.255.255.0
R22(config-if)#no shutdown
R31(config)#interface GigabitEthernet0/0
R31(config-if)#ip address 192.168.31.2 255.255.255.0
R31(config-if)#no shutdown
R31(config-if)#exit
R31(config)#interface GigabitEthernet0/1
R31(config-if)#ip address 192.168.32.1 255.255.255.0
R31(config-if)#no shutdown
R32(config)#interface GigabitEthernet0/0
R32(config-if)#ip address 192.168.32.2 255.255.255.0
R32(config-if)#no shutdown
R0(config)#interface GigabitEthernet0/0
R0(config-if)#ip address 192.168.11.1 255.255.255.0
R0(config-if)#no shutdown
R0(config-if)#exit
R0(config)#interface GigabitEthernet0/1
R0(config-if)#ip address 192.168.21.1 255.255.255.0
R0(config-if)#no shutdown
R0(config-if)#exit
R0(config)#interface GigabitEthernet0/2
R0(config-if)#ip address 192.168.31.1 255.255.255.0
R0(config-if)#no shutdown
Konfigurasi static default routing pada 2 router
R12(config)#ip route 0.0.0.0 0.0.0.0 192.168.12.1
R11(config)#ip route 0.0.0.0 0.0.0.0 192.168.11.1
Konfigurasi dynamic routing ospf pada 2 router
R21(config)#router ospf 1
R21(config-router)#network 192.168.21.0 0.0.0.255 area 0
R21(config-router)#network 192.168.22.0 0.0.0.255 area 0
R22(config)#router ospf 1
R22(config-router)#network 192.168.22.0 0.0.0.255 area 0
Konfigurasi dynamic routing eigrp pada 2 router
R31(config)#router eigrp 1
R31(config-router)#network 192.168.31.0 0.0.0.255
R31(config-router)#network 192.168.32.0 0.0.0.255
R32(config)#router eigrp 1
R32(config-router)#network 192.168.32.0 0.0.0.255
Konfigurasi static routing, ospf dan eigrp.
R0(config)#ip route 192.168.12.0 255.255.255.0 192.168.11.2
R0(config)#router ospf 1
R0(config-router)#network 192.168.21.0 0.0.0.255 area 0
R0(config-router)#exit
R0(config)#router eigrp 1
R0(config-router)#network 192.168.31.0 0.0.0.255
R0(config-router)#exit
R0#show ip route
Codes: L - local, C - connected, S - static, 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
192.168.11.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.11.0/24 is directly connected, GigabitEthernet0/0
L 192.168.11.1/32 is directly connected, GigabitEthernet0/0
S 192.168.12.0/24 [1/0] via 192.168.11.2
192.168.21.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.21.0/24 is directly connected, GigabitEthernet0/1
L 192.168.21.1/32 is directly connected, GigabitEthernet0/1
O 192.168.22.0/24 [110/2] via 192.168.21.2, 00:04:06, GigabitEthernet0/1
192.168.31.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.31.0/24 is directly connected, GigabitEthernet0/2
L 192.168.31.1/32 is directly connected, GigabitEthernet0/2
D 192.168.32.0/24 [90/3072] via 192.168.31.2, 00:03:23, GigabitEthernet0/2
R21#show ip route
Codes: L - local, C - connected, S - static, 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
192.168.21.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.21.0/24 is directly connected, GigabitEthernet0/0
L 192.168.21.2/32 is directly connected, GigabitEthernet0/0
192.168.22.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.22.0/24 is directly connected, GigabitEthernet0/1
L 192.168.22.1/32 is directly connected, GigabitEthernet0/1
Table routing pada R0 tersimpan rute kesemua network akan tetapi pada R21 hanya mendapatkan advertaise rute ospf dari R0. Untuk R0 dapat membagikan table routing ke protocol lain (misal eigrp) maka kita perlu mendistribusikan eigrp pada ospf. DST...
R0(config)#router ospf 1
R0(config-router)#redistribute connected subnet
R0(config-router)#redistribute static subnets
R0(config-router)#redistribute eigrp 1 subnets
tanpa
subnets
redistribution hanya mendukung classfull subnets. Dengansubnets
redistribution mendukung vlsm walaupun pada percobaan ini subnets classfull
R0(config)#router eigrp 1
R0(config-router)#redistribute ospf 1 metric 10000 100 255 1 1500
R0(config-router)#redistribute static metric 10000 100 255 1 1500
R0(config-router)#redistribute connected metric 10000 100 255 1 1500
Untuk redistribute OSPF ke EIGRP pastikan anda menentukan metricnya. Terkadang route tidak terdistribusikan apabila anda tidak menentukanya
R22#show ip route
Codes: L - local, C - connected, S - static, 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
O E2 192.168.11.0/24 [110/20] via 192.168.22.1, 01:01:14, GigabitEthernet0/0
O E2 192.168.12.0/24 [110/20] via 192.168.22.1, 01:03:09, GigabitEthernet0/0
O 192.168.21.0/24 [110/2] via 192.168.22.1, 01:18:37, GigabitEthernet0/0
192.168.22.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.22.0/24 is directly connected, GigabitEthernet0/0
L 192.168.22.2/32 is directly connected, GigabitEthernet0/0
O E2 192.168.31.0/24 [110/20] via 192.168.22.1, 01:01:14, GigabitEthernet0/0
O E2 192.168.32.0/24 [110/20] via 192.168.22.1, 01:01:04, GigabitEthernet0/0
R32#show ip route
Codes: L - local, C - connected, S - static, 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
D EX 192.168.11.0/24 [170/282112] via 192.168.32.1, 00:16:00, GigabitEthernet0/0
D EX 192.168.12.0/24 [170/5632] via 192.168.32.1, 01:00:22, GigabitEthernet0/0
D EX 192.168.21.0/24 [170/282112] via 192.168.32.1, 00:16:00, GigabitEthernet0/0
D EX 192.168.22.0/24 [170/282112] via 192.168.32.1, 00:39:29, GigabitEthernet0/0
D 192.168.31.0/24 [90/3072] via 192.168.32.1, 01:22:25, GigabitEthernet0/0
192.168.32.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.32.0/24 is directly connected, GigabitEthernet0/0
L 192.168.32.2/32 is directly connected, GigabitEthernet0/0
R12#ping 192.168.22.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.22.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms
R12#ping 192.168.32.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.32.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms