Identification of WAN Interfaces

Home Forums Discussions Support Portal Identification of WAN Interfaces

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #5387

    I’ve been playing around with the Driver and the nat solution and I noticed that the Internet Gateway Application and obviously the code of the advanced sample too does have a problem with the identification of wan interfaces.

    Problem: If a Dialup Connection is made the IP address which is associated to the WAN Adapter (Dialup Adapter, WAN Network Interface (IP)) is also shown in the IP Addresses Dialog of the Wireless LAN Adapter.

    That means, whenever a WAN Adapter is connected to the web the wireless adapter cannot be used as provider, because the IP Address used for NAT is not of the wireless adapter itself but of the WAN adapter.

    I’ve tried to find the problem, and what I found is that the Wireless Adapter is identified as a WAN Adapter by the provided code.
    The flag m_bIsWan is set to true on this adapter. So the IPAddress of the WAN interface is also added to the Wireless Network Connection.

    Also the icon of the Wireless Network Connection within Internet Gateway looks the same as the one of the WAN Network Interface.

    Any idea whats the problem?

    => There is also a virtual wifi hotspot (Windows 7 Hotspot) running on that Wifi Interface. This one has a network card as symbol and is the client (target) of the NAT.

    Vadim Smirnov

    Thank you for reporting this, but the more detailed network configuration would be appreciated. Like what network adapters do you have, what type and which of them are connected (ipconfig output?). And how Internet Gateway identifies these ones (may be screenshot?).

    Although, I have to note that Internet Gateway is just a sample coded in a day to demonstrate usage of WinpkFilter driver for NAT solutions. And of course it does not pretend to be a well tested end user application.


    Ok, I’ve found that problem on both of my machines. Here are some screenshots of one system. There is currently no Dialup Adapter connected, so I cannt show the screenshot where the wrong ip is added to the Wireless Lan Adapter.

    But as you can see my Wireless Network Interface (Drahtlosnetzwerkverbindung) is identified as a Dialup Adapter. The virtual Hotspot running on the same Adapter is identified as Network card.

    The adapter is a “Atheros AR9285 Wireless Network Adapter”

    As far as I can see the m_bIsWan flag is set to true when there are entries in the m_nAdapterMediumList in the method GetTcpipBoundAdaptersInfo of the kernel.
    What does the AdapterMediumList exactly represent?

    You said that the Nat Example is an example code which was quickly put together. Do you have some hints for me what you would advise me to improve so it gets even better. Maybe something to improve performance or functionality. Thinking about using multiple clients at the same time and I noticed that after a while of excessive using it sometimes drops the connection completly.
    So if there are any hints you can give, I’d like to improve the application. 😛

    Vadim Smirnov

    Internet Gateway code simply treats all adapters with media different from NdisMedium802_3 as WAN. This is not correct of course, but works for most cases and good enough for the sample. I think your intrface reports media different from 802.3 and this causes described misbehave. NDIS_MEDIUM is defined as following:

    typedef enum _NDIS_MEDIUM
    NdisMediumDix, // defined for convenience, not a real medium
    #endif // (NTDDI_VERSION >= NTDDI_VISTA)


    There are too many things to improve in this sample to build a real NAT aplication suitable for different environments and it would take plenty of time to build a desired list. You’d better look at some solutions alreaddy available on market to see what features can be implemented.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.