Question
Create brdige on CentOS 6 for OpenVPN server
I am setup CentOS 6 and successful run OpenVPN server.
All clients connect for server.
My target: Combine two networks use server-bridge option.
I am read offical documentation and use this manual:
http://openvpn.net/index.php/open-source/documentation/miscellaneous/76-ethernet-bridging.html
My settings:
========== OpenVPN server config ==============
local $IP_ADDRESS_DROPPLET
mode server
tls-server
tls-timeout 120
proto tcp-server
dev tap
port 1194
daemon
tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0
ca /etc/openvpn/easy-rsa/keys/ca.crt
cert /etc/openvpn/easy-rsa/keys/vpn-server.crt
key /etc/openvpn/easy-rsa/keys/vpn-server.key
dh /etc/openvpn/easy-rsa/keys/dh1024.pem
ifconfig 172.16.2.1 255.255.255.0
#ifconfig-pool 172.16.2.5 172.16.2.200
ifconfig-pool-persist /var/log/openvpn-ipp.txt
server-bridge 172.16.2.4 255.255.255.0 172.16.2.2 172.16.2.200
status /var/log/openvpn-status.log 1
status-version 2
push "route-gateway 172.16.2.1"
client-to-client
verb 3
cipher BF-CBC
persist-key
log-append /var/log/openvpn.log
persist-tun
comp-lzo
user nobody
group nobody
================= END ==============
=========== bridge-start.sh ==================
#!/bin/bash
# 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="172.16.2.4"
eth_netmask="255.255.255.0"
eth_broadcast="172.16.2.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
================= END ==============
use this is manual http://xmodulo.com/2013/04/how-to-configure-linux-bridge-interface.html
and another documentation i am configure br0 for OpenVPN.
Step 1: Write /etc/sysconfig/network-scripts/ifcfg-eth0
========= CONTENT ifcfg-br0 ===================
DEVICE=eth0
TYPE=Ethernet
BRIDGE=br100
==================== END ==========================
Step 2: Write /etc/sysconfig/network-scripts/ifcfg-br0
========= CONTENT ifcfg-br0 ===================
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
DNS1=8.8.4.4
NM_CONTROLLED="yes"
HWADDR=04:01:13:49:60:
IPADDR= $IP_ADDRESS_DROPPLET
NETMASK=255.255.255.0
GATEWAY=$GATEWAT_ADDRESS_DROPPLET
PREFIX=24
ONBOOT=yes
STP=no
==================== END ==========================
Step 3:
After i am try bridge-start.sh server lost connect with internet.
Login to VNC console and ifconfig show me:
eth0 - dont have IP address
br0 have 172.16.2.1 IP address
$IP_ADDRESS_DROPPLET is not setup for interfaces.
I thnink i do mistake in configuration for br0.
Maybe Digital ocean blocked not-standart network configuration ? Dont know.
How to setup correct network settings?
IMPORTANT - Offical OpenVPN documentation have notice:
========= QUOTE =========
A common mistake that people make when manually configuring an Ethernet bridge is that they add their primary ethernet adapter to the bridge before they have set the IP and netmask of the bridge interface. The result is that the primary ethernet interface "loses" its settings, but the equivalent bridge interface settings have not yet been defined, so the net effect is a loss of connectivity on the ethernet interface.
========= QUOTE END ======
Add a comment
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×