All of lore.kernel.org
 help / color / mirror / Atom feed
* dnat problem in transparent firewall
@ 2004-08-04  7:10 Raido Kurel
  2004-08-04  8:45 ` Antony Stone
  0 siblings, 1 reply; 7+ messages in thread
From: Raido Kurel @ 2004-08-04  7:10 UTC (permalink / raw)
  To: netfilter

Sorry, about not beeing in the thread. I just subscribed and can see message 
just in archive...

> > Needs:
> > To change destination IP of some packets coming from Internet. ie to
> > change destination IP from aaa.aaa.aaa.12 to aaa.aaa.aaa.13
...
> > iptables -t nat -A PREROUTING -d aaa.aaa.aaa.12 -j DNAT --to-dest
> > aaa.aaa.aaa.13
>
> Do you have a FORWARD rule allowing packets through to aaa.aaa.aaa.13 after 
> they've been NATted?

Yes.
Also packets from Internet to aaa.aaa.aaa.13 reach destination.
I am more worried about fact, that 
-t nat -A PREROUTING -j DNAT ...
and then 
-t nat -A PREROUTING -j LOG ...
does not log anything. Without the first rule logging works. 
I thought, that -j DNAT should pass packet for next nat PREROUTING rule for 
logging. According to http://ebtables.sourceforge.net/br_fw_ia/PacketFlow.png 
packet should next go to ebtables filter table input or forward chains, but 
nothing reaches there in case of the iptables -t nat -A PREROUTING -j DNAT 
rule.

Raido




^ permalink raw reply	[flat|nested] 7+ messages in thread
* dnat problem in transparent firewall
@ 2004-08-03 11:36 Raido Kurel
  2004-08-03 12:33 ` Antony Stone
  0 siblings, 1 reply; 7+ messages in thread
From: Raido Kurel @ 2004-08-03 11:36 UTC (permalink / raw)
  To: netfilter

Hello!

I want to change destination ip in incoming packets. If someone has time to 
answer, read on... In OpenBSD it worked automatically in same hardware 
configuration, just
rdr on xl0 from any to aaa.aaa.aaa.12 -> aaa.aaa.aaa.13
to /etc/pf.rules and thats all.

Configuration:
|LAN|---|ROUTER|---|TRANSPARENT FIREWALL|--|INTERNET GATEWAY|
LAN network: aaa.aaa.aaa.xxx/24
|ROUTER|: integrated into LAN switch
|TRANSPARENT FIREWALL|: a Linux 2.6.x box with iptables 1.2.9
ebtables 2.0.6. without IP's on traffic interfaces br0=eth1+eth2

router-internet gateway network: aaa.aaa.bbb.cdx/31

Needs:
To change destination IP of some packets coming from Internet. ie to change 
dastination IP from aaa.aaa.aaa.12 to aaa.aaa.aaa.13

What I have done:
iptables rule:

iptables -t nat -A PREROUTING -d aaa.aaa.aaa.12 -j DNAT --to-dest 
aaa.aaa.aaa.13

I thought, that this should do it, but it is not working. If I add this rule, 
the incoming packet is dropped in this rule.
For example:

if I log traffic and then change destination ip, I see traffic:

iptables -t nat -A PREROUTING -j LOG
iptables -t nat -A PREROUTING -d aaa.aaa.aaa.12 -j DNAT --to-dest 
aaa.aaa.aaa.13

If I try to change destination IP and then log, I do not see traffic:

iptables -t nat -A PREROUTING -d aaa.aaa.aaa.12 -j DNAT --to-dest 
aaa.aaa.aaa.13
iptables -t nat -A PREROUTING -j LOG

Seems like destination ip rule swollows packet. What could be wrong or is 
there other means to acomplish what I need?

Thanks,
Raido



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

end of thread, other threads:[~2004-08-04 12:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-04  7:10 dnat problem in transparent firewall Raido Kurel
2004-08-04  8:45 ` Antony Stone
2004-08-04 11:14   ` Raido Kurel
2004-08-04 11:30     ` Antony Stone
2004-08-04 12:05       ` Raido Kurel
  -- strict thread matches above, loose matches on Subject: below --
2004-08-03 11:36 Raido Kurel
2004-08-03 12:33 ` Antony Stone

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.