本文介绍openwrt安装企业办公内网openvpn的技术文章。
由于公司云服务器除80、443端口外,其他端口均不提供公网IP访问,仅能通过内网IP进行访问,因此办公室路由器需配置OpenWRT的OpenVPN客户端以连接到云VPN网关。然而,在成功建立OpenVPN连接后,发现路由器可以正常访问,但办公电脑却无法通过VPN路由进行访问。经过检查,发现这是由于OpenWRT防火墙限制所致。为解决此问题,需对firewall进行相应配置,以确保办公电脑能够通过VPN通道进行访问。
- Navigate to Network > Interface
- Click on Add New Interface
Enter the details as below:
-
Name of the new interface: PureVPN
-
The protocol of the new interface: select Unmanaged from the drop-down menu
-
Cover the following interface: Custom Interface – tun0
-
Click Create interface.
Set Firewall Rule for VPN connection.
- Navigate to Network > Firewall
- Click Add.
Configure the firewall as below.
- Name: Pure_fw
- Input: reject
- Output: accept
- Forward: reject
- Masquerading: Checked
- MSS clamping: Checked
- Covered networks: Select PureVPN
- Select Allow forward from source zones
lan: Checked
wifi: Checked(if you have wifi interface configured) - Once that is done, click on Save.