0

I am trying to configure a VPN under Ubuntu and openVPN. I have followed this guide: https://help.ubuntu.com/10.04/serverguide/C/openvpn.html but I can't conect from any client, I always get a timeout error.

In my opinion, the problem is located in the bridge configuration. According to Ubuntu wiki, I should configure a bridge interface this way:

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 

But I am not sure about the values I have to assign to adress, network, netmask, broadcast and gateway.

The output of ifconfig is the following one (the IP is not real):

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) 

My server is a dedicated one; mi local IP, the public IP and the broadcast are the same. I do not know if this is common in a dedicated server.

My current /etc/network/interfaces is the following one:

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 

Maybe the problem is anywhere else but I am not sure about this file being correct.

I would appreciate any kind of help, thank you in advance.

1 Answer 1

1

To setup the brige you could use this code:

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

you should use the address of your local network.

post your full configuration of client and server so i can help you further, also, what does the connection log says? is it a problem negotiating the tunnel?, is the public IP being forwarded to the OpenVPN server?

Regards,
Hugo

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .