liulilittle/VEthernet

Connectivity Status

AhmedZero opened this issue · 1 comments

why some programs using NLM_CONNECTIVITY makes offline when I use Tun2socks like TopTracker ?

tun2socks the vNIC is not active (not the preferred network, or not connected to the internet).

  1. Physical NIC is not connected to the internet.

  2. TAP-diver handle is CloseHandle.

  3. tun2socks Implement has problems, such as magic changes based on LwIP, but many things are not done well.

  4. tun2socks recv-packet loop stops.

  5. No valid physical outbound IPv4/6 route exists.
    For example:
    Physical-NIC, 192.168.0.7 255.255.255.0 192.168.0.1
    tunsocks-vNIC,10.0.0.1 255.255.255.0 10.0.0.0(TAP-Windows Gateway)

    tun2socks server-IP (TCP/IP),172.16.43.55
    tun2socks server-IP(UDP/IP),172.16.43.77
    

    So,IPv4 routes need to be configured(Physical hosted network)
    route add 172.16.43.55 mask 255.255.255.255 192.168.0.1
    route add 172.16.43.77 mask 255.255.255.255 192.168.0.1

    And,tun2socks TAP/TUN vNIC route table configuration
    route add 0.0.0.0 mask 0.0.0.0 10.0.0.0
    route add 0.0.0.0 mask 128.0.0.0 10.0.0.0
    route add 128.0.0.0 mask 128.0.0.0 10.0.0.0

    Delete the "physical hosted network" routing table
    route delete 0.0.0.0 mask 0.0.0.0 192.168.0.1
    route delete 0.0.0.0 mask 128.0.0.0 192.168.0.1 [if exists, delete]
    route delete 128.0.0.0 mask 128.0.0.0 192.168.0.1 [if exists, delete]

  6. TAP/TUN driver sets from "Down" to "Up" state, which will cause network switching, but will not cause "physical hosting NIC" to lose network.

  7. Based on VEthernet development, we recommend using .NET/FCL NetworkInterface API to track the network, followed by the PInvoke MIB_2 interface.

  8. [Common failures]vNIC and Physical-NIC IPv4/6 route table control, resulting in loss of Internet issues.

Check system IPv4 route table:
route PRINT -4

Check system IPv6 route table:
route PRINT -6

Added 1: NIC cannot be tracked by traffic, only the NIC device is deleted or converted to a "Down" state.
Added 2: TAP-Windows drivers do not support power optimization management.