You are on page 1of 2

Cu Hnh GRE Router Cisco

Cu hnh IP v nh tuyn Default route


R1>enable
R1#conf t
R1(config)#interface serial 2/0
R1(config-if)#ip add 12.0.0.1 255.255.255.252
R1(config-if)#no sh
R1(config-if)#int fa 0/0
R1(config-if)#ip add 10.0.0.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int lo 0
R1(config-if)#ip add 11.0.0.1 255.255.255.0
R1(config-if)#exit
R1(config)#ip route 0.0.0.0 0.0.0.0 12.0.0.2
R2>enable
R2#conf t
R2(config)#interface serial 2/0
R2(config-if)#ip add 12.0.0.2 255.255.255.252
R2(config-if)#no sh
R2(config-if)#clock rate 64000
R2(config)#interface serial 2/1
R2(config-if)#ip add 23.0.0.1 255.255.255.252
R2(config-if)#no sh
R2(config-if)#clock rate 64000
R2(config)#ip route 11.0.0.0 255.255.255.0 120.0.0.1
R2(config)#ip route 12.0.0.0 255.255.255.0 123.0.0.2
R3>enable
R3#conf t
R3(config)#interface
R3(config-if)#ip add
R3(config-if)#no sh
R3(config-if)#int fa
R3(config-if)#ip add
R3(config-if)#no sh
R3(config-if)#int lo
R3(config-if)#ip add

serial 2/0
23.0.0.2 255.255.255.252
0/0
20.0.0.1 255.255.255.0
0
12.0.0.1 255.255.255.0

R3(config-if)#exit
R3(config)#ip route 0.0.0.0 0.0.0.0 23.0.0.1

Router 2 v ng vai tr l ISP nn khng ch ng i n hai ng mng private


[ 10.0.0/24 v 20.0.0.0/24 ], nn 2 mng ny s khng thng nhau.

hai ng mng trn thy nhau v c th chy giao thc nh tuyn ng trong
th gii php l ta dng GRE.

Cu hnh GRE trn router 1 v router 3 :


R1(config)#interface
R1(config-if)#ip add
R1(config-if)#tunnel
R1(config-if)#tunnel
R1(config-if)#tunnel
R1(config-if)#tunnel
R1(config-if)#exit

tunnel 0
100.0.0.1 255.255.255.0
source 11.0.0.1
destination 12.0.0.1
mode gre ip
key 123456

R2(config)#interface
R2(config-if)#ip add
R2(config-if)#tunnel
R2(config-if)#tunnel
R2(config-if)#tunnel
R2(config-if)#tunnel
R2(config-if)#exit

tunnel 0
100.0.0.2 255.255.255.0
source 12.0.0.1
destination 11.0.0.1
mode gre ip
key 123456

Cu hnh nh tuyn OSPF thng qua Interface Tunnel


R1(config)#router ospf 1
R1(config-router)#network 100.0.0.0 0.0.0.255 area 0
R1(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 0
R2(config-router)#network 20.0.0.0 0.0.0.255 area 0
Trong thc t ta c th cu hnh GRE Tunnel tng mc bo mt v n nh ca D liu
khi i qua ISP