View the Most Wanted LQ Wiki articles.
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 07-11-2003, 02:31 AM   #1
LQ Newbie
Registered: Jul 2003
Location: Brazil - São Paulo
Distribution: slackware
Posts: 2

Rep: Reputation: 0
Post Redirect port with iptables

Hi all,

Here is my situation: i have a slackware box running a virtual machine under vmware. The virtual machine is a Windows 2003 server. In my server, i have 2 devices: eth0, vith the static/valid ip adress, and eth1 with my local network adress ( The virtual machine gets the following ip adress: and can ping the internet (i configure the virtual machine bridged with eth1, no problem).

What i want: redirect the traffic from port 80 of my linux (eth0, valid adress) to the virtual machine (

I've tryed the following solution:

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j DNAT --to
iptables -t nat -A POSTROUTING -s -p tcp -j SNAT --to <my valid ip adress>

But it doesn't work. I see this in the /proc/net/ip_conntrack :

tcp 6 111 SYN_SENT src=<ip_of_my_remote_box> dst=<ip_of_eth0(valid adress)> sport=42560 dport=80 [UNREPLIED] src= dst=<ip_of_my_remote_box> sport=80 dport=42560 use=1

Please... who can welp me? I spent 2 days in this problem

Thanx in advance... and sorry for the bad english

André Aun


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 redirect _ben_deb_ Linux - Networking 7 11-13-2004 06:06 AM
Outside FTP Port 21 redirect to different port inside LAN??? hendrixx Linux - Security 5 06-05-2004 07:42 PM
Problem with iptables port redirect and rh9 zkn Linux - Networking 0 05-05-2004 05:34 PM
iptables redirect slack Linux - Networking 0 06-17-2002 05:04 AM
iptables redirect bhartnett Linux - Networking 1 09-26-2001 10:11 PM

All times are GMT -5. The time now is 10:35 PM.

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