bridging just by dhcp

OpenVPN tutorials ranging from configuration to hacks to compilation will be posted here.
moerdock
OpenVpn Newbie
Posts: 2
Joined: Mon Oct 19, 2015 11:09 am

bridging just by dhcp

Postby moerdock » Mon Oct 19, 2015 11:48 am

Hello together,
I can't find helpfull documentation.

I use raspbian jesse (10.0.0.2) and want to use openvpn to connect openvpn connections comming on lan 10.0.0.x (eth0) to internet (via wlan0).
wlan0 is connected to FritzBox "Gastzugang". That means the configuration on wlan0 is made by dhcp of the fritzbox to random network.

By that configuration I can use my laptop with single W-LAN-Adappter to connect simultaniously to a local network without internet access and a virtual network established over openvpn via local network for internet traffic. The virtual network for internet-traffic will only be connected to a VM on the laptop.

I found out instruction to configure it by tun and POSTROUTING to wlan0.
It doesn't work propably. I can connect and ping 10.8.0.1, but I don't come to internet.
However, even when it works the way to internet is not as free and transparent like when I use bridging.

So I want to use networkbriding instead.
By theorie it must be possible to create tap0 and connect it by br0 to wlan0 in the way, that a client connected to tap0 gets its configuration by the dhcp-server of the fritzbox (at wlan0). A switch/AP would manage it like that.

The clients virtual network adappter should get Network SSID "Fritz Gastzugang" and IP, netmask, gateway and DNS-Server by FritzBox and the FritzBox sees a client behind "raspberry-switch".

Every documentation I could find needs information about dhcp-range for the clients (using openvpn as dhcp-server) or at least the bridged network configuration. Do I need to get current dhcp information from wlan0 an configure my bridge at this data?

Thanks for help
Moerdock

User avatar
Traffic
OpenVPN Protagonist
Posts: 4082
Joined: Sat Aug 09, 2014 11:24 am

Re: bridging just by dhcp

Postby Traffic » Tue Oct 20, 2015 1:42 pm

Please give an example of the DHCP IP address you are expecting to receive over the VPN for your client.

moerdock
OpenVpn Newbie
Posts: 2
Joined: Mon Oct 19, 2015 11:09 am

Re: bridging just by dhcp

Postby moerdock » Wed Oct 21, 2015 12:17 pm

Today the DHCP-Server (FritzBox "guest access") has the IP 192.168.179.1 (255.255.255.0). It located one Client by IP 192.168.179.27 and the raspberry (wlan0) by IP 192.168.179.23. So I would expecta client bridged (over vpn to raspberry wlan0) to recieve for example the IP 192.168.179.30.

Tomorrow the DHCP-Server probably has the IP 192.168.170.1 and will change the Client-IPs that way.

User avatar
Traffic
OpenVPN Protagonist
Posts: 4082
Joined: Sat Aug 09, 2014 11:24 am

Re: bridging just by dhcp

Postby Traffic » Tue Nov 24, 2015 12:35 am

Setup OpenVPN and a bridge/TAP .. then let OpenVPN do DHCP for you:
https://openvpn.net/index.php/open-source/documentation/miscellaneous/ethernet-bridging.html


Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 2 guests