Page 1 of 1

Multiple IPs on a single VPN?

Posted: Sun Nov 23, 2014 11:44 pm
by NumaPlay
I have a VPS server that has multiple IP addresses attached with it. How can I set the VPN to work with different IPs?

Re: Multiple IPs on a single VPN?

Posted: Mon Nov 24, 2014 3:32 pm
by dajhorn
SoftEther does not implement interface or address binding like other VPN implementations. You can get a better answer by specifically describing what you want to do.

Re: Multiple IPs on a single VPN?

Posted: Tue Nov 25, 2014 2:10 pm
by NumaPlay
dajhorn wrote:
> SoftEther does not implement interface or address binding like other VPN
> implementations. You can get a better answer by specifically describing
> what you want to do.

Well my VPS has two IP addresses, lets say x.x.x.1 and x.x.x.2. When you connect to x.x.x.1 your public IP will display at x.x.x.1. However you can also connect to the VPN with x.x.x.2, but your public IP still displays as x.x.x.1. I'm wanting to make it so when you connect through the second IP (x.x.x.2) your IP addresses shows up differently.

Re: Multiple IPs on a single VPN?

Posted: Tue Nov 25, 2014 6:45 pm
by dajhorn
SoftEther lacks an easy option for the behavior that you want.

If you actually need strict IP binding, then you must run more than one instance of the SoftEther daemon using wrappers or containers.

Alternatively, if you want particular users to use particular IP addresses for outbound traffic, then group users into separate virtual hubs, bridge those virtual hubs into separate tap interfaces, and use something like dnsmasq to route the traffic according to the originating tap interface.

Re: Multiple IPs on a single VPN?

Posted: Sun Nov 30, 2014 9:25 pm
by mpankov
Hi,

I am trying to achieve the same thing. If I have 2 ip addresses I am able to create 2 virtual hubs and use l2 bridge to bridge them to 2 tap interfaces and use dnsmasq and iptables to nat the two interfaces to the two different ips. The only problem left though is that I want to have the same users on both hubs (they are actually radius users), but give them the oportunity to choose the outgoing ip based on the ip they connect to. So I cannot figure out a way to distinguish the two hubs (or two instances) to bind each one to different ip address. I have read the docs and old forum posts where there were suggestions to use wrappers (particularly authbind) to implement interface binding, but I cannot see how this will help to achieve the two hubs (or two instances) to bind to two different addresses on the same interface. Can someone help?

Thanks.

Re: Multiple IPs on a single VPN?

Posted: Mon Dec 01, 2014 8:17 am
by Nemesiz
Run Softether in user mode and configure iptables.

More info http://arstechnica.com/civis/viewtopic. ... &t=1195455

Re: Multiple IPs on a single VPN?

Posted: Mon Dec 01, 2014 8:42 am
by mpankov
Hi,

This is useful to make two instances use two outgoing ips, which however I already did using two tap interfaces which use two outgoing ips using iptables. My problem is I cannot bind two hubs/instances (preffer to do it with hubs, but if impossible instances are fine too) to listen to two different ips for incoming connections.

Re: Multiple IPs on a single VPN?

Posted: Mon Dec 01, 2014 10:44 am
by Nemesiz
You want to bind two instances on the same port ? Or you have problem with routing two IP? Like request are coming to IP1 but server responds from IP2 ?

Re: Multiple IPs on a single VPN?

Posted: Mon Dec 01, 2014 11:08 am
by mpankov
Hi,

I want users to be able to connect to same ports on the two ips, but when they connect to ip1 they go out from ip1 and when they connect to ip2 they go out from ip2.
If I figure out a way to make two hubs/instances listen for incoming connections on each interface I can create two bridges with two tap interfaces and set them to the two different outgoing ips with iptables (I can achieve the same with two instances). The problem is I cannot find a way to make two separate hubs/instances listen for incoming connections each one on different ips.

Re: Multiple IPs on a single VPN?

Posted: Mon Dec 01, 2014 12:19 pm
by Nemesiz
To use the same port for different instances is not possible for now because softether bind to 0.0.0.0 IP. But you can move softether deeper to vps (with private ips) then iptables can help you. Otherwise need to add some code into softether.