Discussion:
bridging a tun(4) VPN
(too old to reply)
Emmanuel Dreyfus
2016-03-19 15:41:06 UTC
Permalink
Hello

I would like to bridge an OpenVPN tunnel (tun(4) based) with a vlan.

But brconfig does not seem to like tun interfaces:
brconfig bridge4 add tun4
brconfig: add tun4: Invalid argument

Is there any hope to get this working?
--
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
***@netbsd.org

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Taylor R Campbell
2016-03-19 15:51:41 UTC
Permalink
Date: Sat, 19 Mar 2016 16:41:06 +0100
From: ***@netbsd.org (Emmanuel Dreyfus)

I would like to bridge an OpenVPN tunnel (tun(4) based) with a vlan.

But brconfig does not seem to like tun interfaces:
brconfig bridge4 add tun4
brconfig: add tun4: Invalid argument

Is there any hope to get this working?

Use tap(4)? tun(4) represents a software IP device, which has no
ethernet identity; tap(4) represents a software ethernet device.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Gert Doering
2016-03-19 20:03:43 UTC
Permalink
Hi,
Post by Emmanuel Dreyfus
I would like to bridge an OpenVPN tunnel (tun(4) based) with a vlan.
brconfig bridge4 add tun4
brconfig: add tun4: Invalid argument
Is there any hope to get this working?
As Taylor already answered, a tun(4) is a "pure IP" interface which
does not have a link layer - so to be able to bridge it to an ethernet
bridge, you'd need to have "something" between tun and bridge that
synthesizes ethernet headers (tun->bridge) and strips them in the other
direction.

OpenVPN's "--dev tap" will use a tap(4) device, which looks like a
proper ethernet device - with headers and everything, so that can
be bridged just fine.

If you have no control over the other end, you can play around with
proxy arp and routing tricks to "sort-of-bridge" tun and LAN...

(I've toyed with the idea of having a "shim ethernet layer" inside
OpenVPN to be able to have a bridge on one side and a tun-only client
on the other end - like, Android or iOS - but that was never more than
a "wouldn't it be cool...?" idea)

gert
--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany ***@greenie.muc.de
fax: +49-89-35655025 ***@net.informatik.tu-muenchen.de

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Christos Zoulas
2016-03-20 23:11:02 UTC
Permalink
Post by Emmanuel Dreyfus
Hello
I would like to bridge an OpenVPN tunnel (tun(4) based) with a vlan.
brconfig bridge4 add tun4
brconfig: add tun4: Invalid argument
Is there any hope to get this working?
From bridge_ioctl_add:
1. the mtu's must match
2. if_input needs to be ether_input
3. It needs to be able to be SIMPLEX
4. It needs to be able to be set in promiscuous mode

which ones fail?

christos


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Lloyd Parkes
2016-03-20 23:59:20 UTC
Permalink
Post by Christos Zoulas
1. the mtu's must match
2. if_input needs to be ether_input
3. It needs to be able to be SIMPLEX
4. It needs to be able to be set in promiscuous mode
which ones fail?
I would hope that #2 fails, but some of the code in the network stack seems to have interesting quirks.

Cheers,
Lloyd


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...