问题及方案:
现环境是Open××× server端配置在IDC机房服务器上,并为每一个员工新建×××帐号,员工在其电脑上自行安装客户端,用于连接公司内网。然非技术部门阅读技术文档有力较差,经常性需运维部门协助,考虑到员工多是位于办公室时才需访问内网,故打算在办公室搭建个×××客户端,员工在公司期间则无需登陆×××账号即可访问内网。
公司用的是pfsense做网关,故在pfsense上配置×××客户端即可。以下是客户端配置指南。
一、 pfsense 证书管理
1.登录pfsense
2. Add CAs
从服务器拉取ca.crt 、 ca.key和client证书
Navigate to System —> Cert.Manager —> CAs —> Add
Descriptive name : CA描述名
Method : Import an existing Certificate Authority
Certificate data : copy server端拉取的ca.crt内容到证书数据
Certificate Private Key (optional) : copy server端拉取的ca.key的内容到证书私钥
Serial for next certificate : 空白
Click Save
3.添加客户端证书(*** server端新建客户端证书并拉取到本地):
Navigate to Certificates —> Add
Method : Import an existing Certificate
Descriptive name : client证书描述名
Certificate data : 从cilent证书中copy crt字段
Private key data : 从client证书中copy key字段
Click Save
二、 添加open***客户端
Navigate to ××× —> Open××× —> Clients —> Add ( Click Plus symbol to add client )
Server mode : Peer to Peer ( SSL/TLS )
Protocol : 与server端保持一致,此处以udp为例
Device mode : tun
Interface : WAN
Server host or address : 服务端ip地址
Server port : 默认端口1194
Server hostname resolution : check boxes for the Infinitely resolve server
Description :
Username : 服务端开启了用户验证功能则需输入用户密码,否则忽略
Password : 同上
TLS authenication : check boxes for the Enable authentication of TLS packets
Key : 从client证书中copy TLS key 字段
Peer Certificate Authority : 前文中导入的CA
Client Certificate : 前文中导入的客户端证书
Encryption Algorithm : 与服务端加密算法保持一致,服务端默认启用BF-CBC ( 128-bit )
Auth digest algorithm : SHA1 ( 160-bit )
Hardware Crypto : No Hardware Crypto Accceleration
Verbosity level : 3(recommended)
设置隧道(动态获取)
Compression [ Enabled without Adaptive Compression ]
三、Create open*** interface
Navigate to Interface —> ( assign )
Click the Plus button to add new interface.The new interface will be named OPT1 with a network port of o***c1().
Click on OPT1 to edit the interface
Check boxes for the Enable interface
Description : Enter a description name for the interface here
Click the Save button
四、添加规则、路由
1.允许服务器端外网网段流量进入wan口(Firewall-->Rules-->wan-->Add)
2.允许隧道网段流量进入open***虚拟网口(Firewall-->Rules--> open***-->Add)
3.更改nat方式为手动模式(Navigate to Firewall —> NAT —> Outbound —> Manual Outbound NAT rule generation ( AON - Advanced Outbound NAT ))
4.×××服务端添加客户端路由,并指定路由读取文件(此步未操作的话服务日志会提示:MULTI: bad source address from client [x.x.x.x], packet dropped)
备注:如果有多条外网线路,需指定客户端LAN口去服务端内网的策略路由,网关指向open*** gateway。
五、Verify Open××× Service
Click the Status —> Open×××,Status should be UP . Recommentdation is to click on the Restart open*** Service button
六、Verify Open××× Logs
Select ment Status —> System Logs —> click Open××× tab
Look for confirmation in your logs:open***[65701]: Initialization Sequence Completed
转载于:https://blog.51cto.com/wuyanc/1865187