1

I have an SCM server connected to my office LAN which runs the SCM tools like git, svn, etc. The office router has been configured with 'Port Forwarding' so that the SCM server can be accessed through the public (outside) IP from home, outside, etc. When at office, I can access the SCM server using the local IP address. But when at home, I need to use the port-forward-IP to access the SCM server.

I feel cumbersome to deal with two IP address. Now, is there way to access the SCM server using just one IP address seamlessly irrespective of my location.

1
  • Not until the world moves to IPv6.
    – Keith
    Apr 30, 2012 at 7:37

3 Answers 3

4

If the router supports hairpin NAT, then yes, just use the public IP from everywhere.

If not, then no. From the outside, you must use the inside IP to get from the outside to the inside. From the inside, you cannot use the outside IP because it's only valid from the outside. So there is no single IP you can use from anywhere.

3

Your /etc/hosts file can have name,ip pairs.

So, add:

myscm internal.i.p.address
myscm external.i.p.address

in your /etc/hosts file and then when you try to resolve by the name (myscm), it will automatically be resolved. However, this is cheating and there may be a better way to retain DNS addresses across networks.

1
  • 1
    Host entries are in the other order (IP then host name(s))
    – Mat
    Apr 30, 2012 at 12:04
2

It might be possible by using the fact that different DNS servers will be used from inside and outside of the office network. If you configure the DNS server inside your office network to serve an internal IP-address and an external DNS server to serve an external IP-address, your laptops should in theory be able to use the DNS-name of the SCM server seamlessly from both inside and outside of the office network.

Caveat: I am not sure whether overloading a DNS-name in this fashion will cause some kind of conflict.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .