Skip to contentSkip to conversation

centralized filtering

Openvpn-devel Peter Warasin 1 participant 2 messages Jul 23, 2007 – Jul 26, 2007

lore
Share & tools
lore
#0 lore raw

hi guys

Is there a possibility to configure openvpn server in order to push to it's clients a routing constellation in a manner that every traffic from a vpn endpoint to another vpn endpoint must pass the tap device on the openvpn server?

I have an openvpn (2.0) server and several clients which connect to it.

This is the relevant part of the server configuration:
-------------------------
dev tap1
client-to-client
server-bridge 10.0.0.1 255.255.255.0 10.0.0.160 10.0.0.180 push "route-gateway 10.0.0.1"
-------------------------

Since this pushes the following to the clients:
-------------------------
ip link set dev tap2 up
ip addr add dev tap2 10.0.0.x/24 broadcast 10.0.0.255
-------------------------

traffic from one endpoint to another will never pass the tap1 device on the server, but go directly.

Now i would like to filter traffic between the both endpoints, but can do it only if the traffic passes the tap device and so also netfilter.

Manually i am able to set this up:
-------------------------
ip route add 10.0.0.1/32 dev tap2
ip route add 10.0.0.x/32 dev tap2
ip route add 10.0.0.0/24 via 10.0.0.1
-------------------------

But i would like to push those routes from the server to the client. I see no possibility to achieve this. Did i miss something or is this not possible at all?

I tried
-------------------------
ifconfig 10.0.0.1 255.255.255.0 ifconfig-pool 10.0.0.160 10.0.0.180 255.255.255.255 push "route 10.0.0.0/24"
push "route-gateway 10.8.0.1"
-------------------------

but so certainly the hostroute which directs traffic for the vpn_gateway 10.0.0.1 to the clients tap device will not be created and thus route 10.0.0.0/24 will not be inserted because it's gateway is unknown.

Is there no possibility to push this type of config?

I would need something like this:
push "route 10.0.0.1 0.0.0.0 0 client_device", which then explodes to ip route add 10.0.0.1/32 dev client_device.

I thought about to patch this in (and i will, if there is no other possibility), but since our customers like to have the choice to use the original openvpn client from the openvpn.net page it is not a good solution and i would prefer if there is a solution which i did not see yet :)

Hope for some pointers in the right direction and
thank you in advance by now.

peter

Signature · 5 lines
:: e n d i a n
:: open source - open minds

:: peter warasin
:: http://www.endian.com   :: [email protected]...
#1 lore raw

hola

Quoted 4 lines · Peter Warasin
Quoted 4 lines

Is there a possibility to configure openvpn server in order to push to it's clients a routing constellation in a manner that every traffic from a vpn endpoint to another vpn endpoint must pass the tap device on the openvpn server?

For whom it may concern: I have found a workaround for this problem. (maybe there is someone with the same problem)

Use a bigger server-bridge subnet for server-bridge than the address pool you use for openvpn clients, like:

server-bridge 10.0.0.1 255.255.255.0 10.0.0.129 10.0.0.254

push a lesser subnet which fits the openvpn-pool to the clients:

push "route 10.0.0.128/25"

remove client-to-client

What happens?
The roadwarriors get the whole subnet for setting up their interface but then get a routing entry which direct traffic to the vpn_gateway for ip-addresses of the smaller subnet. each vpn endpoint is in the smaller subnet, so each connection will pass the vpn_gateway and thus also the servers tap device.

peter

Signature · 5 lines
:: e n d i a n
:: open source - open minds

:: peter warasin
:: http://www.endian.com   :: [email protected]...