Loading GRE Modules
Modprobe Ip_gre
Create a tunnel named office
IP tunnel addoffice mode GRE remote 111.206.164.122 local 111.206.0.88 TTL 255
IP Link Set officeup
Add an IP address for tunnel
IP Add add10.100.100.1/30 Dev Office
Create a routing table with a table name of 136
IP route add default via 103.246.132.61 table 136
To create a policy that specifies the route table 136 when the local source IP is 192.168.50.0/24 out-of-the-way
IP rule Add from192.168.50.0/24 Dev office table 136
Add static route to point to tunnel
IP route add103.246.135.0/24 via 10.100.100.2 Dev Office
IP route add192.168.50.0/24 via 10.100.100.2 Dev Office
# IP Tunnel show View tunnel Information
GRE0:GRE/IP Remote any local any TTL inherit Nopmtudisc
OFFICE:GRE/IP Remote 111.206.164.122 local 111.206.0.88 TTL 255
This article is from the "LIHONGWEIBJ" blog, make sure to keep this source http://lihongweibj.blog.51cto.com/6235038/1657436
Linux cent OS 6.4 builds GRE tunnel