centos 6搭建open***

***功能大家都懂得,open***確實非常好用,下面是配置

IP規劃

外網ip:xxxx

內網ip:xxxx


關閉selinux

vim /etc/selinux/config 


setenforce 0

1.安裝源

wget http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-   2.el6.rf.x86_64.rpm

rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm


2.安裝open***

yum install -y open***


3.生成Open***需要的證書

cp -R /usr/share/doc/open***-*/easy-rsa /etc/open*** 

cd /etc/open***/easy-rsa/2.0

chmod +x  *

下面按照需要填寫

ln -s openssl-1.0.0.cnf openssl.cnf

. vars

./clean-all

./build-ca server

./build-key-server server

./build-key client

./build-dh


4.編輯配置

vim etc/open***/server.conf

port 1194

# 改成tcp,默認使用udp,如果使用HTTP Proxy,必須使用tcp協議

proto tcp

dev tun

# 路徑前面加keys,全路徑爲/etc/open***/keys/ca.crt

ca keys/ca.crt

cert keys/server.crt

key keys/server.key  # This file should be kept secret

dh keys/dh2048.pem

# 默認虛擬局域網網段,不要和實際的局域網衝突即可

server 10.8.0.0 255.255.255.0

ifconfig-pool-persist ipp.txt

# 10.0.0.0/8是我這臺***服務器所在的內網的網段,讀者應該根據自身實際情況進行修改

push "route 10.0.0.0 255.0.0.0"

# 可以讓客戶端之間相互訪問直接通過open***程序轉發,根據需要設置

client-to-client

# 如果客戶端都使用相同的證書和密鑰連接***,一定要打開這個選項,否則每個證書只允許一個人連接***

duplicate-cn

keepalive 10 120

tls-auth keys/ta.key 0 # This file is secret

comp-lzo

persist-key

persist-tun

# Open***的狀態日誌,默認爲/etc/open***/open***-status.log

status open***-status.log

# Open***的運行日誌,默認爲/etc/open***/open***.log 

log-append open***.log

# 改成verb 5可以多查看一些調試信息

verb 5


4、配置內核和防火牆,啓動服務

# 開啓路由轉發功能

sed -i '/net.ipv4.ip_forward/s/0/1/' /etc/sysctl.conf

sysctl -p

# 配置防火牆,別忘記保存

iptables -I INPUT -p tcp --dport 1194 -m comment --comment "open***" -j ACCEPT

iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j MASQUERADE

service iptables save

# 啓動open***並設置爲開機啓動

service open*** start

chkconfig open*** on 


5、創建客戶端配置文件

#複製一份client.conf模板命名爲client.o***

cp /usr/share/doc/open***-2.3.2/sample/sample-config-files/client.conf client.o***

# 編輯client.o***

vim client.o***

client

dev tun

# 改爲tcp

proto tcp

# Open***服務器的外網IP和端口

remote 203.195.xxx.xxx 1194

resolv-retry infinite

nobind

persist-key

persist-tun

ca ca.crt

# lient1的證書

cert client1.crt

# client1的密鑰

key client1.key

ns-cert-type server

# 去掉前面的註釋

tls-auth ta.key 1

comp-lzo

verb 3 


二、Windows客戶端安裝及配置

    客戶端系統:Windows7 64位

    內網IP:172.16.4.4

    Open***版本:Open*** 2.3.3 Windows 64位

    1、下載安裝Open***

    Open*** 2.3.3 Windows 32位 安裝文件:

    http://swupdate.open***.org/community/releases/open***-install-2.3.3-I002-i686.exe

    Open*** 2.3.3 Windows 64位 安裝文件:

    http://swupdate.open***.org/community/releases/open***-install-2.3.3-I002-x86_64.exe

    2、配置client

    將Open***服務器上的client.o***、ca.crt、client1.crt、client1.key、ta.key上傳到Windows客戶端安裝目錄下的config文件夾(C:\Program Files\Open***\config)

    3、啓動Open*** GUI

    在電腦右下角的open***圖標上右擊,選擇“Connect”。正常情況下應該能夠連接成功,分配正常的IP



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章