LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Wireless Networking (https://www.linuxquestions.org/questions/linux-wireless-networking-41/)
-   -   Different hosts for different wpa_supplicant networks (https://www.linuxquestions.org/questions/linux-wireless-networking-41/different-hosts-for-different-wpa_supplicant-networks-826837/)

gandrusz 08-17-2010 02:37 PM

Different hosts for different wpa_supplicant networks
 
Hi,

I am using my laptop both from home and from outside. I have a svn server configured at home and I have it checked out on the laptop. I would like to be able to connect to it both from inside the home network (which is behind a router using standard NAT) and from outside (the router forwards the correct port to the svn server). So I need the name of the machine to resolve to different IP addresses depending on which wireless network I am connected to. I am using wpa_supplicant configured manually. Can I set up an action to copy /etc/hosts after a successful connection (and how)? Or is there a better way?

sag47 08-18-2010 12:02 AM

If you want to access your server, which is behind a NAT, from the internet then the only way to do it is...

VPN (virtual private network) on your router. This may mean you have to set a up a VPN server depending on the router you have.

Or if you have a *nix/web server out in the internet then tunnel to it using reverse ssh.

Keywords to look up: howto vpn linux, howto reverse ssh

gandrusz 08-18-2010 09:09 AM

Hi sag47, I have already configured my router to forward port 443 to the correct machine, so I am able to access the repository from outside. What I am trying to achieve is to be able to have one working copy which will work both from outside and from inside. The bit I got stuck at is that I need to connect to different IP address in these both cases.

sag47 08-18-2010 11:26 AM

Reverse SSH through port 22 should be able to accomplish this (connecting to another computer on your network through a computer on your network).

Oh wait. I think I understand you're dilemma now.
  • You have to go into the settings of your router.
  • Go to the router status page.
  • See the number of your WAN IP address.

Once you get that you can access your router from the public domain so long as you ISP isn't heavily firewalling you and blocking your IP from the internet with their own NAT.


All times are GMT -5. The time now is 10:09 PM.