实验要求:

配置GRE协议,完成全网互通。


实验环境:

GRE实验_GRE


实验配置:

(省略部分代码,可参见其他博客)

端口配置:

R2:
config terminal
int e0/0
ip address 10.0.12.2 255.255.255.0
no shutdown
int e0/1
ip address 192.168.1.254 255.255.255.0
no shutdown
exit
R3:
config terminal
int e0/0
ip address 10.0.23.2 255.255.255.0
no shutdown
int e0/1
ip address 192.168.2.254 255.255.255.0
no shutdown
exit


基本路由配置:

R2:
router ospf 1
network 192.168.1.0 0.0.0.255 area 0
network 192.168.13.0 0.0.0.255 area 0
exit
ip route 0.0.0.0 0.0.0.0 10.0.12.1
R3:
router ospf 1
network 192.168.2.0 0.0.0.255 area 0
network 192.168.13.0 0.0.0.255 area 0
exit
ip route 0.0.0.0 0.0.0.0 10.0.23.1


GRE配置:

R2:
int tunnel 0
tunnel source e0/0
tunnel destination 10.0.23.2
tunnel mode gre ip
ip address 192.168.13.1 255.255.255.0
tunnel key 123456
no shutdown
exit
R3:
int tunnel 0  #进入端口
tunnel source e0/0 #配置源端口
tunnel destination 10.0.12.2 #配置目的IP
tunnel mode gre ip #配置模式
ip address 192.168.13.2 255.255.255.0
tunnel key 123456 #配置密码
no shutdown
exit


查看配置结果:

GRE实验_GRE_02

GRE实验_GRE_03

GRE实验_路由配置_04



配置完成,实验结束。

(如有疏漏,还请读者指出)