Create brdige on CentOS 6 for OpenVPN server

March 22, 2014 8.5k views
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: 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 #ifconfig-pool ifconfig-pool-persist /var/log/openvpn-ipp.txt server-bridge status /var/log/openvpn-status.log 1 status-version 2 push "route-gateway" 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 ============== =========== ================== #!/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="" eth_netmask="" eth_broadcast="" 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 promisc up done ifconfig $eth promisc up ifconfig $br $eth_ip netmask $eth_netmask broadcast $eth_broadcast ================= END ============== use this is manual 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= NM_CONTROLLED="yes" HWADDR=04:01:13:49:60: IPADDR= $IP_ADDRESS_DROPPLET NETMASK= GATEWAY=$GATEWAT_ADDRESS_DROPPLET PREFIX=24 ONBOOT=yes STP=no ==================== END ========================== Step 3: After i am try server lost connect with internet. Login to VNC console and ifconfig show me: eth0 - dont have IP address br0 have 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 ======
1 Answer
I notice that in some places in your configuration you use "br100" and others, you use "br0" Was that just a typo when you pasted the information here, or is that what you are actually using? Try picking one consistently through out you configuration files.
Have another answer? Share your knowledge.