Programmatically forwarding packets to outgoing interface

Ihsan Junaidi Ibrahim ihsan at grep.my
Mon Sep 23 04:42:37 UTC 2013


Thanks. Is there a specific C API I can use to call this?

On Sep 23, 2013, at 12:10 PM, Julian Elischer <julian at freebsd.org> wrote:

> On 9/23/13 11:55 AM, Ihsan Junaidi Ibrahim wrote:
>> Hi folks,
>> 
>> 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.
>> 
>> 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.
>> 
>> The inner packets can be of either IPv4 or IPv6.
>> 
>> Thanks.
>> _______________________________________________
>> freebsd-net at freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-net
>> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"
>> 
>> 
> 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 at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-net
> To unsubscribe, send any mail to "freebsd-net-unsubscribe at freebsd.org"



More information about the freebsd-net mailing list