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


  Search this Thread
Old 08-30-2001, 11:20 PM   #1
LQ Newbie
Registered: Aug 2001
Posts: 5

Rep: Reputation: 0
Question Iptables FORWARDing VPN

Hi there,

I want to use my linux machine as a VPN gateway.
We have a local Windows NT network. A Windows NT server and windows clients. They all have access to the internet using masquerading though the linux server, connected to the net via a network router. The linux machine has 2 networkcards. One attached to the router "the EXTERNAL NETWORK" with an internet ip of its own. Then there is the internal network, attached to the 10.0.0.x LAN.

I wish to use the NT server as the VPN server. So when a windows client puts in the ip number of the linux machine to establish a VPN connection, the linux machine forwards this to the NT machine, so that to the windows client, the linux machine appears to be the NT machine, and the NT server sees the client. So virtually, it would seem like the NT machine is connected directely to the internet and is serving the VPN clients.

How is this done?

Old 09-16-2001, 02:08 PM   #2
Registered: Aug 2001
Location: South Carolina, USA
Distribution: Redhat 8.0/Custom
Posts: 96

Rep: Reputation: 16
iptables, DNAT

You'll wanna use DNAT in the nat table of iptables

<exlb> = external ip address of linux box
<vpn> = vpn or pptp port (usually 1723)
<winnt> = ip address of winnt box
iptables -t nat -A POSTROUTING -d <exlb> -p tcp --destination-port <vpn> -j DNAT --to-destination <winnt>:<vpn>
What this _should_ do (you may have to experiment) is take any packet coming to the <exlb> destined for port <vpn> and changed the destination ip address of the packet from <exlb> to <winnt> and send it on it's merry way. Make sure the <winnt> box can send packets to the internet.

Make sure /proc/sys/net/ipv4/ip_forward contains a 1. If it's 0 then
echo "1" > /proc/sys/net/ipv4/ip_forward
I have used these rules successfully on Mandrake 8.0. Hopefully I didn't forget something.
Old 02-06-2004, 01:46 PM   #3
LQ Newbie
Registered: Jan 2004
Posts: 15

Rep: Reputation: 0

could i use something like this on a slackware 9.1 box?

iptables -I PREROUTING -t nat -p tcp -d <myextCableIp> --destination-port 1723 -j DNAT --to-destination

With out the above iptable statement windows clients cant even start the authentication process with the windows 2000 server

With the above iptable statement it connects and hangs on authentication then times out. with a 721 error.

Any ideas on a iptable script that will allow PPTP VPN through my slackware 9.1 box to my windows 2000 server?

Last edited by proendo; 02-06-2004 at 01:55 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 08:35 PM
help with iptables and forwarding laclac01 Linux - Networking 1 10-23-2005 08:16 AM
iptables forwarding... AnalyticaL Linux - Networking 5 09-28-2004 09:55 AM
IP forwarding not working on ppp-over-ssh vpn tingdahl Linux - Networking 3 08-27-2004 07:31 PM
Iptables Forwarding Help!! jglazner Linux - Networking 2 10-20-2003 06:04 PM

All times are GMT -5. The time now is 05:00 PM.

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