* source nat does'nt work in bridge mode
@ 2006-03-08 10:51 afshin lamei
2006-03-08 14:27 ` Martijn Lievaart
2006-03-08 15:06 ` Chinh Nguyen
0 siblings, 2 replies; 3+ messages in thread
From: afshin lamei @ 2006-03-08 10:51 UTC (permalink / raw)
To: netfilter
dear all, I've a linux box with iptables which is working in bridge
mode. I want to change (NAT) the source IP of the outging packets,
using:
iptables -t nat -A POSTROUTING -s 192.168.100.100 -j SNAT --to-source
192.168.100.1
the rule works correctly (source nat is done), but the client
(192.168.100.100) does not revieve any packet of the reply. sniffing
the outgoing traffic shows that the next hop can not find the client
with translated IP (192.168.100.1). what should I do?
regards
afshin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: source nat does'nt work in bridge mode
2006-03-08 10:51 source nat does'nt work in bridge mode afshin lamei
@ 2006-03-08 14:27 ` Martijn Lievaart
2006-03-08 15:06 ` Chinh Nguyen
1 sibling, 0 replies; 3+ messages in thread
From: Martijn Lievaart @ 2006-03-08 14:27 UTC (permalink / raw)
To: afshinlamei; +Cc: netfilter
afshin lamei zei:
> dear all, I've a linux box with iptables which is working in bridge
> mode. I want to change (NAT) the source IP of the outging packets,
> using:
> iptables -t nat -A POSTROUTING -s 192.168.100.100 -j SNAT --to-source
> 192.168.100.1
> the rule works correctly (source nat is done), but the client
> (192.168.100.100) does not revieve any packet of the reply. sniffing the
> outgoing traffic shows that the next hop can not find the client with
> translated IP (192.168.100.1). what should I do?
Create a static arp entry on the firewall for 192.168.100.1 so the packets
can find their way back to the firewall. Remember, 192.168.100.1 does not
"exist" so we have to fake it in order for the arp protocol to work.
HTH,
M4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: source nat does'nt work in bridge mode
2006-03-08 10:51 source nat does'nt work in bridge mode afshin lamei
2006-03-08 14:27 ` Martijn Lievaart
@ 2006-03-08 15:06 ` Chinh Nguyen
1 sibling, 0 replies; 3+ messages in thread
From: Chinh Nguyen @ 2006-03-08 15:06 UTC (permalink / raw)
To: netfilter
afshin lamei wrote:
> dear all, I've a linux box with iptables which is working in bridge
> mode. I want to change (NAT) the source IP of the outging packets,
> using:
> iptables -t nat -A POSTROUTING -s 192.168.100.100 -j SNAT --to-source
> 192.168.100.1
> the rule works correctly (source nat is done), but the client
> (192.168.100.100) does not revieve any packet of the reply. sniffing
> the outgoing traffic shows that the next hop can not find the client
> with translated IP (192.168.100.1). what should I do?
> regards
> afshin
>
How can 100 receive the reply? Supposing you send a packet to 101. Because of
SNAT, 101 receives the packet from 1. When it tries to send the reply back, as 1
is on the same subnet, 101 will attempt to ARP the MAC address of 1. Since there
is no such machine, the reply is not sent out. (Note that if there is a 1
machine, the reply will go to it and still not to 100).
You might be able to solve this by adding an alias to your interface. For
example, "ip addr add 192.168.100.1/24 dev eth0". In this case, your 100 machine
may respond to an ARP request of 192.168.100.1.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-03-08 15:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-08 10:51 source nat does'nt work in bridge mode afshin lamei
2006-03-08 14:27 ` Martijn Lievaart
2006-03-08 15:06 ` Chinh Nguyen
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.