From owner-freebsd-net@FreeBSD.ORG Mon Sep 23 04:42:37 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 40289AD6; Mon, 23 Sep 2013 04:42:37 +0000 (UTC) (envelope-from ihsan@grep.my) Received: from svc02-kul.b.n3labs.my (svc02-kul.b.n3labs.my [IPv6:2400:3700:10::61]) by mx1.freebsd.org (Postfix) with ESMTP id 001F42B51; Mon, 23 Sep 2013 04:42:36 +0000 (UTC) Received: from [192.168.2.176] (unknown [110.159.249.234]) by svc02-kul.b.n3labs.my (Postfix) with ESMTPSA id 492E3C60235; Mon, 23 Sep 2013 12:42:36 +0800 (MYT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: Programmatically forwarding packets to outgoing interface From: Ihsan Junaidi Ibrahim In-Reply-To: <523FBF24.50004@freebsd.org> Date: Mon, 23 Sep 2013 12:42:34 +0800 Content-Transfer-Encoding: quoted-printable Message-Id: <3F7351D9-A2A9-492C-887A-E1B81083378E@grep.my> References: <4DC4F001-D430-4110-81DA-279F3D01AD33@grep.my> <523FBF24.50004@freebsd.org> To: Julian Elischer X-Mailer: Apple Mail (2.1510) Cc: "freebsd-net@freebsd.org" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2013 04:42:37 -0000 Thanks. Is there a specific C API I can use to call this? On Sep 23, 2013, at 12:10 PM, Julian Elischer = wrote: > On 9/23/13 11:55 AM, Ihsan Junaidi Ibrahim wrote: >> Hi folks, >>=20 >> I'm trying to learn building a VPN-type application on FreeBSD and = I'm currently stuck at trying to route packets to outgoing interface. >>=20 >> I've managed to push/pop IP packets in a tun(4) interface but now = that I can read the inner packet header, I need to route the payload out = of the box. I'm not quite sure which API I need to use to achieve this. >>=20 >> The inner packets can be of either IPv4 or IPv6. >>=20 >> Thanks. >> _______________________________________________ >> freebsd-net@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-net >> To unsubscribe, send any mail to = "freebsd-net-unsubscribe@freebsd.org" >>=20 >>=20 > you can try use ipfw and its 'fwd' option to reroute packets > not sure if fwd works with ipv6.. I've never tried.. > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"