Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jan 1997 20:05:20 +0000
From:      Brian Somers <brian@awfulhak.demon.co.uk>
To:        Andrew McRae <amcrae@cisco.com>
Cc:        luigi@labinfo.iet.unipi.it, hackers@freebsd.org, jdp@polstra.com
Subject:   Re: Fault-tolerant network with 2 ethernets 
Message-ID:  <199701232005.UAA01036@awfulhak.demon.co.uk>
In-Reply-To: Your message of "Thu, 23 Jan 1997 19:19:35 %2B1100." <199701230819.TAA16703@metaplex-ss10.cisco.com> 

next in thread | previous in thread | raw e-mail | index | archive | help

> 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 <brian@awfulhak.demon.co.uk>, <brian@freebsd.org>
      <http://www.awfulhak.demon.co.uk/>;
Don't _EVER_ lose your sense of humour....





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701232005.UAA01036>