【问题标题】:Creating a virtual switch for Hyper-v stops host from receiving udp multicast为 Hyper-v 创建虚拟交换机会阻止主机接收 udp 多播
【发布时间】:2017-02-06 12:39:37
【问题描述】:

基本上我的问题是,一旦我通过 Hyper-V 管理器创建了一个外部虚拟交换机,我就无法接收多播 udp 数据包(流式视频),这是提供来宾操作系统完整网络所必需的。

如果我在没有虚拟交换机的情况下使用 VLC 并在我的主机上播放 RTSP url,那么它可以毫无问题地播放,一旦我添加了虚拟交换机,我就无法再播放多播 RTSP url。

背景故事

我创建了几个 docker 服务,通过 Hyper-v 在我的 Windows 10 Pro 主机上的 Ubuntu 16.04 VM 环境中运行。我的 docker 服务需要能够接收我已经使用 VirtualBox 成功完成的多播 udp 数据包......但我想使用 Hyper-v。一旦我解决了我的主机无法接收多播的原因,我将继续测试以确保我的容器也能够接收。

信息

在尝试流式传输多播 RTSP url 时执行此 show joins 命令时,虚拟交换机上的 239.168.1.75 地址会正确增加其引用计数,然后在 VLC 关闭后,引用计数会回落,所以看起来像它正在正确地加入/离开组。

netsh interface ip show joins

Interface 1: Loopback Pseudo-Interface 1

Scope       References  Last  Address
----------  ----------  ----  ---------------------------------
0                    0  Yes   224.0.0.251
0                    4  Yes   239.255.255.250

Interface 28: vEthernet (New Virtual Switch)

Scope       References  Last  Address
----------  ----------  ----  ---------------------------------
0                    0  Yes   224.0.0.1
0                    3  Yes   224.0.0.251
0                    1  Yes   224.0.0.252
0                    0  Yes   239.168.1.75
0                    4  Yes   239.255.255.250

Interface 15: Local Area Connection* 5

Scope       References  Last  Address
----------  ----------  ----  ---------------------------------
0                    0  Yes   224.0.0.1

路线打印

===========================================================================
Interface List
 15...00 ff 10 60 55 c4 ......Juniper Network Connect Virtual Adapter
 28...9c eb e8 35 1a 1e ......Hyper-V Virtual Ethernet Adapter
  1...........................Software Loopback Interface 1
===========================================================================

IPv4 Route Table
===========================================================================
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.1.1    192.168.1.138     25
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
      192.168.1.0    255.255.255.0         On-link     192.168.1.138    281
    192.168.1.138  255.255.255.255         On-link     192.168.1.138    281
    192.168.1.255  255.255.255.255         On-link     192.168.1.138    281
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
        224.0.0.0        240.0.0.0         On-link     192.168.1.138    281
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
  255.255.255.255  255.255.255.255         On-link     192.168.1.138    281
===========================================================================
Persistent Routes:
  None

Igmpquery (https://code.google.com/archive/p/igmpquery)

使用此工具时,我可以查询网络并在移除虚拟交换机时获得响应,但一旦再次添加,它就会失败。

使用虚拟交换机

IGMP query generator V1.4
    Project web site: http://code.google.com/p/igmpquery/
    Requires WinPcap

\Device\NPF_{807EAC56-4C04-424D-9DDE-4411FB900E3C}
    Description: Juniper Network Connect Virtual Adapter

    Address Family Name: AF_INET
    Address: 0.0.0.0
    Netmask: 255.0.0.0
    Broadcast Address: 0.0.0.0
IGMPv2 general query 0.0.0.0 -> 224.0.0.1

listening for responses ...


\Device\NPF_{27895664-EDF7-44E0-9753-E549EDCAD6E7}
    Description: Realtek USB NIC

没有虚拟交换机

IGMP query generator V1.4
    Project web site: http://code.google.com/p/igmpquery/
    Requires WinPcap

\Device\NPF_{807EAC56-4C04-424D-9DDE-4411FB900E3C}
    Description: Juniper Network Connect Virtual Adapter

    Address Family Name: AF_INET
    Address: 0.0.0.0
    Netmask: 255.0.0.0
    Broadcast Address: 0.0.0.0
IGMPv2 general query 0.0.0.0 -> 224.0.0.1

listening for responses ...


\Device\NPF_{27895664-EDF7-44E0-9753-E549EDCAD6E7}
    Description: Realtek USB NIC

    Address Family Name: AF_INET
    Address: 192.168.1.138
    Netmask: 255.255.255.0
    Broadcast Address: 0.0.0.0
IGMPv2 general query 192.168.1.138 -> 224.0.0.1

listening for responses ...
15:44:06.551   192.168.1.85      ->   224.0.0.252       IGMP Rpt 224.0.0.252
15:44:06.593   192.168.1.71      ->   224.0.0.251       IGMP Rpt 224.0.0.251
15:44:06.624   192.168.1.79      ->   224.0.0.252       IGMP Rpt 224.0.0.252
15:44:06.828   192.168.1.89      ->239.255.255.250       IGMP Rpt 239.255.255.250

【问题讨论】:

    标签: windows networking udp multicast hyper-v


    【解决方案1】:

    我不能 100% 确定神奇的子弹是什么,尽管它现在正在起作用。

    • 移除虚拟交换机
    • 重置网络设置
      • netsh winsock 重置
      • netsh int ip 重置
      • ipconfig /release
      • ipconfig /renew
      • ipconfig /flushdns
      • netsh advfirewall 将所有配置文件状态设置为关闭
    • 重启
    • 添加虚拟交换机
    • 重启
    • 现在,在运行 igmp 工具时,我从自己的 PC 从虚拟交换机中获得响应,但在我的主网络上没有其他设备
    • 已卸载 VirtualBox
      • 似乎没有帮助
    • 沮丧,去睡觉
    • 第二天醒来并运行 igmp 工具后,我开始收到来自虚拟交换机外部主网络上设备的回复
    • 经过测试的流式多播,一切正常

    【讨论】:

    • 我刚刚有过非常相似的经历。删除 Hyper-V 虚拟交换机后,什么都没有发生(即使重新启动后也没有),但过了一段时间,突然广播数据包开始通过。好像是某种缓存机制。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-06
    • 1970-01-01
    • 1970-01-01
    • 2023-03-05
    • 1970-01-01
    相关资源
    最近更新 更多