* NAT and IPSEC
@ 2009-04-16 13:00 Stephen Clark
2009-04-16 13:30 ` Jan Engelhardt
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Clark @ 2009-04-16 13:00 UTC (permalink / raw)
To: netfilter-devel
Hello,
I have to separate ipsec tunnels going to two different private networks. How do
I keep iptables from natting the traffic destined for these 2 networks. I tried:
iptables -t nat -A POSTROUTING -o eth1 -d ! 192.168.1.0/24 -d ! 172.16.0.0/16
-j MASQUERADE
but it says only one -d is allowed. So I tried
iptables -t nat -A POSTROUTING -o eth1 -d ! ( 192.168.1.0/24 || 172.16.0.0/16 )
-j MASQUERADE
and it says "(" error. So how do I specify multiple destination
networks/addresses to be excluded from being natted.
Thanks,
Steve
--
"They that give up essential liberty to obtain temporary safety,
deserve neither liberty nor safety." (Ben Franklin)
"The course of history shows that as a government grows, liberty
decreases." (Thomas Jefferson)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: NAT and IPSEC
2009-04-16 13:00 NAT and IPSEC Stephen Clark
@ 2009-04-16 13:30 ` Jan Engelhardt
0 siblings, 0 replies; 2+ messages in thread
From: Jan Engelhardt @ 2009-04-16 13:30 UTC (permalink / raw)
To: Stephen Clark; +Cc: netfilter-devel
On Thursday 2009-04-16 15:00, Stephen Clark wrote:
> Hello,
>
> I have to separate ipsec tunnels going to two different private networks. How
> do I keep iptables from natting the traffic destined for these 2 networks. I
> tried:
>
> iptables -t nat -A POSTROUTING -o eth1 -d ! 192.168.1.0/24 -d ! 172.16.0.0/16
> -j MASQUERADE
>
> but it says only one -d is allowed. So I tried
Create a new chain from which you prematurely exit if the daddr is
192.168.1.0/24 or 172.16.0.0/16, and the third rule would masq.
> iptables -t nat -A POSTROUTING -o eth1 -d ! ( 192.168.1.0/24 || 172.16.0.0/16 )
> -j MASQUERADE
>
> and it says "(" error. So how do I specify multiple destination
> networks/addresses to be excluded from being natted.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-04-16 13:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-16 13:00 NAT and IPSEC Stephen Clark
2009-04-16 13:30 ` Jan Engelhardt
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.