hti 发表于 2018-7-15 15:10:01

【Cisco】 GRE Tunnel隧道

  说明:A公司的PC1所在网段192.168.1.0/24要和B公司PC2所在网段172.16.2.0/24建立GRE tunnel通信
  配置思路:
  1、R1与R2要能通信--R1和R2分别配置默认路由到ISP
  2、新建tunnel端口,设置IP,双方要在同一网段;配置source即公网出口IP和destination即对方公网出口ip
  3、此时双方tunnel已经建立起来了,需要建立路由,PC1网段到PC2网段,PC2网段到PC1网段,下一跳地址为对端ip;此时配置结束。
  拓扑图如下:

  配置信息:
  R1:
  config t
  ip route 0.0.0.0 0.0.0.0 100.1.1.2
  int g0/1
  no sh
  ip add 100.1.1.1 255.255.255.252
  exit
  int f0/1
  no sh
  ip add 192.168.1.1 255.255.255.0
  exit
  int tunnel 0
  no sh
  ip add 10.10.10.1 255.255.255.0
  tunnel source 100.1.1.1
  tunnel destination 200.2.2.2
  tunnel mode gre ip
  exit
  ip route 172.16.2.0 255.255.255.0 10.10.10.2
  exit
  ISP:
  config t
  int g0/1
  no sh
  ip add 100.1.1.2 255.255.255.252
  exit
  int g0/2
  no sh
  ip add 200.2.2.1 255.255.255.252
  exit
  R3:
  config t
  ip route 0.0.0.0 0.0.0.0 200.2.2.1
  int g0/2
  no sh
  ip add 200.2.2.2 255.255.255.252
  exit
  int f0/1
  no sh
  ip add 172.16.2.1 255.255.255.0
  exit
  int tunnel 0
  no sh
  ip add 10.10.10.2 255.255.255.0
  tunnel source 200.2.2.2
  tunnel destination 100.1.1.1
  tunnel mode gre ip
  exit
  ip route 192.168.1.0 255.255.255.0 10.10.10.2
  exit
  需要查看ping的过程,可开启debug, debug ip packet
页: [1]
查看完整版本: 【Cisco】 GRE Tunnel隧道