Networking Forums

Networking Forums > Computer Networking > Linux Networking > Using internal services via external IP address

Reply
Thread Tools Display Modes

Using internal services via external IP address

 
 
Scottatron
Guest
Posts: n/a

 
      05-02-2007, 01:50 AM
I'm having an issue with my ADSL router and port forwarding. I
currently have an internal server running a few services (let's call
this box SERVER1). I also have an ADSL router, with a static IP
address and port fowarding configured to allow the services on SERVER1
to be accessed externally via SERVER1.MYDOMAIN.COM.

This all works perfectly when I'm outside my local network, however
when I'm on my local network and I try to access SERVER1 via
SERVER1.MYDOMAIN.COM, my router is not forwarding the connection on to
SERVER1 and is instead trying to serve the connection itself.

A traceroute example looks like this

~$ traceroute SERVER1.MYDOMAIN.COM
traceroute to SERVER1.MYDOMAIN.COM (XXX.XXX.XXX.XXX), 64 hops max, 40
byte packets
1 YYY.YYY.YYY.YYY (YYY.YYY.YYY.YYY) 1.748 ms 1.202 ms 1.206 ms
2 YYY.YYY.YYY.YYY (YYY.YYY.YYY.YYY) 1.245 ms 1.374 ms 1.232 ms

where YYY.YYY.YYY.YYY is the IP address of my router.

Is there a way to force my router to apply the port forwarding rules
when the request comes from the internal network? I realise that I
could resolve this by setting up a local DNS server, but would much
prefer to sort it out via the router if possible.

Any help would be much appreciated.

Thanks
Scott

 
Reply With Quote
 
 
 
 
Clifford Kite
Guest
Posts: n/a

 
      05-03-2007, 08:46 PM
Scottatron <(E-Mail Removed)> wrote:
> I'm having an issue with my ADSL router and port forwarding. I
> currently have an internal server running a few services (let's call
> this box SERVER1). I also have an ADSL router, with a static IP
> address and port fowarding configured to allow the services on SERVER1
> to be accessed externally via SERVER1.MYDOMAIN.COM.


> This all works perfectly when I'm outside my local network, however
> when I'm on my local network and I try to access SERVER1 via
> SERVER1.MYDOMAIN.COM, my router is not forwarding the connection on to
> SERVER1 and is instead trying to serve the connection itself.


> A traceroute example looks like this


> ~$ traceroute SERVER1.MYDOMAIN.COM
> traceroute to SERVER1.MYDOMAIN.COM (XXX.XXX.XXX.XXX), 64 hops max, 40
> byte packets
> 1 YYY.YYY.YYY.YYY (YYY.YYY.YYY.YYY) 1.748 ms 1.202 ms 1.206 ms
> 2 YYY.YYY.YYY.YYY (YYY.YYY.YYY.YYY) 1.245 ms 1.374 ms 1.232 ms


> where YYY.YYY.YYY.YYY is the IP address of my router.


> Is there a way to force my router to apply the port forwarding rules
> when the request comes from the internal network? I realise that I
> could resolve this by setting up a local DNS server, but would much
> prefer to sort it out via the router if possible.


Below is a suggested solution to a similar problem posted not long ago.
You might try it if your router uses iptables. It looks reasonable to
me but I'm not an expert.

On the router add

iptables POSTROUTING -s 192.168.10.0/24 -d 192.168.10.20 \
-p tcp -m tcp --dport 8080 -j SNAT --to <router_lan_address>

but substitute your LAN and port specifications for the ones above and
replace 192.168.10.20 with the SERVER1 LAN address.

> Any help would be much appreciated.


> Thanks
> Scott


--
Clifford Kite
 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      05-04-2007, 12:51 AM
On May 1, 5:50 pm, Scottatron <scottat...@gmail.com> wrote:
> I'm having an issue with my ADSL router and port forwarding. I

[snip]
> Is there a way to force my router to apply the port forwarding rules
> when the request comes from the internal network? I realise that I
> could resolve this by setting up a local DNS server, but would much
> prefer to sort it out via the router if possible.


Is the router running Linux? If not, I can't imagine how anyone could
help you without knowing what type of router it is. Many cheap routers
only apply port forwarding rules to traffic that comes in from the WAN
and there's nothing you can do about it.

DS

 
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
Internal to External to Internal Routing. tc Windows Networking 3 10-27-2008 11:55 PM
Best Wi, internal or external? Derrick Fawsitt Broadband 3 11-05-2005 03:01 AM
internal and external dns Tom Windows Networking 1 07-29-2005 03:33 PM
Internal vs External Web Access Darrell Martin Windows Networking 1 05-27-2005 03:31 PM
DNS - Internal vs. External JR Windows Networking 1 02-05-2004 03:03 AM



1 2 3 4 5 6 7 8 9 10 11