All of lore.kernel.org
 help / color / mirror / Atom feed
* ipsec + nat
@ 2005-08-03 21:12 Aleksandar Milivojevic
  2005-08-25  3:22 ` Trevor Cordes
  0 siblings, 1 reply; 5+ messages in thread
From: Aleksandar Milivojevic @ 2005-08-03 21:12 UTC (permalink / raw)
  To: netfilter

I have a set of rules in filter table, that after some cleanup look something
like this:

-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p esp -s 4.3.2.1 -d 1.2.3.4 -j ACCEPT
-A INPUT -j LOG --log-prefix "INPUT "

-A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A OUTPUT -p esp -s 1.2.3.4 -d 4.3.2.1 -j ACCEPT
-A OUTPUT -j LOG --log-prefix "OUTPUT "

-A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
-A FORWARD -p icmp --icmp-type ping -s 10.1.2.3 -d 10.3.2.1 -m state --state NEW
-j ACCEPT
-A FORWARD -j LOG --log-prefix "FORWARD "

So far so good.  I can ping 10.3.2.1 from 10.1.2.3 over my IPSec tunnel.

However, if I add MASQUERADE target into nat table:

-A POSTROUTING -o ppp0 -j MASQUERADE

and than try to ping 10.3.2.1, things do not work anymore.  Tcpdump on ppp0
shows (edited for clarity):

   IP 1.2.3.4 > 4.3.2.1 ESP
   IP 4.3.2.1 > 1.2.3.4 ESP
   IP 10.3.2.1 > 10.1.2.3 ICMP echo reply

The log files show that the decrypted packet (ICMP echo reply from 10.3.2.1 to
10.1.2.3) was dropped by Netfilter.  So, the IPSec as such works, it was
Netfilter that blocked the returning packet.  Seems as if Netfilter haven't
placed it into ESTABLISHED state, as it does when NAT rule is not present.

Bug in Netfilter, or bug in my configuration?

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



^ permalink raw reply	[flat|nested] 5+ messages in thread
* ipsec nat
@ 2003-05-07 16:08 robowarp
  0 siblings, 0 replies; 5+ messages in thread
From: robowarp @ 2003-05-07 16:08 UTC (permalink / raw)
  To: netfilter

Hi @all
having ppp0 as router web con, the linux router does masq 
and one net to eth1 as intranet (10.10.10.0/24)
one client wants to use ipsec client (gnu version)on windows 2k on
10.10.10.3/24 machine
rightsubnet in ipsec.conf is 130.0.0.12/32
has sombody a example script with iptables wich makes this
possible?
thx and Regards

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!



^ permalink raw reply	[flat|nested] 5+ messages in thread
* ipsec & nat
@ 2002-12-11  5:03 Simpson, Doug
  2002-12-11 20:39 ` Marcello Scacchetti
  0 siblings, 1 reply; 5+ messages in thread
From: Simpson, Doug @ 2002-12-11  5:03 UTC (permalink / raw)
  To: 'netfilter@lists.netfilter.org'

I have a redhat 7.3 box that is dualhomed.  It is my firewall and vpn
server.  I can successfully vpn (with IPSEC) into it.  If I use the
following command "iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE" I
cannot use VPN, but my internal network can only receive email (POP3) and
telnet after I use this command.
I have set up squid so I proxy my www traffic.
Can I NAT my pop3 and my telnet, and still VPN (IPSEC)?  
I am guessing my command is too general and I need to be more specific -
ports, source, etc defined.
Thanks,
Doug


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

end of thread, other threads:[~2005-08-25  3:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-03 21:12 ipsec + nat Aleksandar Milivojevic
2005-08-25  3:22 ` Trevor Cordes
  -- strict thread matches above, loose matches on Subject: below --
2003-05-07 16:08 ipsec nat robowarp
2002-12-11  5:03 ipsec & nat Simpson, Doug
2002-12-11 20:39 ` Marcello Scacchetti

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.