Cisco GRE

A classmate came to me and asked me last night, and he said: "Will you configure GRE?"
I thought to myself that this is not GRE technology, which is used to establish private tunnels. Then I parsed it directly to him. After I parsed it, he said, What about Cisco? (My goodness, if you come to ask questions later, let me first say, is it Huawei or Cisco?/snicker) In fact, Cisco and Huawei are very similar.
So write a blog post about "Cisco GRE" today!
Okay, let's not talk too much nonsense, let's go directly to the text.

1. Demand

Using GRE technology to establish a private tunnel for Tunnel, the loopback ports can access each other through the private tunnel.
Use a static routing protocol.

Two, topology

Insert picture description here

Three, basic configuration

viOS3

Router(config)#int g0/0
Router(config-if)#ip address 10.1.12.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#int loopback 0
Router(config-if)#ip address 1.1.1.1 255.255.255.0
Router(config-if)#exit
Router(config)#ip route 0.0.0.0 0.0.0.0 10.1.12.2
Router(config)#int tunnel 0
Router(config-if)#ip address 6.6.6.6 255.255.255.0      //设置tunnel隧道地址
Router(config-if)#tunnel source 10.1.12.1               //设置自己的公网地址
Router(config-if)#tunnel destination  10.1.23.3         //设置对方的公网地址
Router(config-if)#exit
Router(config)#ip route1.1.1.2 255.255.255.255 tunnel 0  //让环回口地址走 tunnel 隧道口

viOS7

Router(config)#int g0/1
Router(config-if)#ip address 10.1.12.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface g0/0
Router(config-if)#ip address 10.1.23.2 255.255.255.0

viOS8

Router(config)#int g0/0
Router(config-if)#ip address 10.1.23.3 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#int loopback 0
Router(config-if)#ip address 1.1.1.2 255.255.255.0
Router(config-if)#exit
Router(config)#ip route 0.0.0.0 0.0.0.0 10.1.23.2
Router(config)#int tunnel 0
Router(config-if)#ip address 7.7.7.7 255.255.255.0
Router(config-if)#tunnel source 10.1.23.3
Router(config-if)#tunnel destination 10.1.12.1
Router(config-if)#exit
Router(config)#ip route1.1.1.1 255.255.255.255 tunnel 0

Four, simple test

1. View the routing table on viOS8

show ip route
Insert picture description here
2, PING test

viOS8

Router#ping 1.1.1.1
Insert picture description here
viOS3

Router#ping 1.1.1.2
Insert picture description here
3. Take the source address to PING test

viOS3

Router#ping 1.1.1.2 source 1.1.1.1
Insert picture description here
viOS8

Router#ping 1.1.1.1 source 1.1.1.2
Insert picture description here

Five, summary

Using GRE technology, a dedicated line can be established, and data can be transmitted to each other through this dedicated line.

Did you lose school?


Insert picture description here
I am Yibodong ! You are welcome to discuss with me and see you in the next issue.

Guess you like

Origin blog.csdn.net/HYD696/article/details/108691718