Networking Forums

Networking Forums > Computer Networking > Linux Networking > Redirecting a port too another machine using iptables...

Reply
Thread Tools Display Modes

Redirecting a port too another machine using iptables...

 
 
Victor Cappuccio
Guest
Posts: n/a

 
      06-07-2004, 03:24 PM
Hello pls sorry for this post

Redirecting a port too another machine using iptables...

iptables -t nat -A PREROUTING -p tcp -i eth0 -d <firewall-ip> --dport
2222 -j DNAT --to <internal-ip>:22iptables -A FORWARD -p tcp -i eth0
-d <internal-ip> --dport 22 -j ACCEPT

Regards
Victor Cappuccio
 
Reply With Quote
 
 
 
 
Cameron Kerr
Guest
Posts: n/a

 
      06-07-2004, 09:21 PM
Victor Cappuccio <(E-Mail Removed)> wrote:

> Redirecting a port too another machine using iptables...


> iptables -t nat -A PREROUTING -p tcp -i eth0 -d <firewall-ip> --dport
> 2222 -j DNAT --to <internal-ip>:22


> iptables -A FORWARD -p tcp -i eth0 -d <internal-ip> --dport 22 -j ACCEPT


Do you actually have a question?

What you've listed as basic port-forwarding, and is only really valid
when going through a NAT. If you really want to redirect a port to
another machine without going through a NAT (such a when you have a
transparent proxy set up on a machine that is not the firewall), then I
suggest you have a look at the Transparent Proxy HOWTO for how to do
such a thing.

--
Cameron Kerr
(E-Mail Removed) : http://nzgeeks.org/cameron/
Empowered by Perl!
 
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
iptables: redirecting an outgoing connection to another machine bl8n8r Linux Networking 1 06-12-2007 02:23 AM
netfilter: Redirecting incoming udp packets to other port muruga Linux Networking 0 12-11-2006 04:56 AM
IP Alias & IPtables, redirecting outbound traffic out specific interfaces paul.groth@gmail.com Linux Networking 1 05-09-2006 05:45 AM
Iptables - Redirecting packet to different IP Bartosz Wegrzyn Linux Networking 2 01-14-2004 02:07 AM
iptables: redirecting packets inside a firewall pete@mynix.org Linux Networking 3 09-04-2003 08:06 AM



1 2 3 4 5 6 7 8 9 10 11