Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm not sure if my solutions lies in openvpn routing or iptables, but if i explain what i'd like to do, maybe some can help.

I have two open vpn daemons running on different ports. One on 1194, with server ip and one on 1195, ip address I am using two so I can lock down server port access based on the interface (tun0 and tun1) using iptables. This is all working fine, with the first instance supplying services for trusted users and the other locked down to port 80 for less trusted users. I'm running GitLab on nginx which I need to provide for both sets of people.

Now the problem is inside gitlab I have configured it to show all the git links as git:// etc. These don't make sense to people connecting on the second vpn daemon where the server will be

So, is there a clever use of route in the server configs that will allow the subnet talk to the server as Or can I create a different common ip address for the server that both can use? Or am I in completely the wrong area and I should be considering some iptables routing / masquerading?

Any ideas?

share|improve this question

You should "create" another network like e.g. 192.168. 0.0/24 and put your server in this network. Enable ip_forward if needed.

share|improve this answer
The server already has an internal address of on it's eth0 adaptor, but I didn't want to create a route to this subnet from the vpn due to the likely conflicts with address ranges on the client side. Is this what you meant? – microwavesafe Jul 6 '13 at 9:47
You could use any other net too, that was just an example ;) – krissi Jul 6 '13 at 11:14

This turned out to be easier than I thought.

I added

push "route"

So from the 2nd vpn daemon I can use both or as the server address, so the links in GitLab will work.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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