janmottl
My customer has more web servers running on one Ubuntu server. He would like to access from one Windons PC each web server via different IP. That means a possibility use multiple IP adresses to access one VPN Server. The main reason is to prevent sessin cookie troubles.
Is it please possible? Thanks
Example:
10.8.0.1 production web server, port 80
10.8.0.2 development web server, port 8080
web servers are on the same linux server
dortdort
if you find some answer please let me know!
thank you
SpudHead
I think you would need to add more 10.8.0.x addresses to the server's tun/tap adapter after OpenVPN has started up (can be put in UP script).
e.g.
ip addr add 10.8.0.2/24 dev tun0
ip addr add 10.8.0.3/24 dev tun0
etc..
You'd need to also configure the IP pool to start from a later IP, so if your additional IPs go up to 10.8.0.4 you'd need to start your pool at 10.8.0.5 using ifconfig-pool (requires replacing the server directive with its expansion, check the OpenVPN reference) . Probably also might need to restart the webservers after OpenVPN has started so they will bind to the new IPs.
An easier (but hackier) way would be to add the extra IPs to the end of the pool
e.g.
ip addr add 10.8.0.253/24 dev tun0
ip addr add 10.8.0.252/24 dev tun0
etc..
If there's no danger of ever getting over 250 clients on the VPN the pool will never get that high and it'll save you having to mess with the server directives in the config.
You could also add a dummy interface on the server and add IPs on a different subnet to that. (requires ipv4 forwarding to be active on the server and the client to be pushed a route to that subnet)
e.g.
ip link add vf0 type dummy
ip addr add 10.8.1.1/24 dev vf0
ip addr add 10.8.1.2/24 dev vf0
EDIT:
Thinking about it, it's not even necessary to make a multi-ip setup. All your customer need do is add different hostnames to their hosts file to resolve to the same IP
e.g.
main.server1.example 10.8.0.1
demo.server2.example 10.8.0.1
test.server3.example 10.8.0.1
Then just access the webservers via the hostname.
h ttp://main.server1.example/
h ttp://demo.server2.example:8080/
h ttp://test.server3.example:8888
etc..
The browser will then treat each one as separate and not pass any meta data between them so long as you don't get the ports mixed up.