标签:linux cent os 6.4 建立gre tunnel
加载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
标签:linux cent os 6.4 建立gre tunnel
原文地址:http://lihongweibj.blog.51cto.com/6235038/1657436