From owner-freebsd-questions@freebsd.org Sat Mar 5 16:35:00 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC187A09652 for ; Sat, 5 Mar 2016 16:35:00 +0000 (UTC) (envelope-from kudzu@tenebras.com) Received: from mail-yk0-x22a.google.com (mail-yk0-x22a.google.com [IPv6:2607:f8b0:4002:c07::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A69707A9 for ; Sat, 5 Mar 2016 16:35:00 +0000 (UTC) (envelope-from kudzu@tenebras.com) Received: by mail-yk0-x22a.google.com with SMTP id n145so7321251ykb.1 for ; Sat, 05 Mar 2016 08:35:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tenebras-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=coUa9fTpkQQjWjtZRDeGeiW7+4WKImZUSX9S+lIBvZ8=; b=tMPWKApmHLCP1shmF3nC9o4yPXC5f4VcfeQ5ssdglQyzAf9TY+BHPPgxiFUqXVB0xL 19iXgD1tbtpi99FyllOzTkqPtYevEG3i8qfPAG8mLM3Rbnfm8bPUcD4PSbA+zl4UC0Vw 4qIu/Ymf/jMOzIhW32/oRJLt58Y/3vpRYDOYTyEMfR22o9VvXdT5E+hKop/E5McDsBl+ DIs8ecbPK40Y9tbWl4VqDdi/0JwJLwR4tIpcabINVkLm3nuBbEnBWDwkFkKJnbU6lpWq aJsnGEsJik7kr+guVsZv7k42L20KBPjjzR20itKr/8TFMBqYPuRTL3RSyeFer9v0V95v qavA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=coUa9fTpkQQjWjtZRDeGeiW7+4WKImZUSX9S+lIBvZ8=; b=CTzPxSIJgH3EYby0/qLC4Wmg8ktIcOgwI591zOSgNXopIgVS7mZUr98xmMkrchaoZi 0eizxtgzhrR+R1EWFOR1aInCZYQnHSHoxjJOB2RbsHMd/3C5nzYmyNmDq2DEXsnpYfnh iGHVAJuOYY6iQY9SHsXTdsGe5h+B5s1IwIkCbGkDy+YGtSjlh9K5px1bjvNRTPHWqJsL 44SELHOFwlRF5ipShZ1eyCgC+EtEWsow423p8EMJgnLDgwcDOsOIok05iZBVg1Ts/xnP GpNpl+SXjmV/JnJCJUZ0y8jTgTl3BwrJTIhQ4IHqQZ0wMg1N+nbhFzHH8PmOGMsd6ceV cnrw== X-Gm-Message-State: AD7BkJJwCiL6BcHRqsJvCKqxhbb21q5wLOp5C0vWWwPFusoAYHylpEIfv2BEXp7fjNW4sSctk3qGvGnlEnsaQX2z MIME-Version: 1.0 X-Received: by 10.37.98.143 with SMTP id w137mr7574813ybb.135.1457195699604; Sat, 05 Mar 2016 08:34:59 -0800 (PST) Received: by 10.37.93.137 with HTTP; Sat, 5 Mar 2016 08:34:59 -0800 (PST) In-Reply-To: <86h9glfb3c.fsf@gmail.com> References: <86h9glfb3c.fsf@gmail.com> Date: Sat, 5 Mar 2016 08:34:59 -0800 Message-ID: Subject: Re: Want to NAT over VPN but not the gateway's own traffic From: Michael Sierchio To: Malcolm Matalka Cc: FreeBSD Questions Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Mar 2016 16:35:01 -0000 This is indeed possible. I've done this with a combination of ipfw, kernel nat, and firewall rules that explicitly use different route tables (man setfib) This is a brief snippet from a firewall that was routing different traffic differently, and using NAT on the OpenVPN tunneled traffic. FW="ipfw-q" setfib 1 route -q add default -interface $IF_TUN $FW nat 100 config if $if_tun ... $FW add nat 100 ip from any to any in recv $if_tun ... $FW add setfib 1 ip from $INSIDE_NET to any ... $FW add nat 100 ip from any to any out xmit $if_tun On Sat, Mar 5, 2016 at 2:55 AM, Malcolm Matalka wrote: > I'm trying to have the following setup: > > I have a host that is acting as a WiFi access point and then NATing > traffic to the internet. That host is running an OpenVPN client. So > wlan0 traffic is NAT'd to tun0. That is exactly what I want. However, > I would like to keep this setup of the WiFi AP going through the VPN but > the traffic of the machine itself to go not go through the VPN. > > Is this possible? How? I'm not sure what information I actually need > to get proper help. > > /Malcolm > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" >