[lug] NAT, Linux, and Hostnames

The Matt thompsma at colorado.edu
Thu Feb 19 23:17:13 MST 2004


Folks, if you can bear with me on this, I hope you can understand what
I'm asking.  Currently, I connect to my ISP through Transparent Bridging
and it dynamically assigns me an IP address.  Thus, networking is pretty
easy.

But, last night, I installed a new modem, and it was first set up using
NAT and its own DHCP server.  Here's the problem, though.  When I
started up Fedora Core 1, instead of seeing that my hostname was
home-dhcp6-xxx.colorado.edu (corresponding to 198.11.22.xxx), I only saw
"localhost.localdomain". The reason, of course, was that ifconfig was
showing my inet addr as 192.168.0.5, one of its NAT addresses.  This led
to may problems, such as ssh/scp didn't work as far as I could tell. 
That is I could ssh out, but I couldn't get in!

So, I'm wondering, how can you do this?  I mean, say I was NAT'd behind
the modem/gateway.  How can I ssh into the computer if I don't know it's
DNS name or IP address?

Another way to put it is, is there a way for Linux to resolve the
"correct" IP address that the modem got (the 192.168.0.xxx), resolve the
name for it (home-dhcp6-xxx) and apply that to my computer (so that
running hostname returns home-dhcp6-xxx.colorado.edu and dnsdomainname
colorado.edu rather than localhost.localdomain and localdomain).  That
way, I could "ssh home-dhcp6-xxx.colorado.edu" and all would work.  I
know for a fact that Fedora Core 1 doesn't do this by default, because
it didn't work.

Is there a way to do this, or am I going to have to start looking for an
ISP that can assign me a static IP (which my current one doesn't)
-- 
I am a theoretical chemist.  Fear me!
 Matt Thompson -- http://ucsub.colorado.edu/~thompsma/
 440 UCB, Boulder, CO  80309-0440
 JILA A510, 303-492-4662




More information about the LUG mailing list