Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Andy Lego <legoandy@gmail.com>
To: Edmundo Carmona <eantoranz@gmail.com>, netfilter@lists.netfilter.org
Subject: Re: Forward specific port to another ip
Date: Tue, 27 Dec 2005 13:36:57 -0500	[thread overview]
Message-ID: <a46d47540512271036v71e355epf1f87cbb564b2996@mail.gmail.com> (raw)
In-Reply-To: <65aa6af90512251916p6e15b2c5pe044142c92ae0797@mail.gmail.com>

Hi Edmundo,

Looks like I am doing something wrong:

root@andoria # iptables -t nat -A PREROUTING -p tcp --dport 8080 -j
DNAT --to-destination 192.168.114.100:80
root@andoria # telnet localhost 8080
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
telnet: Unable to connect to remote host: Connection refused
root@andoria # telnet 192.168.114.100 80
Trying 192.168.114.100...
Connected to a.xx.com (192.168.114.100).
Escape character is '^]'.
^]
telnet> close
Connection closed.

iptables -t nat -L                                                    
                                                 ~
Chain PREROUTING (policy ACCEPT)
target     prot opt source               destination
DNAT       tcp  --  anywhere             anywhere            tcp
dpt:webcache to:192.168.114.100:80

Is there anything else I should be doing?

Thank you.

Andy

On 12/25/05, Edmundo Carmona <eantoranz@gmail.com> wrote:
> that would be a DNAT rule on NAT PREROUTING, for starters (assuming
> we're working on a.xx.com).
>
> iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT
> --to-destination b.xx.com:80
>
> On 12/25/05, Andy Lego <legoandy@gmail.com> wrote:
> > Hi,
> >
> > I would like to forward all requests that come to system a.xx.com at
> > port 8080 to go to another system b.xx.com to port 80.
> >
> > For example, I am running a web server on system b.xx.com, but I want
> > it to look like it is running on a.xx.com on different port.
> >
> > Also, I want to do this on a.xx.com only, without touching the
> > firewall or b.xx.com.
> >
> > Any ideas?
> >
> > Thank you.
> >
> >   Andy
> >
> >
>


--
http://legoandy.com


  parent reply	other threads:[~2005-12-27 18:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-25 18:43 Forward specific port to another ip Andy Lego
     [not found] ` <65aa6af90512251916p6e15b2c5pe044142c92ae0797@mail.gmail.com>
2005-12-27 18:36   ` Andy Lego [this message]
2005-12-27 18:51     ` Andy Lego
2005-12-27 19:11     ` Richard Pickett
     [not found]       ` <65aa6af90512271254rb572182o3309a5f415b1256d@mail.gmail.com>
2005-12-27 20:55         ` Edmundo Carmona
2005-12-28  5:13           ` Richard Pickett
2005-12-28 13:20             ` Edmundo Carmona

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a46d47540512271036v71e355epf1f87cbb564b2996@mail.gmail.com \
    --to=legoandy@gmail.com \
    --cc=eantoranz@gmail.com \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox