通过以太网桥进行OpenVPN p2p配置

问题描述

就像标题Im试图为我的员工设置p2p网关一样,以允许他们从远程位置工作。我为此目的租了一个Ubuntu 16.04 vps,但似乎无法正常工作。我已经在openvpn论坛上发布了,但没有答案:(

安装的第一步,我遵循了有关数字海洋的教程 https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04

并设置VPN,它可以正常工作,但是根据我的要求,我需要桥接客户端之间的连接,因此我按照本文创建了一个网桥

https://help.ubuntu.com/community/NetworkConnectionBridge

下一步,我按照openvpn社区上的教程设置了ethernetbridge

https://openvpn.net/community-resources/ethernet-bridging/

下面是我的配置和其他信息,以帮助阐明问题,我的bridge-start和down sh与本教程完全相同,除了ip值,我使用了公共ID和广播IDK中的随机范围(如果正确) ...

这是我用来创建网桥的网络接口

#source /etc/network/interfaces.d / *

auto lo
iface lo inet loopback

auto br0
iface br0 inet static
address x.x.x.46 // this one is the public IP from ifconfig
netmask 255.255.255.0
gateway x.x.x.173 /// this one i retrieve from typing route -n 

bridge_ports ens3
bridge_stp off
bridge_fd 0
bridge_maxwait 0

ifconfig结果:

br0链接encap:以太网HWaddr 56:00:03:00:b3:9f inet地址:x.x.x.46广播:x.x.x.255掩码:255.255.255.0 UP广播多播MTU:1500公制:1 RX数据包:12467错误:0掉落:0超限:0帧:0 TX数据包:10929错误:0掉落:0超限:0运营商:0 碰撞:0 txqueuelen:1000 RX字节:8891080(8.8 MB)TX字节:1590896(1.5 MB)

ens3 Link encap:以太网HWaddr 56:00:03:00:b3:9f UP广播连续多播MTU:1500公制:1 RX数据包:424967错误:0掉落:0超限:0帧:0 TX数据包:403862错误:0掉落:0超限:0运营商:0 碰撞:0 txqueuelen:1000 RX字节:288017618(288.0 MB)TX字节:287691949(287.6 MB)

lo Link encap:本地环回 inet地址:127.0.0.1掩码:255.0.0.0 inet6 addr::: 1/128范围:主机 上环运行MTU:65536公制:1 RX数据包:54个错误:0掉落:0超限:0帧:0 TX数据包:54个错误:0掉落:0超限:0运营商:0 碰撞:0 txqueuelen:1 RX字节:6296(6.2 KB)TX字节:6296(6.2 KB)

tap0链接encap:以太网HWaddr fa:7b:1b:c7:33:9b 上广播节目多播MTU:1500公制:1 RX数据包:0错误:0丢弃:0超限:0帧:0 TX数据包:0错误:0掉线:0超限:0运营商:0 碰撞:0 txqueuelen:100 RX字节:0(0.0 B)TX字节:0(0.0 B)

网桥状态:

网桥名称网桥ID已启用STP的接口br0 8000.56000300b39f no ens3

                                                   tap0

服务器配置

port 443 
proto udp 
dev tap0 
ca ca.crt 
cert server.crt 
key server.key 
client-to-client 
dh dh2048.pem 
topology subnet 
ifconfig-pool-persist ipp.text 
server-bridge (public IP) 255.255.255.0 (public IP).100 (public IP).255 // I FEEL THIS IS VERY WRONG BUT IDK WHAT TO PUT :< 
push "redirect-gateway def1 bypass-dhcp" 
push "dhcp-option DNS208.67.222.222" 
push "dhcp-option DNS 208.67.220.220" 
keepalive 10 120 
tls-auth ta.key 0 
cipher AES-128-CBC 
auth SHA256 
comp-lzo 
user nobody 
group nogroup 
persist-key 
persist-tun

客户端配置

client 
dev tap 
dev-node tap-bridge 
proto udp 
remote host 443 
resolv-retry infinite 
nobind 
user nobody 
group nogroup 
persist-key 
persist-tun 
ca ca.crt 
cert client.crt 
key client.key 
cipher AES-128-CBC 
auth SHA256 
remote-cert-tls server 
key-direction 1 
comp-lzo 
verb 6

我为Windows创建了新的TAP适配器,并将其命名为已配置(分接桥)

openVPN循环返回此消息:

测试路线:0/8成功len = 8 ret = 0 a = 0 u / d = up 路线:等待TUN / TAP界面出现...

然后说检测到递归路由,将tun数据包丢弃到[AF_INET] IP:端口

我可以对服务器执行ping操作,但似乎无法连接...我一定在某个地方弄乱了路由,但是我对Linux和网络完全陌生。.非常感谢您的帮助。谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)