Networking Forums

Networking Forums > Computer Networking > Linux Networking > address mapping problem

Reply
Thread Tools Display Modes

address mapping problem

 
 
Mochuelo
Guest
Posts: n/a

 
      05-11-2005, 01:37 PM
Hi,

I believe this must have been asked several times, but I can't find
the answer in the archives.

There is a 3Com 812 ADSL router between my computer and internet.
Recently, I bought a domain name (let's call it test.com (NOT the real
case)). I made personal.test.com to point to my IP public address,
which is 80.35.x.x. My private IP address is 192.161.0.10. My PC has a
web server listening at port 12000, and the router maps 80.35.x.x:80
to 192.161.0.10:12000.

When someone external to my LAN types
http://personal.test.com/index.php in their browers, it works OK for
them. However, when, from inside my LAN, I type the same, I get an
error saying the page does not exist. If I type
http://personal.test.com, I get the configuration page of my router.

For me to test my pages, I must replace "personal.test.com" by
"localhost:12000", and then everything works. Of course, I would like
to have code that would work for everyone, independently on whether
the person browsing is inside or outside my LAN. How can I do this?

Schematically:
personal.test.com --(DNS translation)--> 80.35.x.x(:80) --(PAT in
router)--> 192.161.0.10:12000.

Thank you in advance.
Mochuelo.
 
Reply With Quote
 
 
 
 
Paul Black
Guest
Posts: n/a

 
      05-11-2005, 02:00 PM
Mochuelo wrote:
> For me to test my pages, I must replace "personal.test.com" by
> "localhost:12000", and then everything works. Of course, I would like
> to have code that would work for everyone, independently on whether
> the person browsing is inside or outside my LAN. How can I do this?


I did this by having my own DNS server inside the private network with
it's own view of DNS.

--
Paul Black mailto(E-Mail Removed)
Oxford Semiconductor Ltd http://www.oxsemi.com
25 Milton Park, Abingdon, Tel: +44 (0) 1235 824 909
Oxfordshire. OX14 4SH Fax: +44 (0) 1235 821 141
 
Reply With Quote
 
Andrew Schulman
Guest
Posts: n/a

 
      05-11-2005, 02:21 PM

> Hi,
>
> I believe this must have been asked several times, but I can't find
> the answer in the archives.
>
> There is a 3Com 812 ADSL router between my computer and internet.
> Recently, I bought a domain name (let's call it test.com (NOT the real
> case)). I made personal.test.com to point to my IP public address,
> which is 80.35.x.x. My private IP address is 192.161.0.10. My PC has a
> web server listening at port 12000, and the router maps 80.35.x.x:80
> to 192.161.0.10:12000.
>
> When someone external to my LAN types
> http://personal.test.com/index.php in their browers, it works OK for
> them. However, when, from inside my LAN, I type the same, I get an
> error saying the page does not exist. If I type
> http://personal.test.com, I get the configuration page of my router.
>
> For me to test my pages, I must replace "personal.test.com" by
> "localhost:12000", and then everything works. Of course, I would like
> to have code that would work for everyone, independently on whether
> the person browsing is inside or outside my LAN. How can I do this?


As you said, your router maps 80.35.x.x:80 to 192.161.0.10:12000. What
it doesn't do is to map 127.0.0.1:80 to 192.161.0.10:12000, or
192.161.0.10:80 to 192.161.0.10:12000. I think this is your trouble.
Within your LAN, a DNS lookup to personal.test.com is being resolved to
either 127.0.0.1 or 192.161.0.10, not 80.35.x.x. So the router doesn't
do its mapping.

From one or more of the hosts in your LAN, what does 'host
personal.test.com' say? If it isn't 80.35.x.x, then you need to do one
of several things:

(1) Adjust your LAN DNS to make personal.test.com get resolved to
80.35.x.x. Then hope that packets will get routed out through the
router's external interface, whence they would get sent back in through
that same interface, where the router would map them to
192.161.0.10:12000. Note that this isn't a very desirable solution; it
forces your LAN packets out through your external interface and back.

(2) Do the port forwarding on 192.161.0.10, instead of the router. So
the router would map personal.test.com:80 to 192.161.0.10:80, and on
192.161.0.10 you would have a rule mapping 80/tcp to 12000/tcp. That
way, you would get the same result no matter where you called to
192.161.0.10 from.

(3) Easiest of all: just run your web server on 192.161.0.10:80, and do
away with the port forwarding.

--
To reply by email, replace "deadspam.com" by "alumni.utexas.net"
 
Reply With Quote
 
Mochuelo
Guest
Posts: n/a

 
      05-11-2005, 02:45 PM
On Wed, 11 May 2005 14:21:44 GMT, Andrew Schulman
<(E-Mail Removed)> wrote:
>As you said, your router maps 80.35.x.x:80 to 192.161.0.10:12000. What
>it doesn't do is to map 127.0.0.1:80 to 192.161.0.10:12000, or
>192.161.0.10:80 to 192.161.0.10:12000. I think this is your trouble.
>Within your LAN, a DNS lookup to personal.test.com is being resolved to
>either 127.0.0.1 or 192.161.0.10, not 80.35.x.x. So the router doesn't
>do its mapping.
>
>From one or more of the hosts in your LAN, what does 'host
>personal.test.com' say? If it isn't 80.35.x.x, then you need to do one
>of several things:


No, when I ping personal.test.com from inside my LAN, I read
"80.35.x.x". That works ok. The problem, I guess (with my little
knowledge of networks) is that the router, when it receives a request
for 80.35.x.x, does different actions depending on whether the request
is outside or inside my LAN. If it is outside my LAN, PAT mapping is
applied, and my page is correctly shown. If the request for 80.35.x.x
comes from inside the LAN, the router interprets I want to configure
it, and it does not do any PAT mapping, and directly asks me for the
user and password to access the router.

>
>(1) Adjust your LAN DNS to make personal.test.com get resolved to
>80.35.x.x.


That already happens.

>Then hope that packets will get routed out through the
>router's external interface, whence they would get sent back in through
>that same interface, where the router would map them to
>192.161.0.10:12000.


That's what it is not happening.
(BTW, I made a mistake, and it is 192.168..., not 192.161...)

>Note that this isn't a very desirable solution; it
>forces your LAN packets out through your external interface and back.


I wouldn't care about this for test purposes. I just want to have one
unique code.

>(2) Do the port forwarding on 192.161.0.10, instead of the router. So
>the router would map personal.test.com:80 to 192.161.0.10:80, and on
>192.161.0.10 you would have a rule mapping 80/tcp to 12000/tcp. That
>way, you would get the same result no matter where you called to
>192.161.0.10 from.
>
>(3) Easiest of all: just run your web server on 192.161.0.10:80, and do
>away with the port forwarding.


Regarding (2) and (3): I think 192.168.0.10 (neither :80 nor :12000)
never even gets reached.

I don't believe this has not been faced by thousands of people before
me. I guess there must be an easy solution.

Thanks a lot.

 
Reply With Quote
 
Unruh
Guest
Posts: n/a

 
      05-11-2005, 03:02 PM
Mochuelo <(E-Mail Removed)> writes:

>Hi,


>I believe this must have been asked several times, but I can't find
>the answer in the archives.


>There is a 3Com 812 ADSL router between my computer and internet.
>Recently, I bought a domain name (let's call it test.com (NOT the real
>case)). I made personal.test.com to point to my IP public address,
>which is 80.35.x.x. My private IP address is 192.161.0.10. My PC has a
>web server listening at port 12000, and the router maps 80.35.x.x:80
>to 192.161.0.10:12000.


I hope not. 192.161.x.x is a public IP address. Did you mean 192.168.0.1?



>When someone external to my LAN types
>http://personal.test.com/index.php in their browers, it works OK for
>them. However, when, from inside my LAN, I type the same, I get an
>error saying the page does not exist. If I type
>http://personal.test.com, I get the configuration page of my router.


So, what does personal.test.com resolve to for you?
ping personal.test.com
list what IP address if you do it from inside?

Also you have set up your web page on port 12000 Your system sending out
http:/personal.test.com will be trying port 80.


>For me to test my pages, I must replace "personal.test.com" by
>"localhost:12000", and then everything works. Of course, I would like
>to have code that would work for everyone, independently on whether
>the person browsing is inside or outside my LAN. How can I do this?


>Schematically:
>personal.test.com --(DNS translation)--> 80.35.x.x(:80) --(PAT in
>router)--> 192.161.0.10:12000.


>Thank you in advance.
>Mochuelo.

 
Reply With Quote
 
Unruh
Guest
Posts: n/a

 
      05-11-2005, 03:15 PM
Mochuelo <(E-Mail Removed)> writes:

>On Wed, 11 May 2005 14:21:44 GMT, Andrew Schulman
><(E-Mail Removed)> wrote:
>>As you said, your router maps 80.35.x.x:80 to 192.161.0.10:12000. What
>>it doesn't do is to map 127.0.0.1:80 to 192.161.0.10:12000, or
>>192.161.0.10:80 to 192.161.0.10:12000. I think this is your trouble.
>>Within your LAN, a DNS lookup to personal.test.com is being resolved to
>>either 127.0.0.1 or 192.161.0.10, not 80.35.x.x. So the router doesn't
>>do its mapping.
>>
>>From one or more of the hosts in your LAN, what does 'host
>>personal.test.com' say? If it isn't 80.35.x.x, then you need to do one
>>of several things:


>No, when I ping personal.test.com from inside my LAN, I read
>"80.35.x.x". That works ok. The problem, I guess (with my little
>knowledge of networks) is that the router, when it receives a request
>for 80.35.x.x, does different actions depending on whether the request
>is outside or inside my LAN. If it is outside my LAN, PAT mapping is
>applied, and my page is correctly shown. If the request for 80.35.x.x
>comes from inside the LAN, the router interprets I want to configure
>it, and it does not do any PAT mapping, and directly asks me for the
>user and password to access the router.


It is very possible that it does different actions from inside than from
outside. That will be entirely up to the router software inside teh router.
Note that sending to 80.35.x.x the router will ask the external DNS server
for the route to that address, and discover that it is itself. It will
never send out the packets, but will deal with them itself. Then the
question is how does it deal with them.
I am surprised that it regards its external IP from the internal lan
as a request for its internal setup . But it will be a function of the
router. Not all routers will behave the same way.

>I don't believe this has not been faced by thousands of people before
>me. I guess there must be an easy solution.


Why would it be faced by thousands? Not that many people have your
particular router and of those that do, probably very very few want to do
what you do (access an internal computer via its external IP)




 
Reply With Quote
 
prg
Guest
Posts: n/a

 
      05-11-2005, 04:17 PM

Mochuelo wrote:
> On Wed, 11 May 2005 14:21:44 GMT, Andrew Schulman
> <(E-Mail Removed)> wrote:
> >As you said, your router maps 80.35.x.x:80 to 192.161.0.10:12000.

What
> >it doesn't do is to map 127.0.0.1:80 to 192.161.0.10:12000, or
> >192.161.0.10:80 to 192.161.0.10:12000. I think this is your

trouble.
> >Within your LAN, a DNS lookup to personal.test.com is being resolved

to
> >either 127.0.0.1 or 192.161.0.10, not 80.35.x.x. So the router

doesn't
> >do its mapping.
> >
> >From one or more of the hosts in your LAN, what does 'host
> >personal.test.com' say? If it isn't 80.35.x.x, then you need to do

one
> >of several things:

>
> No, when I ping personal.test.com from inside my LAN, I read
> "80.35.x.x". That works ok. ...


It has to work "OK" if you're to have connectivity outside your lan.
It's the IP of the router.

> ... The problem, I guess (with my little
> knowledge of networks) is that the router, when it receives a request
> for 80.35.x.x, does different actions depending on whether the

request
> is outside or inside my LAN. If it is outside my LAN, PAT mapping is
> applied, and my page is correctly shown. If the request for 80.35.x.x
> comes from inside the LAN, the router interprets I want to configure
> it, and it does not do any PAT mapping, and directly asks me for the
> user and password to access the router.


This is true. The router has an httpd running to serve up its config
page(s).

> >
> >(1) Adjust your LAN DNS to make personal.test.com get resolved to
> >80.35.x.x.

>
> That already happens.


And this is _not_ what you want to happen. _Your_ httpd is _already_
on the lan located at 192.168.0.10:12000. The 3Com box is a _hub_ on
the lan (ethernet) side. All packets are delivered to all hosts.
There is no need (and you don't want) the packets to leave the lan when
the destination is _on_ the lan.

> >Then hope that packets will get routed out through the
> >router's external interface, whence they would get sent back in

through
> >that same interface, where the router would map them to
> >192.161.0.10:12000.

>
> That's what it is not happening.
> (BTW, I made a mistake, and it is 192.168..., not 192.161...)
>
> >Note that this isn't a very desirable solution; it
> >forces your LAN packets out through your external interface and

back.
>
> I wouldn't care about this for test purposes. I just want to have one
> unique code.


If your lan has a small number of hosts, just make an entry in the
"hosts" file that resolves "personal.test.com" to 192.168.0.10 (your
web server).

If your lan is pretty large you may need a DNS server on your lan with
an entry for your web server that resolves "personal.test.com" to
192.168.0.10.

> >(2) Do the port forwarding on 192.161.0.10, instead of the router.

So
> >the router would map personal.test.com:80 to 192.161.0.10:80, and on
> >192.161.0.10 you would have a rule mapping 80/tcp to 12000/tcp.

That
> >way, you would get the same result no matter where you called to
> >192.161.0.10 from.
> >
> >(3) Easiest of all: just run your web server on 192.161.0.10:80, and

do
> >away with the port forwarding.


Either of these will work and I agree that using port 80 on your "real"
web server will make life simpler.

> Regarding (2) and (3): I think 192.168.0.10 (neither :80 nor :12000)
> never even gets reached.
>
> I don't believe this has not been faced by thousands of people before
> me. I guess there must be an easy solution.


Well, this would only occur for people running a web server on their
lan (with a private IP) that is exposed to the public via port
forwarding on the 3Com router.

In fact, without port forwarding, "outsiders" _may_ be able to pull up
your router's config page. To avoid this, the internals of these boxes
likely have a means to deliver the config page _only_ from a request
from the lan ports.

In any case, your basic problem (name to IP resolution) has two
"components". The outside world will resolve "personal.test.com" to
80.35.x.x (the IP of your router which will be forwarded) while your
lan hosts need to resolve "personal.test.com" to 192.168.0.10 (the IP
of your "directly connected" web server).

If you decide you need/want a DNS server on your lan, you might want to
look at dnsmasq (some Linux distros include it):
http://thekelleys.org.uk/dnsmasq/doc.html

hth,
prg
email above disabled

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mapping Different IP Address Range Nbene Windows Networking 5 10-23-2008 05:06 PM
IPConfig & mapping problem systemguy Wireless Networks 1 01-15-2008 02:13 AM
port to mac address mapping using OID values swaroopvincent@gmail.com Wireless Internet 1 03-01-2006 09:26 PM
Mapping problem Dmitry Demchuk Windows Networking 2 08-01-2005 08:35 AM
Please Help -- Mapping problem ray Windows Networking 0 12-04-2003 06:49 AM



1 2 3 4 5 6 7 8 9 10 11