From owner-freebsd-hackers Thu Jan 23 12:23:07 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id MAA09753 for hackers-outgoing; Thu, 23 Jan 1997 12:23:07 -0800 (PST) Received: from awfulhak.demon.co.uk (awfulhak.demon.co.uk [158.152.17.1]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id MAA09748 for ; Thu, 23 Jan 1997 12:23:01 -0800 (PST) Received: from awfulhak.demon.co.uk (localhost.coverform.lan [127.0.0.1]) by awfulhak.demon.co.uk (8.8.4/8.7.3) with ESMTP id UAA01036; Thu, 23 Jan 1997 20:05:20 GMT Message-Id: <199701232005.UAA01036@awfulhak.demon.co.uk> X-Mailer: exmh version 1.6.9 8/22/96 To: Andrew McRae cc: luigi@labinfo.iet.unipi.it, hackers@freebsd.org, jdp@polstra.com Subject: Re: Fault-tolerant network with 2 ethernets In-reply-to: Your message of "Thu, 23 Jan 1997 19:19:35 +1100." <199701230819.TAA16703@metaplex-ss10.cisco.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 23 Jan 1997 20:05:20 +0000 From: Brian Somers Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > Presumably tun0 has its net interface on the application side, > so what does it do with the pkts it reads? Look at the IP > address inside the packet and then send it down a raw socket > to one of a couple of interfaces? How does it receive > the packets destined for the applications? Hmm, I guess > it can be done, but I doubt whether it would be real easy (in > my embedded environment, the forwarder could access the net > devices directly). The easy way to do this (in -current) is to feed off of a divert(4) socket. Pick up http://www.awfulhak.demon.co.uk/masqd.tar.gz for a simple example. Lines such as ipfw add 100 divert 6668 all from any to any ed0 ipfw add 100 divert 6668 all from any to any ed1 where ed0 and ed1 are your interfaces will send all ip traffic to socket 6668. You can then do what you want with it - like vary or change the destination IP on a per machine basis. -- Brian , Don't _EVER_ lose your sense of humour....