Is it possible to assign different ip numbers to different openvpn interfaces on server (Like in PPTPD):

Server PC i-face-s:
tun0: inet peer
tun1: inet peer

Client 1 PC i-face-s:
tun_client1 inet peer

Client 2 PC i-face-s:
tun_client2 inet peer

I tried this: /etc/openvpn/server.conf:

dev tun
topology p2p
ifconfig-pool-persist ipp.txt 0
client-config-dir ccd



And on client all works:

19: tun_client1: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1300 qdisc fq_codel state UNKNOWN group default qlen 100
    inet peer scope global tun_client1
       valid_lft forever preferred_lft forever

But on server ip addresses not valid and ping to dont works:

1150: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 100
    inet peer scope global tun0
  • I guess the only solution would be to run multiple OpenVPN instances on the server. But maybe you should explain what problem you are trying to solve. – Oliver Aug 7 '15 at 10:08
  • the problem is in that there are no ping from server to, and can't ping from client, I guess the reason is uncorrect ip's on servers tun0 interface, it should corespond to client ip's. – user3479125 Aug 7 '15 at 10:11
  • Yes, but what's the reason you want multiple tun interfaces on the server? OpenVPN is not PPTP. – Oliver Aug 7 '15 at 10:14
  • I want to allow 2 connections from one client to one server in general, if use subnet topology , there is issue when 2 routes with same network exists via different i-face-s – user3479125 Aug 7 '15 at 11:10

Solved using 2 instances of openvpn and subnet topology. It was enough copy server.conf to server1.conf, change port and server's ip range and also rename some files which clashes with server.conf (logs etc). When service restarts it automatically creates instance of openvpn for each config.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.