Subject: Re: bpf write() to local host
To: Ignatios Souvatzis <>
From: Andrew Brown <>
List: tech-net
Date: 01/21/2003 11:49:09
>> This is to solve a problem with simh: it uses bpf writes to send packets,
>> which makes it impossible to send packets to the local machine.
>> With this change (and a fix to simh) I can NFS mount from a NetBSD/vax in simh
>> a partition of the NetBSD/i386 hosting it.
>You know... somehow I feel the right solution to this would be a two-ended
>loopback interface instead of hacking some Ethernet interface. Sort of a
>network device version of socketpair().

i'm not sure i follow you...not that that's all that important.  :)

>Even better (in terms of work to invest): Teach simh (does it simulate
>the network interface in software?) use /dev/tun and connect the
>hosting OS to tun0. But I guess this won't work because simh wants to
>talk to layer 2 .

true, it does want to speak in ethernet datagrams.  ideally one could
proxy this, but i've decided (after thinking for a few minutes) that
that's a rather large problem.  arp queries and responses, and
bootp/dhcp queries and responses all involve the l2 address buried
somewhere in layer three or four.  or five.  i also had a spot of
trouble getting simh to work with my wi0 interface, until i did
"wiconfig wi0 -m 08:00:2b:aa:bb:cc" to make it match the emulated
interface.  i don't wanna consider trying to proxy 802.11...

fwiw, freebsd has a /dev/tap that might be applicable to this.  it's
very similar to /dev/tun, but involves ethernet encapsulation as well.
i dunno if it would solve the original issue here or not...

|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."