Configure OpenVpn several interfaces/ip

This forum is for general conversation and user-user networking.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
Wilo38
OpenVpn Newbie
Posts: 1
Joined: Fri Aug 17, 2018 10:08 am

Configure OpenVpn several interfaces/ip

Post by Wilo38 » Fri Aug 17, 2018 10:42 am

Hi,

Sorry for my bad english...

I'm trying to configure OpenVpn, on Debian 9, hosted by OVH, to work with several ip (failover).

For the next, I will call the main IP of the server IP_MAIN, and other ips IP_FO_1, IP_FO_2.

I added /etc/network/interfaces.d/perso.cfg :

Code: Select all

auto ens3:1
iface ens3:1 inet static
    address IP_FO_1
    netmask 255.255.255.255
    post-up /sbin/ifconfig ens3:1 IP_FO_1 netmask 255.255.255.255 broadcast IP_FO_1
    post-down /sbin/ifconfig ens3:1 down

auto ens3:2
iface ens3:2 inet static
    address IP_FO_2
    netmask 255.255.255.255
    post-up /sbin/ifconfig ens3:2 IP_FO_2 netmask 255.255.255.255 broadcast IP_FO_2
    post-down /sbin/ifconfig ens3:2 down
These interfaces works fine, I can use them with Apache and PHP.

Now, I would like to have 3 OpenVPN configurations :

1. Client use OpenVPN with IP_MAIN to connect, and reach internet with IP_MAIN outing. No problem with that, it works !

2. Client use OpenVPN with IP_FO_1 to connect, and reach internet with IP_FO_1 outing. Problem... IP_MAIN is still used in out...

3. Client use OpenVPN with IP_FO_2 to connect, and reach internet with IP_FO_2 outing. Problem... IP_MAIN is still used in out...

Can you please help me to configure my server ?

Thank you !

PS : I used wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh to install OpenVPN.

Simon Jouet
OpenVpn Newbie
Posts: 1
Joined: Thu Sep 06, 2018 10:56 am

Re: Configure OpenVpn several interfaces/ip

Post by Simon Jouet » Thu Sep 06, 2018 10:59 am

Hi Wilo38,

I was wondering if you had managed to resolve this problem? I'm running into a very similar situation right now and just came across your issue. If you managed to resolve this could you provide some details? If not is anybody able to provide some pointers on this? I've been looking a bit around but I can't seem to find much documentation on using an IP alias.

Best regards,
Simon

Post Reply