Ubuntu 12.04.5 LTS 安装openvpn

帮助网址:http://www.xiaohui.com/dev/server/20070514-install-openvpn.htm

生成证书

cd /etc/openvpn/easy-rsa/2.0/

ll

. vars 

./pkitool zonglizhu

cd keys/

ll

tar cvzf zonglizhu.tar.gz ca.crt zonglizhu*

把证书拷贝到本地

sz zonglizhu.tar.gz 

让windows 客户端连接到 Ubuntu 12.04.5 LTS的openvpn server上也能上网,

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth1 -j SNAT --to-source 115.28.40.23

openvpn server的ip情况如下:


root@iZ28hsrxtuvZ:~# ifconfig 

eth0      Link encap:Ethernet  HWaddr 00:16:3e:02:0d:92  

          inet addr:10.144.37.218  Bcast:10.144.47.255  Mask:255.255.240.0

          inet6 addr: fe80::216:3eff:fe02:d92/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:927541 errors:0 dropped:0 overruns:0 frame:0

          TX packets:29488 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:40918004 (40.9 MB)  TX bytes:2157574 (2.1 MB)

          Interrupt:91 


eth1      Link encap:Ethernet  HWaddr 00:16:3e:02:0e:b9  

          inet addr:115.28.40.23  Bcast:115.28.43.255  Mask:255.255.252.0

          inet6 addr: fe80::216:3eff:fe02:eb9/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:59458085 errors:0 dropped:0 overruns:0 frame:0

          TX packets:4071667 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:3666731350 (3.6 GB)  TX bytes:2359168192 (2.3 GB)

          Interrupt:92 


lo        Link encap:Local Loopback  

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:3711085 errors:0 dropped:0 overruns:0 frame:0

          TX packets:3711085 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0 

          RX bytes:1838276352 (1.8 GB)  TX bytes:1838276352 (1.8 GB)


tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  

          inet addr:10.8.0.1  P-t-P:10.8.0.2  Mask:255.255.255.255

          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1

          RX packets:8072 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1365 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:100 

          RX bytes:567522 (567.5 KB)  TX bytes:412242 (412.2 KB)


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

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。