From owner-freebsd-questions@freebsd.org Sat Mar 5 17:08:59 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 1209FA1371C for ; Sat, 5 Mar 2016 17:08:59 +0000 (UTC) (envelope-from kudzu@tenebras.com) Received: from mail-yk0-x22b.google.com (mail-yk0-x22b.google.com [IPv6:2607:f8b0:4002:c07::22b]) (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 C6D2EC14 for ; Sat, 5 Mar 2016 17:08:58 +0000 (UTC) (envelope-from kudzu@tenebras.com) Received: by mail-yk0-x22b.google.com with SMTP id z13so34645484ykd.0 for ; Sat, 05 Mar 2016 09:08:58 -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=unyETtmkkDHLKvOwBphXz4M+R1W3cGSba76bA4c7dBI=; b=dWM0D1cE1sb6BvnQbGaXAjrwU5mYditMUhCbqtEuebO6dWAhjLoZDs+WdpC0VCxnkV LAVfNOgc5x8ME3D0VETKJNSluTkkyH7GCOOYX831XFfIskyWfAWqzjQL6byB7tHv1Ybg ahiwWYAJUfjItraHgph3Mq1AMD5JdbEJNEBB6EgKesFfcCnZMb21xQeNWKdlLSXQYOY3 kPYVIs9HmHVGGuWpuPwpa69KGij/DFvYHEfa9lu0uCeDYJAlwc1bJsL9il4Nvc7cQslj bG7io0DtZy8NWYWGHVp1vu7j+CknrvSF0ce/kVFPsDUKxlF896Tkzt3FCQhHFN3XbPeA PpIw== 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=unyETtmkkDHLKvOwBphXz4M+R1W3cGSba76bA4c7dBI=; b=C164d+G0Hkhj55fwxe8Tw4WaP3lt0cVPGXsusNIdmWNqMWo9hDQbEW65cRNu/yFKr+ UmvJzRxJKAkZapCehU+6jQS2bMJQ/KDJaJvX4XFr4n4q8qNnFIj0l9OEyPNanzdDEM8z ECZjpr4HQrYhLd00vGUHYNmbUoJBjVHUVpdVnftI68wORmcbgNhxvRS9puBbi34N8HDs oZltF2rm71WV3Q3Ey2l1PWxwhFXntls8x2kyIb4OiQu4olSjOnJw3cbdwA2Pg1tSpMkd 2n7bQzHYZwPrDhNSDkWZPAybZ4sn98XhBATIzaNK9NV8J1a2AmZN9n18UjvphE0WMUn+ eD9Q== X-Gm-Message-State: AD7BkJIlTejJrUYJzbnL6t+AwXu/JhXmywdkXu32C7rnch55sMQF/wAtsAR2fB6XE3k1GWYYBWLaTHkYuBetxQoP MIME-Version: 1.0 X-Received: by 10.37.31.87 with SMTP id f84mr7788609ybf.151.1457197737093; Sat, 05 Mar 2016 09:08:57 -0800 (PST) Received: by 10.37.93.137 with HTTP; Sat, 5 Mar 2016 09:08:57 -0800 (PST) In-Reply-To: References: <86h9glfb3c.fsf@gmail.com> Date: Sat, 5 Mar 2016 09:08:57 -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 17:08:59 -0000 $IF_TUN and $if_tun are meant to be the same, of course. I pasted those from two different files. On Sat, Mar 5, 2016 at 8:34 AM, Michael Sierchio wrote: > 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" >> > >