# 哪一個本地ip地址將被Open***監聽?
# 也能夠不註明
;local a.b.c.d
# 哪個tcp/udp端口將被監聽?
# 若是你要在一臺機器上啓動多個Open×××,你須要監聽不一樣的端口
# 記着在防火牆那裏打開這些端口
port 1194
# TCP仍是UDP協議?
# 若是採用HTTP proxy,必須使用TCP協議
proto udp
# 「dev tun」 將建立1個路由隧道
# 「dev tap」 將建立1個以太網隧道
# 若是你選擇橋模式,使用 「dev tap」
# 若是你須要控制每一個客戶端的訪問控制策略
# 你必須建立防火牆規則到TUN/TAP接口
# 在非Windows系統上,你能夠明確該接口,如:tun0
# 在Windows上,使用」dev-node」
# 在大多數系統上,若是你的防火牆部分或所有禁止TUN/TAP接口的話,Open***將可能不起做用
;dev tap
dev tun
# 在Windows上若是你更多的網絡接口,你須要在網絡鏈接控制面板上增長
# TAP-Win32適配器接口名
# 在XP SP2或更高系統上,你須要使windows防火牆對該接口不執行過濾規則
# 非Windows系統一般不須要設置這個
;dev-node MyTap
# 證書/key文件指向
ca ca.crt #Open×××使用的ROOT CA,使用build-ca生成的,用於驗證客戶是證書是否合法
cert server.crt #Server使用的證書文件
key server.key #Server使用的證書對應的key,該文件必須嚴格控制其安全性
#CRL文件的申明,被吊銷的證書鏈,這些證書將沒法登陸
;crl-verify ***crl.pem
# Diffie hellman文件指向
# 若是你在創建證書時使用2048的話這裏是2048
# 不然默認
dh dh1024.pem
# 給接入的client分配的地址段
server 192.168.80.0 255.255.255.0
# 維護客戶端和虛擬ip地址聯繫
# 在open***重啓時,再次鏈接的客戶端將依然被分配和之前同樣的
# ip地址
ifconfig-pool-persist ipp.txt
# open***橋模式用的[我不用橋模式]
# 配置服務器橋接模式的前提是必須將倆網卡在操做系統下先創建橋接,以後手動設置ip地址和子網掩碼。
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
# 下面這句使客戶端能訪問服務器後面的子網機器
# 好比:服務器子網網段是192.168.10.0和192.168.10.2
# 你須要在open×××服務器端配置文件中添加下面這兩句
push 「route 192.168.10.0 255.255.255.0″
push 「route 192.168.20.0 255.255.255.0″
# 使服務器子網內機器能夠訪問客戶端子網內機器
# 僅用於路由模式
# 假設:客戶端子網網段192.168.40.0
# 首先,在服務器配置文件中添加下面這兩行
# client-config-dir ccd
# 和route 192.168.40.0 255.255.255.0
# 而後在服務器端ccd目錄下建立一個文件,文件名是客戶端的公共名
# 文件內容是:
# iroute 192.168.40.0 255.255.255.0
;client-config-dir ccd
;route 192.168.40.0 255.255.255.0
# EXAMPLE: Suppose you want to give
# Thelonious a fixed ××× IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
# Then add this line to ccd/Thelonious:
# ifconfig-push 10.9.0.1 10.9.0.2
# 支持對不一樣客戶端組執行不一樣的防火牆策略
# 這裏有兩種方法
# (1) 運行多個Open×××守護進程, 每一個對應不一樣的組
# 而且防火牆對不一樣的組和進程執行不一樣的策略
# (2) (高級)建立1個動態腳本使防火牆對接入的不一樣客戶端執行不一樣的策略
;learn-address ./script
# 下面這句使客戶端全部網絡通訊經過***
# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the ×××, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the ×××
# (The Open××× server machine may need to NAT
# the TUN/TAP interface to the internet in
# order for this to work properly).
# CAVEAT: May break client’s network config if
# client’s local DHCP server packets get routed
# through the tunnel. Solution: make sure
# client’s local DHCP server is reachable via
# a more specific route than the default route
# of 0.0.0.0/0.0.0.0.
;push 「redirect-gateway」
# 客戶端DHCP設置
# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses. CAVEAT:
#
http://open***.net/faq.html#dhcpcaveats
;push 「dhcp-option DNS 10.8.0.1″
;push 「dhcp-option WINS 10.8.0.1″
# 下面這句使客戶端能相互訪問
# 不然,默認設置下客戶端間不能相互訪問
client-to-client
# 這段經常使用於測試用途,註釋該條可實現限制一個證書在同一時刻只能有一個客戶端接入
# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names. This is recommended
# only for testing purposes. For production use,
# each client should have its own certificate/key
# pair.
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE 「COMMON NAME」,
# UNCOMMENT THIS LINE OUT.
;duplicate-cn
# 活動鏈接保時期限
# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120
# 爲防止遭到DDoS***
# 生成ta.key文件,並cp到服務器端和每一個客戶端
# 該文件用如下命令生成
# open*** –genkey –secret ta.key
# 服務器端0,客戶端1
# 該文件要嚴格保護
tls-auth ta.key 0 # 服務器端是0
# 選擇一種加密算法,Server端和client端必須同樣
# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
;cipher BF-CBC # Blowfish (default)
;cipher AES-128-CBC # AES
;cipher DES-EDE3-CBC # Triple-DES
# 容許數據壓縮
# 客戶端配置文件也須要有這項
comp-lzo
# 最大客戶端併發鏈接數量
;max-clients 100
#定義運行open***的用戶
;user nobody
;group nobody
#經過keepalive檢測超時後,從新啓動×××,不從新讀取keys,保留第一次使用的keys
persist-key
#經過keepalive檢測超時後,從新啓動×××,一直保持tun或者tap設備是linkup的,
#不然網絡鏈接會先linkdown而後linkup
persist-tun
#按期把open***的一些狀態信息寫到文件中,以便本身寫程序計費或者進行其餘操做
status open***-status.log
#記錄日誌,每次從新啓動open***後刪除原有的log信息
;log open***.log
#或者
#記錄日誌,每次從新啓動open***後追加原有的log信息
log-append open***.log #[爲便於管理log可將該項改成/var/log/open***.log]
# 設置日誌記錄冗長級別
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 3
# 重複日誌記錄限額 # Silence repeating messages. At most 20 # sequential messages of the same message # category will be output to the log. mute 20