####接口配置
####R1
interface GigabitEthernet0/0/2
ip address 172.16.1.1 255.255.255.0
interface Ethernet0/0/0
ip address 10.1.1.254 255.255.255.0
####R2
interface GigabitEthernet0/0/2
ip address 172.16.1.2 255.255.255.0
interface Ethernet0/0/0
ip address 192.168.1.254 255.255.255.0
####配置GRE
####R1
#创建Tunnel0/0/1接口
interface Tunnel0/0/1
tunnel-protocol gre
source 172.16.1.1(自己G0/0/2接口地址)
destination 172.16.1.2(对面G0/0/2接口)
gre key 123123(密码,鸡肋,明文传输过去的)
ip address 172.20.1.21 255.255.255.0(Tunnel ip 地址)
####R2
interface Tunnel0/0/1
tunnel-protocol gre
source 172.16.1.2(自己G0/0/2接口地址)
destination 172.16.1.1(对面G0/0/2接口)
gre key 123123
ip address 172.20.1.22 255.255.255.0
####路由
####R1
ip route-static 0.0.0.0 0.0.0.0 172.16.1.2
ip route-static 192.168.1.0 255.255.255.0 Tunnel0/0/1(把去往内网192.168.1.0的包送入Tunnel接口基GRE传输)
####R2
ip route-static 0.0.0.0 0.0.0.0 172.16.1.1
ip route-static 10.1.1.0 255.255.255.0 Tunnel0/0/1 (把去往内网10.1.1.0的包送入Tunnel接口基GRE传输)
抓包可以看出key是直接16进制传输的,转下为十进制就能知道密码