Map 192.168.0.10 to 127.0.0.1 on windows - windows

I need to access a SVN repository from home, that runs under the IP 192.168.0.10 in the work network.
I can establish a SSH tunnel to my localhost.
Now I have to map 192.168.0.10 in a way, that instead 127.0.0.1 is accessed.
Does anybody know a way to do this under Windows?

TortoiseSVN allows you to relocate your repository
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-relocate.html#tsvn-dug-relocate-dia-1:
If your repository has for some reason changed it's location (IP/URL). Maybe you're even stuck and can't commit and you don't want to checkout your working copy again from the new location and to move all your changed data back into the new working copy, TortoiseSVN → Relocate is the command you are looking for. It basically does very little: it scans all entries files in the .svn folder and changes the URL of the entries to the new value.
Or you can use svn command:
svn switch --relocate From_URL To_URL

When you're at work, edit your HOSTS file to have svn = 192.168.0.10; when you're at home, edit it to have svn = 127.0.0.1, and then access it, in both by using 'svn' as the server name.
Alternatively, use the "svn switch --relocate" command to change the repository location when you need to.

Can you reference the DNS name instead? You can override the IP address for a DNS name in your hosts file (C:\windows\system32\drivers\etc\hosts).

I'm not sure that's possible at all. What you could do would be to reference a DNS name instead. You can change the IP the DNS name points to using your hosts file.

edit your hosts file located at %SystemRoot%\system32\drivers\etc\

As I understand the question is that you have a subversion repository checked out on a laptop (or some other computer) that you checked out at work using the ip address 192.168.0.10, and now you're at home and want to use it.
Personally I wouldn't try any fancy network reordering (or modifying the hosts file) but just use the SSH tunnel to check out a fresh copy of the repository on the machine again. So that you'll be checking the source out from the 127.0.0.1 address. Then if you need to move changes over you could use patches between the two checked out copies. Granted it's not the most ideal solution but it will get you going quickly without messing about too much.
Though a better solution would be to convince work to allow access to the repository (with proper passwords, authentication, SSL etc) using a nicer method, say apache with dav_svn/webdav.
If they don't go for that then try and get them to provide a VPN so that you can continue to work with the repository using the work IP address.

Why don't you just access svn via 127.0.0.1? Surely this would be a better solution?
You're faced with several issues here, if I understand correctly. There's only one way you can make this work, that is to have your home machine have an address of 192.168.0.10. Then, you specify the ssh local address with 192.168.0.10 instead of 127.0.0.1.
The remote ssh connection will also by 192.168.0.10.
E.g., ssh -l work_user -L 192.168.0.10:svn:192.168.0.10:svn work_ssh_host
This syntax is possible with OpenSSH.
This is all if I understand your situation correctly.
A more elegant solution is to use OpenVPN, and route connections over the VPN.

I think I have had the same situation before, I will have to find what the exact configuration though.
You can start by looking at PuTTY Portable, it supports SSH and you can "redirect" a local IP to a remote IP.
As far as I can remember, when you run PuTTY you can:
First specify you local address and port (this will be where you will be pointing your SVN client, e.g. Tortoise)
Then go to Connection->SSH->Tunnels-> specify your source port to redirect from (same as above), then specify the destination IP and port and click add
I think that should be it, it has been a while since I have done it.

Related

Possible to create a temporary host entry on Heroku

Is it somehow possible to edit /etc/hosts on Heroku , through the buildpack or otherwise?
I have a couple of dev sites that I need to connect to that don't have DNS entries, so I need to add a couple entries to /etc/hosts.
Thanks
I am pretty sure that's not possible. However, why can't you just specify the IP of whatever host you're trying to connect to, instead of specifying a host name? Also, if you absolutely must, I suppose you could create entries in a DNS server of a domain of your own (say: mydomain.com), and then specify myhost.mydomain.com.

When debugging at a remote location, how do we use hosts file to do that?

If I use foo.my-company.com at work, then all works well, but if we fix any bug remotely, then the web server will respond with a forbidden.
I heard we can use dev1-foo.my-company.com at a remote location, and it is the same site, but if I access that, I found that all the AJAX are still done to foo.my-company.com and it won't work because it is still forbidden. It seems that "hosts file" can be used to overcome this, but how specifically?
All a hosts file can do is associate a hostname (like dev1-foo.my-company.com) to an IP address (like 10.1.1.5).
This can be enormously useful if:
Your DNS doesn't have an entry for the host you need (e.g. "dev1")
... or ..
You want to override DNS (substitute your own "dev1", e.g. for testing)
This is all TCP/IP - it has nothing directly to do with higher-level protocols like HTTP or AJAX.
'Hope that helps ..

how to setup a SVN server with collabnet subversion edge on windows server, and how to connect to it remotely using Xcode on Mac?

I am a newbie about SVN server. I've certainly used SVN to check in/out codes before, but never learned how to setup a Subversion server it up from ground up.
What I have:
Server | Windows Server 2012 Standard, Activated:
Installed Collabnet Subversion Edge,
Created a repository,
Created users and also started the server, using start button at GUI on localhost:4434/csvn/.
Client | MacOSX Mountain, with Xcode 4.5 Installed:
I have tried to add repository by using the external IP address and the repository name
like https://1.1.1.1/svn/, but as expected, it does not work and says "Host is unreachable".
I have tried to use the local hostname, no luck either. Although I did notice in their documentation, they mentioned IP address setting, but I cannot find it anywhere.
I would like to make it so that users can access and use the SVN repository remotely and locally.
I have no idea what to do, please help me. Thanks for your time!
Go back to the server for a minute. When you are configuring it, are you only using the local web browser? Have you tried accessing the server using web browser from your Mac? I would see if the Mac can reach the web gui first. Maybe you have network issues you have to resolve, such as DNS, routing or firewall.
In terms of using XCode, or any SVN Client, the URL you must enter is the URL to your repository. That will not be:
https://1.1.1.1/svn/
It will be something like:
https://1.1.1.1/svn/reposname
In the Subversion Edge web GUI if you go to the list of repositories, you will see an example checkout command next to each repository. This command shows you the URL to enter in a SVN client to reach the root of the repository. Example screenshot here:
https://ctf.open.collab.net/sf/projects/svnedge/screenshots/screens/repos/repos.png
I think I have sloved the problem. I knew I have to access the repo using my external IP address somehow, but when I tried something like, for example my IP is 1.1.1.1, when I typeed https://1.1.1.1/svn/reposname, I got a no response message.
I figured that since there are more than 1 computers on my local network, the router has to somehow direct the request to my server only, not some other machine. After some reaserch I found that port forwarding does the trick. Since apache server uses port 80 as default, just get the default gateway ip using ipconfig from CMD, then enable port forwarding for port 80, to the server's local ip address. At least I can access it using my external ip on my local network. I will try to access it remotely and see.

How to switch SVN server from one IP address to another

I recently move office and the IP address of my SVN server has changed so I can't access my SVN server. It's actually on my Mac but other people are accessing it at the moment. I am using SSH to access SVN before so the protocol I used is svn+ssh.
Supposed my current IP is [Current IP], my previous IP is [Previous IP]
I used the following command in the Terminal to relocate my SVN server but it gave me an error saying "." is not a working copy.
svn switch --relocate svn+ssh://[Previous IP]/usr/svn svn+ssh://[Current IP]/usr/svn
Which command should I use to relocate my SVN server so others can still access it?
The Subversion server tools do not care what your IP address is; since you're using svn+ssh, you only need to make sure that the SSH server is listening on the new IP address.
You can change your IP address via the System Preferences interface; select whichever interface you're configuring, change the IP address to whatever your new ISP has instructed you to use, and go from there. (It might be easier to reboot the computer than restart all the running services.)

How do I get bind to use the DHCP dns for lookup?

I've got XAMPP setup on my laptop (OSX 10.6) for dev, and I wanted to use VirtualDocumentRoot so that I could do *.localhost and it would automap to the folder under my sites directory. I've got this all set up fine, and it works great, but when I got to work today, I found an issue with the way our LAN handles DNS.
Long story short, instead of checking the LAN DNS server for local domains, it goes out to the root. Is there a way to get bind to check the DHCP supplied DNS server for addresses it's not responsible for? Or alternatively, is there a way to get my os to use the DHCP DNS server first, and then fall back to the local with minimal performance hit?
Thanks!
I'm using Linux Arch, but as MacOSX is based on some *nix system - may this ideas helps you:
Take a look at the file /etc/resolv.conf. In my setup this file is automatically generated by NetworkManager.
This document writes about ways to update /etc/resolv.conf when dhcpcd, NetworkManager or dhclient is used: https://wiki.archlinux.org/index.php/Dnsmasq#DHCP_Setup
In this way you do just prepend the local dns before the dhcp's dns (or static if you're switching to a static configuration). Make sure you remove all forwarders from your dns-server.
If macos does not use them, may this workaround gives you a hint, even if it's very limited:
Add a global name-server (like google's one 8.8.8.8) to your dns-server's list of forwarders.

Resources