Merry Christmas,
alright I have had quite some tries around and I got the thing about the bridging fixed. Seems to work well now.
After that I adapted the server.conf.
The only thing is, that I still get an error on the client side when I try to connect. The result is that the connection is not estabilished. I get an error log that I will post at the end of this posting.
Here is my complete configuration of the server and the client:
These are my files in /etc/openvpn/ (SERVER)
down.sh
easy-rsa #folder with rsa in files in it
keys/ca.crt
keys/dh1024.pem
keys/server.crt
keys/server.key
server.conf
ta.key
up.sh
This is in the up.sh: (SERVER)
#!/bin/sh
BR=$1
DEV=$2
MTU=$3
/sbin/ip link set "$DEV" up promisc on mtu "$MTU"
brctl addif $BR $DEV
This is in the down.sh: (SERVER)
#!/bin/sh
BR=$1
DEV=$2
brctl delif $BR $DEV
/sbin/ip link set "$DEV" down
This is in the server.conf: (SERVER)
mode server
tls-server
local 10.10.10.2 #ip/hostname of server
port 1194 #default open port
proto udp
#bridging directive
dev tap0 #If you need multiple tap devices, add them here
up "/etc/openvpn/up.sh br0 tap0 1500"
down "/etc/openvpn/down.sh br0 tap0"
persist-key
persist-tun
#certificates and encryption
ca /etc/openvpn/keys/ca.crt
cert /etc/openvpn/keys/server.crt
key /etc/openvpn/keys/server.key #this file is secret
dh /etc/openvpn/keys/dh1024.pem
tls-auth /etc/openvpn/ta.key #this file is secret
cipher BF-CBC #Blowfish (default)
comp-lzo
#DHCP information
ifconfig-pool-persist ipp.txt
server-bridge 10.10.10.2 255.255.255.0 10.10.10.100 10.10.10.110
push "dhcp-option DNS 10.10.10.1"
#push "dhcp-option DOMAIN yourdomain.com"
max-clients 10 #set this to the max number of clients to be connected at a time
#log and security
user nobody
group nogroup
keepalive 10 120
status /etc/openvpn/openvpn-status.log
verb 3
This is in the /etc/network/interfaces: (SERVER)
# The loopback network interface
auto lo br0
iface lo inet loopback
#iface eth1 inet dhcp
iface br0 inet static
address 10.10.10.2
netmask 255.255.255.0
gateway 10.10.10.1
bridge_ports eth1
iface eth1 inet manual
up ip link set $IFACE up promisc on
down ip link set $IFACE down promisc off
This is in ifconfig: (SERVER)
br0 Link encap:Ethernet Hardware Adresse e1:42:9c:2c:c1:d7
inet Adresse:10.10.10.2 Bcast:10.10.10.255 Maske:255.255.255.0
inet6-Adresse: fe80::e446:9bff:fe29:42a7/64 Gültigkeitsbereich:Verbindung
UP BROADCAST RUNNING MULTICAST MTU:1500 Metrik:1
RX packets:3186 errors:0 dropped:0 overruns:0 frame:0
TX packets:1657 errors:0 dropped:0 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenlänge:0
RX bytes:321170 (321.1 KB) TX bytes:219304 (219.3 KB)
eth1 Link encap:Ethernet Hardware Adresse e1:42:9c:2c:c1:d7
inet6-Adresse: fe80::e446:9bff:fe29:42a7/64 Gültigkeitsbereich:Verbindung
UP BROADCAST RUNNING MULTICAST MTU:1500 Metrik:1
RX packets:3244 errors:0 dropped:0 overruns:0 frame:0
TX packets:1657 errors:0 dropped:0 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenlänge:1000
RX bytes:379986 (379.9 KB) TX bytes:219304 (219.3 KB)
Interrupt:17 Basisadresse:0x6000
lo Link encap:Lokale Schleife
inet Adresse:127.0.0.1 Maske:255.0.0.0
inet6-Adresse: ::1/128 Gültigkeitsbereich:Maschine
UP LOOPBACK RUNNING MTU:16436 Metrik:1
RX packets:136 errors:0 dropped:0 overruns:0 frame:0
TX packets:136 errors:0 dropped:0 overruns:0 carrier:0
Kollisionen:0 Sendewarteschlangenlänge:0
RX bytes:11064 (11.0 KB) TX bytes:11064 (11.0 KB)
service iptables stop
Does not work on my Ubuntu 10.04 LTS server. Is there another way? When I put this command the system responds: iptables: unrecognized service
These files are in ~/openvpn/ (CLIENT)
ca.crt
client.conf
client.crt
client.key
ta.key
This is in the client.conf (CLIENT)
#Specify that this is a client
client
#Bridge device setting
dev tap
#Host name and port for the server
remote myserver 1194
#Client does not need to bind to a specific local port
nobind
#Keep trying to resolve
resolv-retry infinite
#Preserve state across restarts
persist-key
persist-tun
#SSL/TLS parameters
ca /home/myuser/openvpn/ca.crt
cert /home/myuser/openvpn/client.crt
key /home/myuser/openvpn/client.key
#tls-auth for server
#note: 0 = server, 1 = client
tls-auth /home/myuser/openvpn/ta.key 1
#Specify same cipher as server
cipher BF-CBC
#Use compression
comp-lzo
#Log verbosity
verb 3
This is the error while connecting: (CLIENT)
myuser@mycomputer:~/openvpn$ sudo openvpn --config client.conf
Wed Dec 26 03:30:16 2012 OpenVPN 2.2.1 x86_64-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] [eurephia] [MH] [PF_INET6] [IPv6 payload 20110424-2 (2.2RC2)] built on Mar 30 2012
Wed Dec 26 03:30:16 2012 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Wed Dec 26 03:30:16 2012 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Wed Dec 26 03:30:16 2012 Control Channel Authentication: using '/home/myuser/openvpn/ta.key' as a OpenVPN static key file
Wed Dec 26 03:30:16 2012 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Dec 26 03:30:16 2012 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Wed Dec 26 03:30:16 2012 LZO compression initialized
Wed Dec 26 03:30:16 2012 Control Channel MTU parms [ L:1574 D:166 EF:66 EB:0 ET:0 EL:0 ]
Wed Dec 26 03:30:16 2012 Socket Buffers: R=[229376->131072] S=[229376->131072]
Wed Dec 26 03:30:16 2012 Data Channel MTU parms [ L:1574 D:1450 EF:42 EB:135 ET:32 EL:0 AF:3/1 ]
Wed Dec 26 03:30:16 2012 Local Options hash (VER=V4): '13a273ba'
Wed Dec 26 03:30:16 2012 Expected Remote Options hash (VER=V4): '360696c5'
Wed Dec 26 03:30:16 2012 UDPv4 link local: [undef]
Wed Dec 26 03:30:16 2012 UDPv4 link remote: [AF_INET]10.10.10.2:1194
Wed Dec 26 03:30:16 2012 read UDPv4 [ECONNREFUSED]: Connection refused (code=111)
Wed Dec 26 03:30:18 2012 read UDPv4 [ECONNREFUSED]: Connection refused (code=111)
Wed Dec 26 03:30:22 2012 read UDPv4 [ECONNREFUSED]: Connection refused (code=111)
Wed Dec 26 03:30:31 2012 read UDPv4 [ECONNREFUSED]: Connection refused (code=111)
Where is the error? What's the next step?