Hottest Free Downloads - DownloadPipe.com Over 197,000 downloads! Bookmark Now!
DownloadPipe.com - New Downloads Every Minute
 SEARCH:
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Forwarding an IP from external to internal

 
   Linux (Home) -> Networking RSS
Next:  Unable to mount root fs on 00:ff  
Author Message
Chris Cameron

External


Since: Jun 21, 2003
Posts: 1



(Msg. 1) Posted: Sat Jun 21, 2003 11:10 pm
Post subject: Forwarding an IP from external to internal
Archived from groups: comp>os>linux>networking (more info?)

I'm looking to forward traffic going to an external IP address to a local
IP address.

The rule I found to try this with is: iptables -t nat -A PREROUTING -p tcp
-d 207.176.140.17 -j DNAT --to-destination 192.168.2.33


Now I know very little about IPTables, but when I run this and then try to
connect to 207.176.140.17 it just goes to the machine the external IP is
on (I can tell cause one is running a webserver, and the other isn't).

Is there a preamble to this rule I missed? Have I done something
completely wrong?

Currently, IPTables just passes all traffic by default with no other rules.


Any help would be appreciated.


Chris
Back to top
Login to vote
Horst Knobloch

External


Since: Jun 23, 2003
Posts: 22



(Msg. 2) Posted: Mon Jun 23, 2003 2:54 pm
Post subject: Re: Forwarding an IP from external to internal [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Sunday 22 June 2003 01:10 , Chris Cameron wrote:

> I'm looking to forward traffic going to an external IP address to
> a local IP address.
>
> The rule I found to try this with is: iptables -t nat -A PREROUTING -p
> tcp -d 207.176.140.17 -j DNAT --to-destination 192.168.2.33
>
>
> Now I know very little about IPTables, but when I run this and then try
> to connect to 207.176.140.17 it just goes to the machine the external IP
> is on (I can tell cause one is running a webserver, and the other isn't).

You need to make sure that the traffic for 207.176.140.17 is
accepted by the Linux box on which the above rule is provisioned
otherwise this won't work.

You do this by assigning this IP address to the external
interface of the Linux box and removing the other machine which
currently uses this address from the ext. net. If the Linux
box' external interface has already another IP address, then
use an alias, eg.

ifconfig eth0:0 inet 207.176.140.17 netmask <your netmask here>

(assuming that eth0 is the external interface)


HTH

Ciao, Horst
--
»When pings go wrong (It hurts me too)« E.Clapton/E.James/P.Tscharn
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Packet forwarding - Is there something similar to the FreeBSD ipfw 'fwd' command in iptables? I'm trying to split traffic from a LAN across 3 public IPs for load balancing purposes. Thanks -- Andy Zhang

Packet forwarding - hi, I want to know if there is any program which can be run with user privileges on linux which can listen to a port and forward all packets arriving at that port to a destination machine. Lets say i have 3 computers. X,Y,Z X can connect to Y and Y can....

X forwarding over ssh -- how? - Hi, look at this: --------------- bob@nizo:~$ bob@nizo:~$ echo $DISPLAY :0.0 bob@nizo:~$ ssh -X 192.168.178.2 Password: Last login: Fri Jul 15 12:12:19 2005 from 192.168.178.3 bob@mitchell:~$ echo $DISPLAY bob@mitchell:~$ --------------- This..

IP Not Forwarding - I have a Linux gateway with all Policies set to Accept and all targets flushed. All traffic is passing through except some UDP IBM ClearCase Traffic. Using tcpdump the response to ClearCase querries can be seen on the external interface, but not on the...

ip forwarding linux - Hello, i want to connect a 192.168.0.0 subnet to a 10.155.20.0 subnet with a PC running current Debian. Therefore i have a eth0 at 192.168.0.10 and a eth1 at 10.155.20.1. IP forwarding is activated in /etc/network/options and..
       Linux (Home) -> Networking All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows Forums
 Game Forums
  Linux Forums
 Mac Forums
 PDA Forums
 Mobile Forums
  Top  |  Store  |  RSS Feeds RSS  |  Data Feeds  |  Advertise  |  Submit  |  Bookmark  |  Newsletter  |  Contact