Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 10-06-2005, 02:52 PM   #1
Senior Member
Registered: Feb 2004
Location: lost+found
Distribution: CentOS
Posts: 1,339

Rep: Reputation: 55
How can I forward all traffic to to using IPtables?

How can I forward all traffic to to using IPtables?
Old 10-06-2005, 03:19 PM   #2
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
The general rule for port forwarding with iptables is:

iptables -t nat -I PREROUTING -p <protocol> -d <destination IP> --dport <destination port> -j DNAT --to-destination <destination IP>:<destination port>

So, for example:

iptables -t nat -I PREROUTING -p tcp -d --dport 80 -j DNAT --to-destination

Last edited by macemoneta; 10-06-2005 at 03:33 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables forward traffic alaios Linux - Networking 1 09-28-2005 04:43 AM
Allowing connections to port 8080 in iptables apache363 Linux - Software 1 10-12-2004 02:14 PM
Simple iptables forwarding 8080 -> 80 gstarrett Linux - Networking 3 03-17-2004 12:52 PM
Trying to forward web traffic through firewall w/ IPTABLES ShinySteelRobot Linux - Networking 6 08-17-2003 05:43 PM
Please help me finish setup IPTABLES,all I need is to forward port 8080 pembo13 Linux - Networking 4 07-18-2003 10:28 PM

All times are GMT -5. The time now is 12:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration