8 月 122014
 

公司有个需求,就是公司内部人员访问google和gmail自动翻墙访问(中国网络你懂得)。后来研究发现:

公司内网—出口设备VPN—–美国服务器VPN—-GOOGLE服务器

其中主要的是 要有个 国外有个VPN设备,公司内部有个VPN客户端。

公司内网 google相关的目的IP下一跳是VPN的客户端。然后VPN客户端做下NAT即可。

示例:

路由设置

ip route-static 59.24.3.0 255.255.255.0 192.168.0.238 preference 30
ip route-static 74.125.0.0 255.255.0.0 192.168.0.238 preference 30
ip route-static 103.245.222.0 255.255.255.0 192.168.0.238 preference 30
ip route-static 108.160.0.0 255.255.0.0 192.168.0.238 preference 30
ip route-static 172.17.0.0 255.255.255.0 192.168.0.238 preference 30
ip route-static 173.194.0.0 255.255.0.0 192.168.0.238 preference 30
ip route-static 198.252.206.0 255.255.255.0 192.168.0.238 preference 30
ip route-static 204.232.175.0 255.255.255.0 192.168.0.238 preference 30

其中

192.168.0.238 为VPN的 客户端的IP.

VPN客户端的命令

pptpsetup –create vpn –server  100.42.209.10 –username 123–password 123456–encrypt –start
echo “1” > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 180.166.126.162 -o ppp0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -o ppp0 -j MASQUERADE
route add -net 0.0.0.0 dev ppp0

如果正常连接会显示如下

image

100.42.209.10 是VPN的服务器IP,VPN的服务器网上文档很多就不做说明了。

然后公司内部访问google的相关的就可以访问了。

window添加路由  route add 192.168.0.0 mask 255.255.255.0 192.168.30.32

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny