locked
Two default gateway 0.0.0.0, different metric RRS feed

  • Question

  • Hi:

    I've started a virtual machine which has two nics with qemu-kvm on server 192.168.6.2, one nic with qemu-kvm param "-redir tcp:40037::3389" is in "user" mode which IP is 10.0.2.15, so if I connect to 192.168.6.2:40037, it will map to 10.0.2.15:3389, the other is in bridge mode which IP is 192.168.6.100, my pc is 192.168.6.220, In the vm, "route print" shows two default gateway as below:

    0.0.0.0          0.0.0.0      192.168.6.1    192.168.6.100    5
    0.0.0.0          0.0.0.0      10.0.2.2          10.2.2.15    5

    When I use my pc connect to 192.168.6.2:40037, always cat not connect, so I change the metric value to 100 of 10.0.2.2, it works well.I am confusing. My question is:

    I capture packet on nic 10.0.2.15, when connect, the src IP  is 192.168.6.220, src mac is the mac of 10.0.2.2, all these are right, but when reply, why it still select default gateway of 10.0.2.2? I mean the dst is 192.168.6.220 and there is a route item like:

    192.168.6.0    255.255.255.0            on-link     192.168.6.100    261

    why doesn't it choose this one?

    Or it doesn't find routing table at all when reply, just according to the receive interface? But if really this, why doesn't it work when metric value are the same? 

    Or it doesn't find routing table at all when reply, just according to the src mac, then find arp cache of two interfaces? But when I delete arp cache, it still works well...

    Any help will be appriciated

    Thanks & Regards

    • Edited by GanderGoose Wednesday, December 28, 2016 5:16 AM
    Tuesday, December 27, 2016 9:54 AM

All replies

  • Hi,

    We could try to open a CMD window and run ipconfig /flushdns and check if it helps.

    Have you tried resetting TCP/IP then setting again your IP settings? If not, please try it.

    https://support.microsoft.com/en-gb/kb/299357

    In addition, this article may help you, please refer to the link:

    The Default Gateway may have been set to 0.0.0.0 on a Windows Vista-based or later OS running Apple’s Bonjour service

    https://support.microsoft.com/en-us/kb/970313

    Best Regards,

    Tao


    Please remember to mark the replies as answers if they help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, December 28, 2016 8:54 AM
  • Hi,thank you for your reply.

    But my question is why receive from interface which IP is 10.0.2.15, reply still select this interface?. I mean the dst IP is 192.168.6.220 when reply , why doesn't it choose the route item

    192.168.6.0    255.255.255.0            on-link     192.168.6.100    261

    and select the other interface which IP is 192.168.6.100?

    The screenshot of Wireshark is 

    • Edited by GanderGoose Monday, January 9, 2017 7:14 AM
    Thursday, December 29, 2016 2:04 AM