Skip to contentSkip to conversation

TUN Server: Suggested IP allocation change

Openvpn-devel die pes 3 participants 3 messages Nov 14, 2004

lore
Share & tools
lore

die pes

author
#0 lore raw

Hi I tried Openvpn and it worked great, hardest part is setting up the pki.

Problem with openvpn routing.

Currently for IP routing using the tun device, each client is assigned a /30 subnet. This does not make sence as the server has only a single IP. (Could work if individual interface created on server with unique IP for each)

I suggest we simplify it into a point to multipoint setup with /32 mask per client.

This will reduce IP usage by 400% and simplify setup.

E.G. server 10.1.0.0 255.255.255.0
Server:
ifconfig tun0 10.1.0.1 netmask 255.255.255.255 -broadcast -multicast pointopoint 0.0.0.0 ip route add 10.1.0.0/24 dev tun0

Client1:
ifconfig tun0 10.1.0.2 netmask 255.255.255.255 -broadcast -multicast pointopoint 10.1.0.1

Client2:
ifconfig tun0 10.1.0.3 netmask 255.255.255.255 -broadcast -multicast pointopoint 10.1.0.1

For security, and to enforce iptables rules, the server should not allow ip traffic to or from wrong IP for each client tunnel. The IP info will also be used to decide witch tunnel to use.

If clients are to talk to each other directly, the host can route traffic in and out on the tun interface after applying iptables rules.

It is just a suggestion.

Regards,
Pieter

_________________________________________________________________
Save your chats with a single keystroke - get MSN Toolbar! http://messenger.msn.co.za?DI=1054&XAPID=2532

#1 lore raw

Hi!

Quoted 4 lines

Currently for IP routing using the tun device, each client is assigned a /30 subnet. This does not make sence as the server has only a single IP. (Could work if individual interface created on server with unique IP for each)

I also suggested this, but there are drawbacks as James wrote in some mails on this list.
The Windows TAP/TUN driver is a TAP driver, which cannot do real Point- to-Point operation. TUN under Windows is just a emulation on a TAP device.

Quoted 3 lines

I suggest we simplify it into a point to multipoint setup with /32 mask per client.
This will reduce IP usage by 400% and simplify setup.

And locks out all Windows-Clients until someone implements a real TUN- Driver for Windows.

If you do not have Windows Clients take a look at ifconfig-pool-linear Option.

Signature · 1 line
Torge Szczepanek <[email protected]...>
#2 lore raw
In reply to die pes
Quoted 7 lines · die pes

Hi I tried Openvpn and it worked great, hardest part is setting up the pki.

Problem with openvpn routing.

Currently for IP routing using the tun device, each client is assigned a /30 subnet. This does not make sence as the server has only a single IP. (Could work if individual interface created on server with unique IP for each)

I suggest we simplify it into a point to multipoint setup with /32 mask per client.

It's done this way to be compatible with windows, which does not support true PtP interfaces.

I think the new option --ifconfig-pool-linear introduced with beta12, does what you want, but you loose windows compatibility.

You could also use tap and bridging which only occupies one address per client, but then you have the drawback of the extra overhead...

Signature · 4 lines
_________________________________________________________
Mathias Sundman              (^)   ASCII Ribbon Campaign
NILINGS AB                    X    NO HTML/RTF in e-mail
Tel: +46-(0)8-666 32 28      / \   NO Word docs in e-mail