LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-09-2001, 03:39 AM   #1
steppin_razor
LQ Newbie
 
Registered: Nov 2001
Posts: 29

Rep: Reputation: 15
PPTP hell (IPtables)


Day 3 of my crash course in Linux firewalls.

The good news - I've got it working. I like it. It port forwards. Wee.

The bad news - PPTP is beating me down.

Ideally, I'd like to port forward VPN (1723 + GRE) connections to my Win2K VPN server on the back network. I haven't been able to get this working. I tried the following (with and without the FORWARD rules) - I noticed that I would see a message about the VPN-1723 when I tried a VPN connection from the outside world, but I never saw the GRE rule fire (not sure if it is even supposed to) -- end result is that it just wouldn't work.

iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 1723 -j LOG --log-prefix "VPN-1723: "
iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 1723 -j DNAT --to 10.0.0.51
iptables -A FORWARD -i eth1 -o eth0 -p 47 -d 10.0.0.51 -j ACCEPT

iptables -t nat -A PREROUTING -i eth1 -p 47 -j LOG --log-prefix "VPN-GRE: "
iptables -t nat -A PREROUTING -i eth1 -p 47 -j DNAT --to 10.0.0.51
iptables -A FORWARD -i eth1 -o eth0 -p TCP -d 10.0.0.51 --dport 1723 -j ACCEPT

I dug around and found this:

http://www.impsec.org/linux/masquerade/ip_masq_vpn.html

It said:

>Server masquerade for PPTP also works with the default >masquerade code. Add the following rules:
>
>PPTP (1723/tcp and 47/ip):
>
>/sbin/iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 1723 -
>j DNAT --to 192.168.0.5
>/sbin/iptables -t nat -A PREROUTING -i eth1 -p 47 -j DNAT --to
>192.168.0.5
>
>...where 192.168.0.5 is the local-network IP address of the PPTP
>server. I have not had any reports regarding IPsec server
>masquerade.
>
>Masquerading multiple clients talking to the same remote
>gateway will require protocol-specific support in the form of
>kernel patches, which are not yet available. Sorry.

I'm not sure exactly how to interpret this, but I assume that it means my SOL?...

Any help on getting the port forwarding to work would be super appreciated.

In the meantime, I've been trying to figure out how to get PPTPD to work and support MS style PPTP connections (i.e. CHAP.. etc)...

*RANT*
I know that the Linux/Unix world isn't full of MS lovers.. etc, but you'd think that people would be building in support for the largest installed based of desktops by default. I'm still struggling with applying the kernel/PPP/pptpd patches/configurations to get this all working (kernel recompile # I've lost count running right now)..


Thanks again for all the help!!!
 
Old 11-09-2001, 06:03 PM   #2
dangel
Member
 
Registered: Nov 2001
Location: atl
Distribution: redhat
Posts: 52

Rep: Reputation: 15
*well*
only one comment. if M$ didn't make their own propietary version of IPSEC - and *BREAK* it. you wouldn't be having the problems your having.

:P

pptp is very unstable. i suggest *if you can* switch over to ipsec and your problems will go away.
 
Old 11-09-2001, 06:26 PM   #3
steppin_razor
LQ Newbie
 
Registered: Nov 2001
Posts: 29

Original Poster
Rep: Reputation: 15
PPTPD...

It took a bit of struggling, but I did get PPTPD working. I haven't really "burn tested" it, but I appear to be able to VPN in and then map network drives.

If I have problems with it, I guess I'll go hunt down an L2PT/IPSEC implementation.

It would still be nice though if I could just get the firewall to port forward to the MS VPN server.
 
Old 11-09-2001, 06:37 PM   #4
dangel
Member
 
Registered: Nov 2001
Location: atl
Distribution: redhat
Posts: 52

Rep: Reputation: 15
yes. i agree. regardless what you want it to do what it is supposed to do. =) forward the ports damnit! hehe
---
good to hear it worked. so what was the deal?
 
Old 11-09-2001, 10:27 PM   #5
steppin_razor
LQ Newbie
 
Registered: Nov 2001
Posts: 29

Original Poster
Rep: Reputation: 15
PPTP w/ support for MSCHAP authentication under 2.4.7 (redhat 7.2)

I downloaded the source for PPP-2.4.1 and PPTPD-1.01. I got patches (ppp-2.4.1-MSCHAPv2-fix.patch and ppp-2.4.1-openssl-0.9.6-mppe-patch) for PPP and applied them. I also applied linux-2.4.4-openssl-0.9.6.a-mppe.patch to my Linux Kernel (2.4.7-10). The kernel patch had the kernel version hardcoded into it so I had to change that.

I then followed the directions (mostly - with the differences outlined above) in the directions at:

http://poptop.lineo.com/releases/PoP...dHat-HOWTO.txt

I had problems when I tried compiling in the PPP options directly into the Kernel. I took a cue from the a posting I had seen from someone else and installed them as modules.
 
Old 11-09-2001, 10:51 PM   #6
dangel
Member
 
Registered: Nov 2001
Location: atl
Distribution: redhat
Posts: 52

Rep: Reputation: 15
sweet.
 
Old 02-05-2002, 06:39 PM   #7
iamnotherbert
Member
 
Registered: May 2001
Posts: 74

Rep: Reputation: 15
Sounds like your firewalls good to go. How do you like the pptpd? Any hickups? I have been thinking about changing from the vpn-masq to the pptpd on my firewalls. If your still interested in pass the vpn through here's the deal...

You can't (yet) masq multiple vpn with iptables. You have to use ipchains and an older kernel. Grab a kernel with vpn-masq support. Example... Grab 2.2.17, grab the patches from the howto and apply them.. hint you need to select yes for prompt for development and incomplete code/drivers. Once that is selected you can select the vpn masq stuff under networking options. Build - Install - Reboot with new kern.. Test away..

If you need any help or a better explanation let me know..

-d
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPTABLES and GRE PPTP working jbrandis Linux - Security 3 10-27-2005 10:15 AM
Win2000 PPTP behind IPTables 09kevin77 Linux - Security 2 05-02-2005 09:11 AM
Pptp Vpn Iptables jrmann1999 Linux - Networking 1 08-20-2004 11:26 AM
IPTABLES and PPTP Traffic pssst_yeah_you Linux - Security 2 07-27-2004 05:31 PM
iptables and pptp vpn SSBN Linux - Networking 6 06-03-2003 02:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration