LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-10-2004, 05:25 PM   #1
antken
Member
 
Registered: Nov 2000
Posts: 368

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


hi,

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

Code:
iptables -t nat -A PREROUTING -p tcp -i 44.44.44.46 --dport 8080 -j DNAT --to-destination 192.168.0.201:80
now the above line works great on the default external ip address ( 44.44.44.41 ) 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, 06:51 PM   #2
g-rod
Member
 
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 192.168.0.201 -J SNAT --to-source 44.44.44.46
or masquearing the connection is OK too
Your DNAT rule should be
iptables -t nat -A PREROUTING -p tcp -d 44.44.44.46 --dport 8080 -j DNAT --to-destination 192.168.0.201:80
Not
iptables -t nat -A PREROUTING -p tcp -i 44.44.44.46 --dport 8080 -j DNAT --to-destination 192.168.0.201:80
The -i is interface option.
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:41 AM.

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