linux bridge eth interface with openvpn and DHCP
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
-
- OpenVpn Newbie
- Posts: 4
- Joined: Mon Mar 21, 2011 11:51 am
linux bridge eth interface with openvpn and DHCP
Hi,
Can you please help me to bridge with DHCP in openVPN.I found the topic
http://openvpn.net/index.php/open-sourc ... dging.html
But it is for using client IP pool.I need to configure with DHCP.Any help will be appreciated.
Thanks
Can you please help me to bridge with DHCP in openVPN.I found the topic
http://openvpn.net/index.php/open-sourc ... dging.html
But it is for using client IP pool.I need to configure with DHCP.Any help will be appreciated.
Thanks
- gladiatr72
- Forum Team
- Posts: 194
- Joined: Mon Dec 13, 2010 3:51 pm
- Location: Lawrence, KS
Re: linux bridge eth interface with openvpn and DHCP
This comes directly from the openvpn man page (which I'd recommend reading)
Code: Select all
--server-bridge ['nogw']
A helper directive similar to --server which is designed to sim-
plify the configuration of OpenVPN's server mode in ethernet
bridging configurations.
If --server-bridge is used without any parameters, it will
enable a DHCP-proxy mode, where connecting OpenVPN clients will
receive an IP address for their TAP adapter from the DHCP server
running on the OpenVPN server-side LAN. Note that only clients
that support the binding of a DHCP client with the TAP adapter
(such as Windows) can support this mode. The optional nogw flag
(advanced) indicates that gateway information should not be
pushed to the client.
[..]I used to think it was awful that life was so unfair. [...]Wouldn't it be much worse if life were fair, and all the terrible things that happen to us come because we actually deserve them? -Marcus Cole
-
- OpenVpn Newbie
- Posts: 4
- Joined: Mon Mar 21, 2011 11:51 am
Re: linux bridge eth interface with openvpn and DHCP
Thanks for your reply.
I have OpenVPN installed and accepting connections from users.
What i need is eth1 to be bridged onto the VPN.
Also OpenVPN needs to be configured to assign IPs from a DHCP server, which has already been setup and configured on the same machine.
Can you please provide the steps ?
Thanks
I have OpenVPN installed and accepting connections from users.
What i need is eth1 to be bridged onto the VPN.
Also OpenVPN needs to be configured to assign IPs from a DHCP server, which has already been setup and configured on the same machine.
Can you please provide the steps ?
Thanks
- gladiatr72
- Forum Team
- Posts: 194
- Joined: Mon Dec 13, 2010 3:51 pm
- Location: Lawrence, KS
Re: linux bridge eth interface with openvpn and DHCP
What OS are you using?
[..]I used to think it was awful that life was so unfair. [...]Wouldn't it be much worse if life were fair, and all the terrible things that happen to us come because we actually deserve them? -Marcus Cole
-
- OpenVpn Newbie
- Posts: 4
- Joined: Mon Mar 21, 2011 11:51 am
Re: linux bridge eth interface with openvpn and DHCP
CentOS please give me a step by step instrestion asap.
Thanks
Thanks
- gladiatr72
- Forum Team
- Posts: 194
- Joined: Mon Dec 13, 2010 3:51 pm
- Location: Lawrence, KS
Re: linux bridge eth interface with openvpn and DHCP
To configure a your ethernet device for bridging in centos/rhel:
I'm assuming your internal ethernet device is eth1.
/etc/sysconfig/network-scripts/ifcfg-br0
/etc/sysconfig/network-scripts/ifcfg-eth1
to add the tap device to the bridge, use the up directive in your openvpn server configuration as follows:
/etc/openvpn/bridge-start.sh
chmod 755 /etc/openvpn/bridge-start.sh
I'm assuming your internal ethernet device is eth1.
/etc/sysconfig/network-scripts/ifcfg-br0
Code: Select all
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
IPADDR=[internal IP address]
NETMASK=255.255.255.0
ONBOOT=yes
USERCTL=yes
IPV6INIT=no
PEERDNS=no
PROMISC=yes
Code: Select all
DEVICE=eth1
TYPE=Ethernet
USERCTL=yes
ONBOOT=yes
IPV6INIT=no
PEERDNS=no
BRIDGE=br0
PROMISC=yes
Code: Select all
up /etc/openvpn/bridge-start.sh
Code: Select all
#!/bin/bash
echo "adding $1 to bridge"
brctl addif br0 $1
ifconfig $1 up
[..]I used to think it was awful that life was so unfair. [...]Wouldn't it be much worse if life were fair, and all the terrible things that happen to us come because we actually deserve them? -Marcus Cole
-
- OpenVpn Newbie
- Posts: 4
- Joined: Mon Mar 21, 2011 11:51 am
Re: linux bridge eth interface with openvpn and DHCP
Thank you very much for your reply.