From: Alex Samad Date: Tue, 11 Sep 2007 02:14:11 +0000 Subject: Re: [LARTC] OpenVPN routing Message-Id: <20070911021411.GK6156@samad.com.au> MIME-Version: 1 Content-Type: multipart/mixed; boundary="===============0158574023==" List-Id: References: <46E4E5E2.2070703@amfes.com> In-Reply-To: <46E4E5E2.2070703@amfes.com> To: lartc@vger.kernel.org --===============0158574023== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tKtFalx5NIx0HZ72" Content-Disposition: inline --tKtFalx5NIx0HZ72 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 10, 2007 at 03:48:13PM -0700, Daniel L. Miller wrote: > Alex Samad wrote: >> On Mon, Sep 10, 2007 at 01:40:29PM -0700, Daniel L. Miller wrote: >> =20 >>> Alex Samad wrote: >>> =20 >>>> On Sun, Sep 09, 2007 at 11:36:18PM -0700, Daniel L. Miller wrote: >>>> =20 >>>>> Hi! >>>>> >>>>> I'm trying to create a routed VPN using OpenVPN - and having trouble= =20 >>>>> with the routing concepts involved. Let me see if I can properly=20 >>>>> describe my current topology: >>>>> >>>>> Server - >>>>> LAN, with both local workstations and remote bridged workstations on= =20 >>>>> the >>>>> 192.168.0.0/24 network (this works without reservation). >>>>> Server located at 192.168.0.71, 192.168.0.72, 192.168.0.222, and f= ew=20 >>>>> others. >>>>> Routed VPN, 172.27.0.0/16 network. Server is located at 172.27.0.1. >>>>> Server can talk to clients, and clients can talk to server. >>>>> >>>>> My 1st goal is to allow selected server-side LAN workstations to reac= h=20 >>>>> the routed VPN workstations. The LAN should be invisible to the rout= ed=20 >>>>> VPN. >>>>> >>>>> My 2nd goal is to allow selected server-side LAN workstations to reac= h=20 >>>>> networks server by routed VPN workstations as gateways [this involves= =20 >>>>> OpenVPN more, I believe]. The LAN should still be invisible to the= =20 >>>>> routed VPN. >>>>> =20 >>>> I think you need to use a tap device (I currently have a similar setup= ,=20 >>>> but I do not hide the LAN - infact I use openvpn to do site to site WA= N) >>>> >>>> By hide the LAN you don't want to the openvpn clients to see the 192.1= 68=20 >>>> addresses if that is the case this is more a iptables question you wil= l=20 >>>> need to nat the lan network going out, if you want in bound traffic yo= u=20 >>>> will need to setup natting on the way back in as well - static though. >>>> =20 >>> So do I need a source NAT directing all traffic intended for=20 >>> 172.27.0.0/16 from 192.168.0.0/24 to come from 172.27.0.1? >>> =20 >> Okay then you just want out bound, pretend the customers site is the=20 >> internet, SNAT should do it (and a firewall just to be safe), you should= =20 >> only need one on the client's openvpn side, but because that is not in= =20 >> direct controll of you (physcially), I would probably suggest snat'ting= =20 >> again on your openpvn server or the firewall rules >> =20 > I've put in a snat on the server side - seems to be working fine. >> So=20 >> At your site >> >> * Set routing either fix up the default route or add routing to each=20 >> client machine (the former being the easier of the 2) >> * Set up a firewall >> * setup SNAT or push a route through to the client 'push "route=20 >> 192.168.8.0 255.255.252.0"' - done in the openvpn server config (the=20 >> later is probably the better - stay away from the double natting ) >> >> >> one the customer site >> * Set up SNAT hide everything coming from your site being the local lan= =20 >> address >> * set up a firewall=20 >> >> So all traffic coming from your site will end up on the customer site wi= th=20 >> a local lan address. >> >> There is no routing back into your lan, because of a) routing b) firewal= l=20 >> on the customer site c) firewall on the server. >> >> a & b are easy to get around because they are at the customer site. C is= =20 >> where you protection is. >> =20 > Customer's site not under my control - and running Windows so my linux=20 > options are rather limited . So I need to do everything within the=20 > server and OpenVPN. I CAN push a route to the client - but I still don't= =20 > see why I need to share my LAN information with the clients at all - I ju= st=20 > need the OpenVPN client to be a gateway for the VPN and forward VPN traff= ic=20 > from the remote network. if you are using snat you shouldn't. if you have setup a ip network for the vpn ie if your server ip address is = not=20 in the network for the customer you will need snat'ing there else the clien= t=20 machine will not know how to get back. > > --=20 > Daniel > _______________________________________________ > LARTC mailing list > LARTC@mailman.ds9a.nl > http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc > --tKtFalx5NIx0HZ72 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFG5fnzkZz88chpJ2MRApfaAJ9YKM+qt3oNZ0VJ9lsPRYCvmbbwrgCeO5XR x32Mqk7kQiT+3cfYR+hk74w= =aqIh -----END PGP SIGNATURE----- --tKtFalx5NIx0HZ72-- --===============0158574023== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ LARTC mailing list LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc --===============0158574023==--