Re: Forward specific port to another ip

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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@xxxxxxxxx> 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



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux