I spent the majority of last week working on this, still haven't been able to get it to work properly.
I have a CentOS 6.4 server running in Hyper-V that is acting as the OpenVPN server. eth1 IP is 10.6.1.219, which is on the 10.6.0.0/17 network that I am trying to provide access to. Here is my server.conf:
port 1194
proto udp
dev tap0
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh1024.pem
server-bridge 10.6.1.254 255.255.128.0 10.6.9.0 10.6.9.254
client-to-client
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
Here is my openvpn-startup script for creating the bridge:
#!/bin/sh
#################################
# 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="eth1"
eth_ip="10.6.1.219"
eth_netmask="255.255.128.0"
eth_broadcast="10.6.127.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
route add default gw 10.6.1.254
openvpn-shutdown script for tearing down the bridge:
#!/bin/sh
####################################
# Tear Down Ethernet bridge on Linux
####################################
# Define Bridge Interface
br="br0"
# Define list of TAP interfaces to be bridged together
tap="tap0"
ifconfig $br down
brctl delbr $br
for t in $tap; do
openvpn --rmtun --dev $t
done
ifconfig eth1 down
ifconfig eth1 up
Here is the client.conf I am testing the connection with:
client
dev tap
proto udp
remote [WAN IP is here] 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca "C:\\Program Files\\OpenVPN\\config\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\config\\plant2.crt"
key "C:\\Program Files\\OpenVPN\\config\\plant2.key"
ns-cert-type server
comp-lzo
verb 3
I am able to connect, and I receive a 10.6.9.0 IP. I can ping/SSH to the CentOS server at 10.6.1.219, but cannot ping/access any other computers on the server's network. I am currently using a Windows laptop to test the connection, but once it starts working properly I plan to make the clients run on routers at the remote sites. Is it possible that Hyper-V is causing problems? I have read that its virtual networking does not support promiscuous mode. I have tried both a "Network Adapter" and a "Legacy Network Adapter" in the VM, same result with both.
Another possible issue I was considering is the site that I'm initiating the VPN connection from has a local network with 10.6.2.0/24 addressing, which overlaps with the subnet I'm trying to connect to. Could that be the cause?
Any help would be greatly appreciated. Thank you