Linux Netfilter discussions
 help / color / mirror / Atom feed
* Get source IP of packet through PREROUTING CHAIN
@ 2009-08-11  4:39 Elison Niven
  2009-08-11 12:36 ` Gáspár Lajos
  0 siblings, 1 reply; 4+ messages in thread
From: Elison Niven @ 2009-08-11  4:39 UTC (permalink / raw)
  To: netfilter; +Cc: elison.niven

Hi List,

I have two interfaces eth0 and eth1 on my machine.

My machine has eth0 = 192.168.1.100 and eth1 = 172.16.1.100

The scenario is that I will be receiving packets at port 10000 on eth0
of my machine. I do not know from which IP the packets are being
received (Can be any machine - I do not need to apply a source address
matching rule).

I need to forward these packets to another machine B that I do so with
this rule:

iptables -t nat -I PREROUTING -i eth0 -p udp \
       --dport 10000 -j DNAT --to-destination 172.16.1.200

Note that I have not added any -s option to the rule for source
address matching.

This also works properly. Now I need to _know_ the source IP and
source Port of the packets that are being received at port 10000 on
eth0. (For example to send some data back to the _same_machine_ that
is sending packets at port 10000)

How do I achieve this?

Best Regards,
Elison

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-11 13:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-11  4:39 Get source IP of packet through PREROUTING CHAIN Elison Niven
2009-08-11 12:36 ` Gáspár Lajos
2009-08-11 13:37   ` Elison Niven
2009-08-11 13:44     ` Christoph A.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox