立即注册  找回密码
 立即注册
CeraNetworksBGVM服务器主机交流会员请立即修改密码Sharktech防护
查看: 16|回复: 2

Hyper

[复制链接]

Hyper

[复制链接]

20

主题

840

回帖

2270

积分

金牌会员

积分
2270
Microcharon

20

主题

840

回帖

2270

积分

金牌会员

积分
2270
2025-2-16 11:41:46 | 显示全部楼层 |阅读模式
为什么会出现 ping 重复现象,怎么解决。不过在 Windows 虚拟机上进行 ping 操作就没问题,来个大佬帮帮忙看看哪里配置有问题

在虚拟机 Rocky Linux (192.168.137.158) 上进行 ping

[ol]
  • Last login: Sun Feb 16 09:30:16 2025 from 192.168.137.1
  • [microcharon@localhost ~]$ ping bing.com
  • PING bing.com (13.107.21.200) 56(84) 比特的数据。
  • 64 比特,来自 13.107.21.200 (13.107.21.200): icmp_seq=1 ttl=110 时间=36.6 毫秒
  • 64 比特,来自 13.107.21.200 (13.107.21.200): icmp_seq=1 ttl=110 时间=36.6 毫秒 (DUP!)
  • 64 比特,来自 13.107.21.200 (13.107.21.200): icmp_seq=2 ttl=110 时间=36.5 毫秒
  • 64 比特,来自 13.107.21.200 (13.107.21.200): icmp_seq=2 ttl=110 时间=36.5 毫秒 (DUP!)
  • 64 比特,来自 13.107.21.200 (13.107.21.200): icmp_seq=3 ttl=110 时间=36.4 毫秒
  • 64 比特,来自 13.107.21.200 (13.107.21.200): icmp_seq=3 ttl=110 时间=36.4 毫秒 (DUP!)
  • 64 比特,来自 13.107.21.200 (13.107.21.200): icmp_seq=4 ttl=110 时间=36.5 毫秒
  • 64 比特,来自 13.107.21.200 (13.107.21.200): icmp_seq=4 ttl=110 时间=36.5 毫秒 (DUP!)
  • ^C
  • --- bing.com ping 统计 ---
  • 已发送 4 个包, 已接收 4 个包, +4 重复, 0% packet loss, time 3004ms
  • rtt min/avg/max/mdev = 36.445/36.516/36.645/0.076 ms
  • [microcharon@localhost ~]$ cat /etc/resolv.conf
  • # Generated by NetworkManager
  • search mshome.net
  • nameserver 192.168.137.1
  • [microcharon@localhost ~]$ ip addr show
  • 1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
  •     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  •     inet 127.0.0.1/8 scope host lo
  •        valid_lft forever preferred_lft forever
  •     inet6 ::1/128 scope host
  •        valid_lft forever preferred_lft forever
  • 2: eth0:
    mtu 1500 qdisc mq state UP group default qlen 1000
  •     link/ether 00:15:5d:20:83:16 brd ff:ff:ff:ff:ff:ff
  •     inet 192.168.137.158/24 brd 192.168.137.255 scope global dynamic noprefixroute eth0
  •        valid_lft 649695sec preferred_lft 649695sec
  •     inet6 fe80::215:5dff:fe20:8316/64 scope link noprefixroute
  •        valid_lft forever preferred_lft forever
  • 3: eth1:
    mtu 1500 qdisc mq state UP group default qlen 1000
  •     link/ether 00:15:5d:20:83:29 brd ff:ff:ff:ff:ff:ff
  •     inet 192.168.138.3/24 brd 192.168.138.255 scope global noprefixroute eth1
  •        valid_lft forever preferred_lft forever
  •     inet6 fe80::215:5dff:fe20:8329/64 scope link noprefixroute
  •        valid_lft forever preferred_lft forever[/ol]复制代码

    在 Windows Server 2025 (192.168.137.2) 上进行 ping

    [ol]
  • PS C:\Users\Administrator> ping bing.com
  • 正在 Ping bing.com [13.107.21.200] 具有 32 字节的数据:
  • 来自 13.107.21.200 的回复: 字节=32 时间=38ms TTL=110
  • 来自 13.107.21.200 的回复: 字节=32 时间=36ms TTL=110
  • 来自 13.107.21.200 的回复: 字节=32 时间=37ms TTL=110
  • 来自 13.107.21.200 的回复: 字节=32 时间=36ms TTL=110
  • 13.107.21.200 的 Ping 统计信息:
  •     数据包: 已发送 = 4 ,已接收 = 4 ,丢失 = 0 (0% 丢失),
  • 往返行程的估计时间(以毫秒为单位):
  •     最短 = 36ms ,最长 = 38ms ,平均 = 36ms
  • PS C:\Users\Administrator> ipconfig
  • Windows IP 配置
  • 以太网适配器 以太网 4:
  •    连接特定的 DNS 后缀 . . . . . . . :
  •    本地链接 IPv6 地址. . . . . . . . : fe80::ff1f:adde:ba03:6d42%18
  •    IPv4 地址 . . . . . . . . . . . . : 192.168.137.2
  •    子网掩码  . . . . . . . . . . . . : 255.255.255.0
  •    默认网关. . . . . . . . . . . . . : 192.168.137.1
  • [/ol]复制代码
    Hyper-V 创建的内部虚拟交换机“Internal Virtual Switch”,其网络适配器 IP 配置

    [ol]
  • PS C:\Users\Administrator> Get-NetIPAddress -InterfaceAlias "vEthernet (Internal Virtual Switch)"
  • IPAddress         : fe80::1d6f:a2ca:16b:bafb%4
  • InterfaceIndex    : 4
  • InterfaceAlias    : vEthernet (Internal Virtual Switch)
  • AddressFamily     : IPv6
  • Type              : Unicast
  • PrefixLength      : 64
  • PrefixOrigin      : WellKnown
  • SuffixOrigin      : Link
  • AddressState      : Preferred
  • ValidLifetime     : Infinite ([TimeSpan]::MaxValue)
  • PreferredLifetime : Infinite ([TimeSpan]::MaxValue)
  • SkipAsSource      : False
  • PolicyStore       : ActiveStore
  • IPAddress         : 192.168.137.1
  • InterfaceIndex    : 4
  • InterfaceAlias    : vEthernet (Internal Virtual Switch)
  • AddressFamily     : IPv4
  • Type              : Unicast
  • PrefixLength      : 24
  • PrefixOrigin      : Manual
  • SuffixOrigin      : Manual
  • AddressState      : Preferred
  • ValidLifetime     : Infinite ([TimeSpan]::MaxValue)
  • PreferredLifetime : Infinite ([TimeSpan]::MaxValue)
  • SkipAsSource      : False
  • PolicyStore       : ActiveStore
  • [/ol]复制代码[ol]
  • PS C:\Users\Administrator> Get-VMNetworkAdapter -VMName "Rocky Linux 9" | Select VMName,Name,MacAddress,IPAddresses
  • VMName        Name       MacAddress   IPAddresses
  • ------        ----       ----------   -----------
  • Rocky Linux 9 网络适配器 00155D208316 {192.168.137.158, fe80::215:5dff:fe20:8316}
  • Rocky Linux 9 网络适配器 00155D208329 {192.168.138.3, fe80::215:5dff:fe20:8329}[/ol]复制代码

    DHCP 相关配置

    [ol]
  • PS C:\Users\Administrator> Get-DhcpServerv4Scope
  • ScopeId         SubnetMask      Name           State    StartRange      EndRange        LeaseDuration
  • -------         ----------      ----           -----    ----------      --------        -------------
  • 192.168.137.0   255.255.255.0   Internal Vi... Active   192.168.137.2   192.168.137.254 8.00:00:00
  • PS C:\Users\Administrator> Get-DhcpServerv4Lease -ScopeId 192.168.137.0
  • IPAddress       ScopeId         ClientId             HostName             AddressState         LeaseExpiryTime
  • ---------       -------         --------             --------             ------------         ---------------
  • 192.168.137.2   192.168.137.0   00-15-5d-20-83-09    WIN-LBFVIUCFGHO      Active               2025/2/23 23:06:34
  • 192.168.137.3   192.168.137.0   5d-20-83-1d-00-01...                      Active               2025/2/23 23:06:31
  • 192.168.137.89  192.168.137.0   00-15-5d-20-83-0b                         Active               2025/2/23 23:06:34
  • 192.168.137.133 192.168.137.0   00-15-5d-20-83-05    debian               Active               2025/2/23 23:06:31
  • 192.168.137.158 192.168.137.0   00-15-5d-20-83-16                         Active               2025/2/23 23:06:29
  • 192.168.137.167 192.168.137.0   00-15-5d-20-83-0d    localhost            Active               2025/2/23 23:06:49
  • 192.168.137.227 192.168.137.0   00-15-5d-20-83-0c                         Active               2025/2/23 23:06:34
  • PS C:\Users\Administrator> Get-DhcpServerv4OptionValue -ScopeId 192.168.137.0
  • OptionId   Name            Type       Value                VendorClass     UserClass       PolicyName
  • --------   ----            ----       -----                -----------     ---------       ----------
  • 51         租约            DWord      {691200}
  • 3          路由器          IPv4Add... {192.168.137.1}
  • 6          DNS 服务器      IPv4Add... {192.168.137.1}[/ol]复制代码

    DNS 转发器设置

    [ol]
  • PS C:\Users\Administrator> Get-DnsServerForwarder
  • UseRootHint        : True
  • Timeout(s)         : 3
  • EnableReordering   : True
  • IPAddress          : {119.29.29.29, 223.5.5.5}
  • ReorderedIPAddress : {119.29.29.29, 223.5.5.5}[/ol]复制代码

    NAT 网络配置

    [ol]
  • PS C:\Users\Administrator> Get-NetNat
  • Name                             : Primary-NAT
  • ExternalIPInterfaceAddressPrefix :
  • InternalIPInterfaceAddressPrefix : 192.168.137.0/24
  • IcmpQueryTimeout                 : 30
  • TcpEstablishedConnectionTimeout  : 1800
  • TcpTransientConnectionTimeout    : 120
  • TcpFilteringBehavior             : AddressDependentFiltering
  • UdpFilteringBehavior             : AddressDependentFiltering
  • UdpIdleSessionTimeout            : 120
  • UdpInboundRefresh                : False
  • Store                            : Local
  • Active                           : True[/ol]复制代码
  • 回复

    使用道具 举报

    20

    主题

    840

    回帖

    2270

    积分

    金牌会员

    积分
    2270
    Microcharon 楼主

    20

    主题

    840

    回帖

    2270

    积分

    金牌会员

    积分
    2270
    2025-2-16 14:22:49 | 显示全部楼层



    [ol]
  • [root@localhost ~]# tcpdump -i any icmp
  • tcpdump: data link type LINUX_SLL2
  • dropped privs to tcpdump
  • tcpdump: verbose output suppressed, use -v[v]... for full protocol decode
  • listening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes
  • 14:14:58.472873 eth0  Out IP localhost.localdomain > 20.205.243.166: ICMP echo request, id 5, seq 1, length 64
  • 14:14:58.581189 eth0  In  IP 20.205.243.166 > localhost.localdomain: ICMP echo reply, id 5, seq 1, length 64
  • 14:14:59.474350 eth0  Out IP localhost.localdomain > 20.205.243.166: ICMP echo request, id 5, seq 2, length 64
  • 14:14:59.582625 eth0  In  IP 20.205.243.166 > localhost.localdomain: ICMP echo reply, id 5, seq 2, length 64
  • 14:15:00.475622 eth0  Out IP localhost.localdomain > 20.205.243.166: ICMP echo request, id 5, seq 3, length 64
  • 14:15:00.571066 eth0  In  IP 20.205.243.166 > localhost.localdomain: ICMP echo reply, id 5, seq 3, length 64
  • 14:15:01.477195 eth0  Out IP localhost.localdomain > 20.205.243.166: ICMP echo request, id 5, seq 4, length 64
  • 14:15:01.583919 eth0  In  IP 20.205.243.166 > localhost.localdomain: ICMP echo reply, id 5, seq 4, length 64[/ol]复制代码
    [ol]
  • [microcharon@localhost ~]$ ping github.com
  • PING github.com (20.205.243.166) 56(84) 比特的数据。
  • 64 比特,来自 20.205.243.166 (20.205.243.166): icmp_seq=1 ttl=108 时间=108 毫秒
  • 64 比特,来自 20.205.243.166 (20.205.243.166): icmp_seq=2 ttl=108 时间=108 毫秒
  • 64 比特,来自 20.205.243.166 (20.205.243.166): icmp_seq=3 ttl=108 时间=95.5 毫秒
  • 64 比特,来自 20.205.243.166 (20.205.243.166): icmp_seq=4 ttl=108 时间=107 毫秒
  • ^C
  • --- github.com ping 统计 ---
  • 已发送 4 个包, 已接收 4 个包, 0% packet loss, time 3004ms
  • rtt min/avg/max/mdev = 95.482/104.727/108.349/5.375 ms[/ol]复制代码

    关闭这个 Hyper-V 可扩展的虚拟交换机就好了,这是怎么回事,有无大佬解释一下
  • 回复

    使用道具 举报

    326

    主题

    1153

    回帖

    4364

    积分

    论坛元老

    积分
    4364
    yanzhiling2002

    326

    主题

    1153

    回帖

    4364

    积分

    论坛元老

    积分
    4364
    2025-2-16 15:16:10 | 显示全部楼层
    Hyper-V 虚拟交换机的负载均衡策略可能导致网络包重复
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    Archiver|小黑屋|HS2V主机综合交流论坛

    GMT+8, 2025-3-6 22:13 , Processed in 0.016319 second(s), 2 queries , Gzip On, Redis On.

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表