首页 > 系统服务 > 详细

linux cent os 6.4 建立GRE tunnel

时间:2015-06-02 15:31:18      阅读:417      评论:0      收藏:0      [点我收藏+]

加载GRE模块

modprobe ip_gre


创建Tunnel 名为office

ip tunnel add office  mode gre  remote 111.206.164.122  local 111.206.0.88 ttl 255

ip link set office up


为tunnel 增加IP地址

ip add add 10.100.100.1/30  dev office


创建一个路由表,表名为136

ip route add default via 103.246.132.61 table 136


创建一条策略,使本地源IP为192.168.50.0/24 向外访问时指定路由表136

ip rule add from 192.168.50.0/24 dev office table 136


增加静态路由指向tunnel

ip route add 103.246.135.0/24 via 10.100.100.2 dev office

ip route add 192.168.50.0/24 via 10.100.100.2 dev office

 

# ip tunnel show     查看tunnel信息

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 


本文出自 “lihongweibj” 博客,请务必保留此出处http://lihongweibj.blog.51cto.com/6235038/1657436

linux cent os 6.4 建立GRE tunnel

原文:http://lihongweibj.blog.51cto.com/6235038/1657436

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!