Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rebooting a VM clears the link0 flag on its tap interface #558

Open
llfw opened this issue Sep 29, 2024 · 2 comments
Open

rebooting a VM clears the link0 flag on its tap interface #558

llfw opened this issue Sep 29, 2024 · 2 comments

Comments

@llfw
Copy link

llfw commented Sep 29, 2024

interface while VM is running:

# ifconfig tap3
tap3: flags=1009843<UP,BROADCAST,RUNNING,SIMPLEX,LINK0,MULTICAST,LOWER_UP> metric 0 mtu 9000
        description: vmnet/iris/0/custom
        options=80000<LINKSTATE>
        ether 58:9c:fc:10:ff:8d
        inet6 fe80::1%tap3/64 scopeid 0x8
        groups: tap vm-port
        media: Ethernet 1000baseT <full-duplex>
        status: active
        nd6 options=1<PERFORMNUD>
        Opened by PID 76824

interface after VM reboots:

# ifconfig tap3
tap3: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 9000
        description: vmnet/iris/0/custom
        options=80000<LINKSTATE>
        ether 58:9c:fc:10:ff:8d
        inet6 fe80::1%tap3/64 scopeid 0x8
        groups: tap vm-port
        media: Ethernet 1000baseT <full-duplex>
        status: active
        nd6 options=1<PERFORMNUD>
        Opened by PID 51194

notice LINK0 is missing in flags.

VM config:

uuid="011cf85e-3551-4397-a6e7-fcd3141bd0d9"
loader="uefi"
cpu="1"
memory="1g"
wired_memory=yes
network0_type="virtio-net"
network0_device="tap3"
network0_mac="06:00:00:00:05:03"
disk0_type="nvme"
disk0_name="disk0.img,sectorsize=4096"
disk0_dev="file"
disk1_type="nvme"
disk1_name="disk1.img,sectorsize=4096"
disk1_dev="file"

vm-bhyve version 1.5.0_1 installed from ports

FreeBSD version FreeBSD 15.0-CURRENT #43 lf/main-n269060-ffd494371643: Tue Sep 17 05:59:59 BST 2024 [email protected]:/src/obj/src/freebsd/lf/main/amd64.amd64/sys/LF

@GogoFC
Copy link

GogoFC commented Oct 28, 2024

I'm not here to help :/ just to ask random questions.

I Googled LINK0 and found it but still don't know what that does. What does that do? I don't have that on any of my physical or virtual NICs.

       link[0-2]
	       Enable  special	processing of the link level of	the interface.
	       These three options are interface specific  in  actual  effect,
	       however,	 they  are  in general used to select special modes of
	       operation.  An example of this is to enable  SLIP  compression,
	       or to select the	connector type for some	Ethernet cards.	 Refer
	       to the man page for the specific	driver for more	information.

       -link[0-2]
	       Disable special processing at the link level with the specified
	       interface.

@llfw
Copy link
Author

llfw commented Oct 28, 2024

the meaning of link0 depends on the specific device; in the case of tap devices it means that IP addresses configured on the interface won't be removed when the interface is brought down (which happens when the VM is shut down).

from tap(4):

     On the last close of the data device, the interface is brought down (as
     if with “ifconfig tapN down”) and has all of its configured addresses
     deleted unless the device is a VMnet device, or has IFF_LINK0 flag set.
     All queued frames are thrown away.  If the interface is up when the data
     device is not open, output frames are thrown away rather than letting
     them pile up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants