tap(4) and host-only networking between host and guest

Julian Elischer julian at freebsd.org
Wed Nov 4 12:50:40 UTC 2015


On 11/4/15 3:54 PM, Victor Sudakov wrote:
> Colleagues,
>
> I am experimenting with bhyve which uses tap(4) for network access.
>
> I don't want to bridge tap0 with any of the hosts's real NICs. How can
> I create a private network just between the host and the guest?
you are thinking too hard!

tap IS the interface..

ifconfig tap0 $address...
and in the VM, ifconfig vtnet0 ${some_other_address}



>
> I even tried to create a lo1 interface on the host and bridge it with
> tap0 but lo1 would not add as a bridge member even if I adjust its MTU.
>
>
> root at vas:/etc # ifconfig bridge0 create
> root at vas:/etc # ifconfig lo1 mtu 1500 up
> root at vas:/etc # ifconfig bridge0 addm tap0
> root at vas:/etc # ifconfig bridge0 addm lo1
> ifconfig: BRDGADD lo1: Invalid argument
> root at vas:/etc #
> root at vas:/etc # ifconfig bridge0
> bridge0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
>          ether 02:8f:fd:16:50:00
>          nd6 options=9<PERFORMNUD,IFDISABLED>
>          id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
>          maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
>          root id 00:00:00:00:00:00 priority 0 ifcost 0 port 0
>          member: tap0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
>                  ifmaxaddr 0 port 5 priority 128 path cost 2000000
> root at vas:/etc #
>
> Any help is appreciated.
>



More information about the freebsd-net mailing list