OpenVPN和网桥接口configuration

我正在尝试在Ubuntu和openVPN下configuration一个VPN。 我遵循这个指南: https ://help.ubuntu.com/10.04/serverguide/C/openvpn.html,但我不能从任何客户端conect,我总是得到一个超时错误。

在我看来,问题是位于梁configuration。 根据Ubuntu维基,我应该这样configuration一个网桥接口:

auto lo iface lo inet loopback auto br0 iface br0 inet static address 192.168.0.10 network 192.168.0.0 netmask 255.255.255.0 broadcast 192.168.0.255 gateway 192.168.0.1 bridge_ports eth0 bridge_fd 9 bridge_hello 2 bridge_maxage 12 bridge_stp off 

但我不确定我必须分配给地址,networking,networking掩码,广播和网关的值。

ifconfig的输出如下(IP不是真实的):

 eth0 Link encap:Ethernet HWaddr 00:19:99:14:01:d1 inet addr:87.106.179.10 Bcast:87.106.179.10 Mask:255.255.255.255 inet6 addr: fe80::219:99ff:fe14:1d1/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1147011 errors:1 dropped:0 overruns:0 frame:1 TX packets:2052888 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:78775595 (78.7 MB) TX bytes:2585422360 (2.5 GB) Interrupt:20 Base address:0xa000 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:5040278 errors:0 dropped:0 overruns:0 frame:0 TX packets:5040278 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1991710982 (1.9 GB) TX bytes:1991710982 (1.9 GB) 

我的服务器是专用的; mi本地IP,公网IP和广播是一样的。 我不知道这是否在专用服务器中很常见。

我目前的/ etc / network / interfaces是以下一个:

 auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp auto br0 iface br0 inet static address 87.106.179.10 network 192.168.0.0 netmask 255.255.255.0 broadcast 192.168.0.255 gateway 87.106.179.10 bridge_ports eth0 bridge_fd 9 bridge_hello 2 bridge_maxage 12 bridge_stp off 

也许问题是其他地方,但我不知道这个文件是正确的。

我将不胜感激任何forms的帮助,请提前致谢。

要设置brige,您可以使用以下代码:

http://openvpn.net/index.php/open-source/documentation/miscellaneous/76-ethernet-bridging.html#linuxscript

  #!/bin/bash ################################# #Set up Ethernet bridge on Linux# Requires: bridge-utils ################################# #Define Bridge Interface br="br0" # Define list of TAP interfaces to be bridged, # for example tap="tap0 tap1 tap2". tap="tap0" # Define physical ethernet interface to be bridged # with TAP interface(s) above. eth="eth0" eth_ip="192.168.8.4" eth_netmask="255.255.255.0" eth_broadcast="192.168.8.255" for t in $tap; do openvpn --mktun --dev $t done brctl addbr $br brctl addif $br $eth for t in $tap; do brctl addif $br $t done for t in $tap; do ifconfig $t 0.0.0.0 promisc up done ifconfig $eth 0.0.0.0 promisc up ifconfig $br $eth_ip netmask $eth_netmask broadcast $eth_broadcast 

你应该使用你的本地networking的地址。

发布您的客户端和服务器的完整configuration,所以我可以进一步帮助您,也是什么连接日志说? 是否是协商隧道的问题?公共IP是否被转发到OpenVPN服务器?

问候,
雨果