Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Feb 2017 23:03:22 -0800
From:      Stephen Stuart <stephen.stuart@gmail.com>
To:        "C. L. Martinez" <carlopmart@gmail.com>
Cc:        freebsd-virtualization@freebsd.org
Subject:   Re: tap interfaces disappears after bhyve guests shutdowns
Message-ID:  <CAOb7DXEx8se3TwTA61iBRnaUqLavVtRQbJ=fFwJNkotg2bc%2BBw@mail.gmail.com>
In-Reply-To: <CAOb7DXHr4mhFzAJQjG0SbGTAVLVVdEOpVTd-2s_=ZCRGCKu5Ng@mail.gmail.com>
References:  <20170213120938.hr3zu7flnm33v3zn@scotland.uxdom.org> <58A1A8A3.3030603@quip.cz> <8700dd14-cf15-20b9-38a6-e4181e4928ee@dann.ro> <20170214115708.pcw2poookycue3kk@scotland.uxdom.org> <58A2F845.5090603@quip.cz> <20170214132649.h3xwbcfrtjxk74si@scotland.uxdom.org> <20170214134158.vmczv6pramkscxhd@scotland.uxdom.org> <CAOb7DXHr4mhFzAJQjG0SbGTAVLVVdEOpVTd-2s_=ZCRGCKu5Ng@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Feb 14, 2017 05:42, "C. L. Martinez" <carlopmart@gmail.com> wrote:

On Tue, Feb 14, 2017 at 01:26:49PM +0000, C. L. Martinez wrote:
> On Tue, Feb 14, 2017 at 01:29:57PM +0100, Miroslav Lachman wrote:
> > C. L. Martinez wrote on 2017/02/14 12:57:
> > > On Mon, Feb 13, 2017 at 02:02:48PM +0100, Daniel Niculescu wrote:
> >
> > >
> > > Thanks Daniel. I have tried what you say, but ping doesn't works
between host and guest. If I put an ip to the bridge works ok, but not when
I assign an ip to tap interface.
> > >
> > > Any idea why??
> >
> > Are you using IPs from the same subnet on host and in a guests? What IP
did
> > you assign to tap / bridge?
> >
> > Miroslav Lachman
>
> Yes. For host: 172.22.55.1/24 and for guest 172.22.55.29/24. When I
assign IP 172.22.55.1 to the bridge on host side, host and guest can
communicate. But when I assign 172.22.55.1 to a tap interface on the host
and create a bridge with host's tap interface and guest's tap interface,
there is no comms between them ... And I don't understand why ...
>
>
> --
> Greetings,
> C. L. Martinez

Ok, I think I have found the problem (but not the solution :( ) ...

prodif: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1=
500
        ether 02:bc:f9:66:98:01
        nd6 options=3D9<PERFORMNUD,IFDISABLED>
        groups: bridge
        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 32768 ifcost 0 port 0
        member: tap11 flags=3D143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 7 priority 128 path cost 2000000
        member: tap10 flags=3D143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 6 priority 128 path cost 2000000
pubif: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 15=
00
        ether 02:bc:f9:66:98:02
        nd6 options=3D9<PERFORMNUD,IFDISABLED>
        groups: bridge
        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 32768 ifcost 0 port 0
        member: tap21 flags=3D143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 9 priority 128 path cost 2000000
        member: tap20 flags=3D143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 8 priority 128 path cost 2000000
tap10: flags=3D8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric =
0
mtu 1500
        options=3D80000<LINKSTATE>
        ether 00:bd:1d:15:f7:0a
        nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect
        status: active
        groups: tap
        Opened by PID 79946
tap11: flags=3D8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric =
0
mtu 1500
        options=3D80000<LINKSTATE>
        ether 00:bd:24:15:f7:0b
        inet 172.22.55.1 netmask 0xffffffe0 broadcast 172.22.55.31
        nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect
        status: no carrier
        groups: tap
tap20: flags=3D8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric =
0
mtu 1500
        options=3D80000<LINKSTATE>
        ether 00:bd:2b:15:f7:14
        nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect
        status: active
        groups: tap
        Opened by PID 79946
tap21: flags=3D8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric =
0
mtu 1500
        options=3D80000<LINKSTATE>
        ether 00:bd:31:15:f7:15
        inet 172.30.77.1 netmask 0xfffffff8 broadcast 172.30.77.7
        nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect
        status: no carrier
        groups: tap

 .. As you can see with tap21 and tap11 (tap interfaces assigned to host)
status is: no carrier ... =C2=BF=C2=BF=C2=BF=C2=BF=C2=BF???? Why?? Both are=
 assigned to bridges ...


Those tap interfaces have no carrier because they have not been opened by a
guest VM and paired with a vtnet interface.

A tap interface is how the vtnet interface inside the guest VM shows up on
the host side. No guest VM, no tap.

If you want the host to be able to exchange IP packets with the guest VM
locally, the bridge (on the host) and vtnet interface (in the guest VM)
need to be numbered in the same prefix. The tap interfaces don't get IP
address assignments, the corresponding vtnet interfaces inside the VMs do.

Stephen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOb7DXEx8se3TwTA61iBRnaUqLavVtRQbJ=fFwJNkotg2bc%2BBw>