Using internal services via external IP address - Networking

This is a discussion on Using internal services via external IP address - Networking ; 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 ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Using internal services via external IP address

  1. Using internal services via external IP address

    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


  2. Re: Using internal services via external IP address

    Scottatron 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

    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

  3. Re: Using internal services via external IP address

    On May 1, 5:50 pm, Scottatron 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 to Thread