JeroenSt
Hello,
I'm trying to setup a simple openvpn server. Everything works, my clients can connect, username and password is accepted, dhcp address is received by the client, but there is no traffic going through the TAP0 device, so I cant ping the hosts in the network..
I don't know what's going wrong.. :-(
server.conf:
port 11940
proto udp
dev tap
ca /etc/openvpn/keys/bict/ca.crt
cert /etc/openvpn/keys/bict/server.crt
key /etc/openvpn/keys/bict/server.key # This file should be kept secret
dh /etc/openvpn/keys/bict/dh2048.pem
server-bridge 192.168.12.2 255.255.255.0 192.168.12.50 192.168.12.60
keepalive 30 120
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
log openvpn.log
verb 4
plugin /usr/lib/openvpn/openvpn-auth-pam.so login
client-cert-not-required
username-as-common-name
bridge-start.sh:
#!/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.12.2"
eth_netmask="255.255.255.0"
eth_broadcast="192.168.12.255"
eth_gateway="192.168.12.1"
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
route add default gw $eth_gateway
output of ifconfig:
br0 Link encap:Ethernet HWaddr 00:0b:db:77:28:a8
inet addr:192.168.12.2 Bcast:192.168.12.255 Mask:255.255.255.0
inet6 addr: fe80::20b:dbff:fe77:28a8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1360 errors:0 dropped:0 overruns:0 frame:0
TX packets:268 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:87440 (87.4 KB) TX bytes:38726 (38.7 KB)
eth0 Link encap:Ethernet HWaddr 00:0b:db:77:28:a8
inet6 addr: fe80::20b:dbff:fe77:28a8/64 Scope:Link
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:1947 errors:0 dropped:0 overruns:0 frame:0
TX packets:433 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:211596 (211.5 KB) TX bytes:63485 (63.4 KB)
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:23 errors:0 dropped:0 overruns:0 frame:0
TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3472 (3.4 KB) TX bytes:3472 (3.4 KB)
tap0 Link encap:Ethernet HWaddr ca:b7:5a:68:be:62
UP BROADCAST PROMISC MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Please help me, I searched the net about this issue, with no result so far...
Kind regards!
Mimiko
Most likely an firewall and forwarding issue. Read this carefully and follow the instruction:
http://openvpn.net/index.php/open-source/documentation/miscellaneous/76-ethernet-bridging.html
JeroenSt
Ok, thanks, I'll read it.
I also saw this in the syslog:
Oct 6 20:22:48 ubuntu kernel: [ 25.872014] eth0: no IPv6 routers present
Oct 6 20:23:53 ubuntu kernel: [ 91.308571] Bridge firewalling registered
Oct 6 20:23:53 ubuntu kernel: [ 91.319757] device eth0 entered promiscuous mode
Oct 6 20:23:53 ubuntu kernel: [ 91.331727] device tap0 entered promiscuous mode
Oct 6 20:23:53 ubuntu kernel: [ 91.346662] ADDRCONF(NETDEV_UP): tap0: link is not ready
Oct 6 20:23:53 ubuntu kernel: [ 91.366722] br0: port 1(eth0) entering learning state
Oct 6 20:23:53 ubuntu kernel: [ 91.366730] br0: port 1(eth0) entering learning state
Oct 6 20:24:04 ubuntu kernel: [ 101.520010] br0: no IPv6 routers present
Oct 6 20:24:09 ubuntu kernel: [ 106.400032] br0: port 1(eth0) entering forwarding state
Oct 6 20:24:51 ubuntu kernel: [ 148.831800] br0: port 2(tap0) entering disabled state
Oct 6 20:24:59 ubuntu kernel: [ 156.723750] ADDRCONF(NETDEV_UP): tap0: link is not ready
JeroenSt
I red the manual you suggested, but with no result, everything seems fine.. :-(
Can you give more help?
Thanx in advance!
Mimiko
If those logs are repeated - I can't help you with linux bridging creation. First create the bridge with linux and see that no errors appear, aftet that can be started OpenVPN.
JeroenSt
Problem solved!
Instead of dev tap in server.conf dev tap0 works!
I found this solution on:
https://help.ubuntu.com/community/OpenVPN
Mimiko
Good job, you solved yourself. 😉
farhanullahkhan
review the post
farhanullahkhan
hi, I setup ( server and client ) in briding and Everything works perfectly,my clients can connect.traffic is troughing from every port and also from the br0 (bridge) port, but there is no traffic going through the TAP0 device,
server
mode server
tls-server
dev tap0
#port 1194
proto udp
local 192.168.10.1
server-bridge 192.168.10.1 255.255.255.0 192.168.10.2 192.168.10.100
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
key server.key
push "redirect-gateway def1"
key server.key
#client-to-client
cert server.crt
cipher AES-256-CBC
auth SHA256
tls-auth ta.key 0
#up "/etc/openvpn/up.sh br0"
#down "/etc/openvpn/down.sh br0"
#ifconfig-pool-persist ipp.txt
keepalive 10 600
comp-lzo
key server.key
persist-tun
persist-key
verb 10
#mute 20
status openvpn-status.log
duplicate-cn
auth-nocache
Client
client
dev tap0
proto udp
#port 1194
remote 192.168.10.1
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
cert client.crt
key client.key
tls-auth ta.key 1
comp-lzo
cipher AES-256-CBC
auth SHA256
verb 3
auth-nocache