cấu hình gre router cisco
DESCRIPTION
Cấu Hình GRE Router CiscoTRANSCRIPT
Cấu Hình GRE Router Cisco
Cấu hình IP và định tuyến Default route
R1>enableR1#conf tR1(config)#interface serial 2/0R1(config-if)#ip add 12.0.0.1 255.255.255.252R1(config-if)#no shR1(config-if)#int fa 0/0R1(config-if)#ip add 10.0.0.1 255.255.255.0R1(config-if)#no shR1(config-if)#int lo 0R1(config-if)#ip add 11.0.0.1 255.255.255.0R1(config-if)#exitR1(config)#ip route 0.0.0.0 0.0.0.0 12.0.0.2
R2>enable R2#conf tR2(config)#interface serial 2/0R2(config-if)#ip add 12.0.0.2 255.255.255.252R2(config-if)#no shR2(config-if)#clock rate 64000R2(config)#interface serial 2/1R2(config-if)#ip add 23.0.0.1 255.255.255.252R2(config-if)#no shR2(config-if)#clock rate 64000R2(config)#ip route 11.0.0.0 255.255.255.0 120.0.0.1R2(config)#ip route 12.0.0.0 255.255.255.0 123.0.0.2
R3>enableR3#conf tR3(config)#interface serial 2/0R3(config-if)#ip add 23.0.0.2 255.255.255.252R3(config-if)#no shR3(config-if)#int fa 0/0R3(config-if)#ip add 20.0.0.1 255.255.255.0R3(config-if)#no shR3(config-if)#int lo 0R3(config-if)#ip add 12.0.0.1 255.255.255.0
R3(config-if)#exitR3(config)#ip route 0.0.0.0 0.0.0.0 23.0.0.1
Router 2 vì đóng vai trò là ISP nên không chỉ đường đi đến hai đường mạng private [ 10.0.0/24 và 20.0.0.0/24 ], nên 2 mạng này sẽ không thông nhau.
Để hai đường mạng trên thấy nhau và có thể chạy giao thức định tuyến động trong đó thì giải pháp là ta dùng GRE.
Cấu hình GRE trên router 1 và router 3 :
R1(config)#interface tunnel 0R1(config-if)#ip add 100.0.0.1 255.255.255.0R1(config-if)#tunnel source 11.0.0.1R1(config-if)#tunnel destination 12.0.0.1R1(config-if)#tunnel mode gre ipR1(config-if)#tunnel key 123456R1(config-if)#exit
R2(config)#interface tunnel 0 R2(config-if)#ip add 100.0.0.2 255.255.255.0R2(config-if)#tunnel source 12.0.0.1R2(config-if)#tunnel destination 11.0.0.1R2(config-if)#tunnel mode gre ipR2(config-if)#tunnel key 123456R2(config-if)#exit
Cấu hình định tuyến OSPF thông qua Interface Tunnel
R1(config)#router ospf 1R1(config-router)#network 100.0.0.0 0.0.0.255 area 0R1(config-router)#network 10.0.0.0 0.0.0.255 area 0
R2(config)#router ospf 2 R2(config-router)#network 100.0.0.0 0.0.0.255 area 0R2(config-router)#network 20.0.0.0 0.0.0.255 area 0
Trong thực tế ta có thể cấu hình GRE Tunnel để tăng mức độ bảo mật và ổn định của Dữ liệu khi đi qua ISP