Visit Jeremy's Blog.
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 02-10-2004, 06:25 PM   #1
Registered: Nov 2000
Posts: 368

Rep: Reputation: Disabled
port forwarding does not work on additional ip addresses


i am probably missing something really stupid but...

i have just added an additional ip address to my external interface ( yes my isp knows about the ip address and i have had another machine on it before ).

my system has assiged the interface name eth0 : 0

( the spaces are to prevent a smiley poping up )

for some reason, the port forwarding is not working at all on any virtual interface i used the following line to add in the port forwarding:
( i have changed the external ip address

iptables -t nat -A PREROUTING -p tcp -i --dport 8080 -j DNAT --to-destination
now the above line works great on the default external ip address ( ) but fails on the additional addresses. i have set this up before but cannot remember how, or what was changed at the time.
and it would be good to have it all written down too

does anyone have any ideas as to what is wrong?

i have only the basic stuff in my iptables ( set up for NAT )
Old 02-10-2004, 07:51 PM   #2
Registered: Dec 2003
Location: Long Island, NY USA
Distribution: RedHat, SUSE
Posts: 336

Rep: Reputation: 30
Don't create a virtual interface just bind additional address to the NIC with
ip add addr add <ip> dev <device>;
Are you SNAT the connection on the way out?
iptables -t nat -A POSTROUTING -p tcp -s -J SNAT --to-source
or masquearing the connection is OK too
Your DNAT rule should be
iptables -t nat -A PREROUTING -p tcp -d --dport 8080 -j DNAT --to-destination
iptables -t nat -A PREROUTING -p tcp -i --dport 8080 -j DNAT --to-destination
The -i is interface option.


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
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 08:35 PM
Port forwarding simply won't work.. RoaCh Of DisCor Linux - Hardware 9 12-23-2004 06:07 PM
Port Forwarding does NOT work! The Pentium Guy Linux - Networking 4 10-31-2004 08:40 PM
Server doesn't work with port forwarding enables Dawyea Linux - Networking 7 06-19-2004 10:57 AM
Port forwarding does not work! philipina Linux - Networking 2 03-03-2004 03:15 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:41 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
Open Source Consulting | Domain Registration