From: "Walter Gnadenberger" Subject: Problem VPN through iptables Date: Thu, 19 Aug 2004 11:15:31 +0200 Sender: netfilter-admin@lists.netfilter.org Message-ID: <000001c485cd$141be9a0$4d00a8c0@internal.sphinx.co.at> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0001_01C485DD.D7A4B9A0" Return-path: Errors-To: netfilter-admin@lists.netfilter.org List-Help: List-Post: List-Subscribe: , List-Id: List-Unsubscribe: , List-Archive: To: netfilter@lists.netfilter.org This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C485DD.D7A4B9A0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hello! I habe a problem with VPN (PPTP) through a FW (iptables) Exercise: I want through a iptables-fw to a ms vpn server. (INTERNET) -> FW(iptables) -> VPN (PPTP MS SERVER) I am able to make a vpn connect when I am in the same net. So VPN Server works fine. When I try to connect the VPN server from outside I get an Err 721. when i trace the session with tcpdump, I see traffic in both directions (GRE and TCP 1721) With a sniffer at MS VPN Server I see incoming and outgoing traffic. I do not know what I make wrong! Hier ar my rules for the FW ip_vpn_ext=xxx.xxx.xxx.xxx ip_vpn_server=xxx.xxx.x.xx trace_echo "VPN rules for LAN" trace_echo "set VPN Lan Rules" ${IPTABLES} -t nat -A PREROUTING \ -i $i_external \ -p tcp \ -d $ip_vpn_ext --dport 1723 \ -j DNAT --to $ip_vpn_server:1723 ${IPTABLES} -t nat -A PREROUTING \ -i $i_external \ -p gre \ -d $ip_vpn_ext \ -j DNAT --to $ip_vpn_server ${IPTABLES} -t nat -A POSTROUTING \ -o $i_external \ -p gre \ -s $ip_vpn_server \ -j SNAT --to-source $ip_vpn_ext ${IPTABLES} -t nat -A POSTROUTING \ -o $i_external \ -p tcp \ -s $ip_vpn_server --sport 1723 \ -j SNAT --to-source $ip_vpn_ext:1723 ${IPTABLES} -A fwd_int \ -i $i_external \ -o $i_internal \ -p tcp \ -s $net_anywhere --sport $p_unpriv\ -m state --state NEW,ESTABLISHED \ -j ACCEPT ${IPTABLES} -A fwd_int \ -i $i_internal \ -o $i_external \ -p tcp \ -s $ip_vpn_server \ -m state --state ESTABLISHED \ -j ACCEPT ------=_NextPart_000_0001_01C485DD.D7A4B9A0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Nachricht
Hello!
I habe a problem with VPN (PPTP) through a FW=20 (iptables)

Exercise:
I want through=20 a iptables-fw to a ms vpn server.
(INTERNET) -> FW(iptables) = -> VPN=20 (PPTP MS = SERVER)
I am able to make a vpn = connect when I am=20 in the same net. So VPN Server works = fine.
When I try to connect the VPN server from = outside I get=20 an Err 721.
when i trace the session with tcpdump, I see = traffic in=20 both directions (GRE and TCP = 1721)
With a sniffer at MS VPN Server I see = incoming and=20 outgoing traffic.
 
I=20 do not know what I make wrong!
 
Hier ar my rules for the=20 FW
 
 

ip_vpn_ext=3Dxxx.xxx.xxx.xxx
ip_vpn_server=3Dxxx.xxx.x.xx=

trace_echo=20 "VPN rules for LAN"





trace_echo "set VPN Lan=20 Rules"


${IPTABLES} -t nat -A PREROUTING \
-i $i_external = \
-p=20 tcp \
-d $ip_vpn_ext --dport 1723 \
-j DNAT --to=20 $ip_vpn_server:1723

${IPTABLES} -t nat -A PREROUTING \
-i = $i_external=20 \
-p gre \
-d $ip_vpn_ext \
-j DNAT --to=20 $ip_vpn_server


${IPTABLES} -t nat -A POSTROUTING \
-o = $i_external=20 \
-p gre \
-s $ip_vpn_server \
-j SNAT --to-source=20 $ip_vpn_ext

${IPTABLES} -t nat -A POSTROUTING \
-o $i_external = \
-p=20 tcp \
-s $ip_vpn_server --sport 1723 \
-j SNAT --to-source=20 $ip_vpn_ext:1723


${IPTABLES} -A fwd_int \
-i $i_external = \
-o=20 $i_internal \
-p tcp \
-s $net_anywhere --sport $p_unpriv\
-m = state=20 --state NEW,ESTABLISHED \
-j ACCEPT

${IPTABLES} -A fwd_int = \
-i=20 $i_internal \
-o $i_external \
-p tcp \
-s $ip_vpn_server = \
-m state=20 --state ESTABLISHED \
-j ACCEPT=20
------=_NextPart_000_0001_01C485DD.D7A4B9A0--