LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 08-17-2010, 02:37 PM   #1
gandrusz
LQ Newbie
 
Registered: Apr 2010
Posts: 23

Rep: Reputation: 0
Question 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?
 
Old 08-18-2010, 12:02 AM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
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
 
Old 08-18-2010, 09:09 AM   #3
gandrusz
LQ Newbie
 
Registered: Apr 2010
Posts: 23

Original Poster
Rep: Reputation: 0
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.
 
Old 08-18-2010, 11:26 AM   #4
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
I am bridging 2 networks, but only want the Bridge machine to see both networks. themrrobert Linux - Networking 1 02-17-2009 12:40 PM
Verify /etc/hosts usage and round robin in /etc/hosts MikeyCarter Linux - Software 1 06-24-2008 12:20 PM
can't restrict sshd access through hosts.allow and hosts.deny but was working earlier farhan Linux - Security 4 04-18-2008 07:41 AM
wpa_gui/wpa_supplicant does not "release" ip when changing networks BCarey Slackware 21 11-26-2007 01:33 AM
Wifi help please -- switching networks; Yast vs. hosts file costrevs Linux - Wireless Networking 1 03-24-2005 02:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 03:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration