Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can't get MAC Address when connected via VPN

4 views
Skip to first unread message

Joseph Geretz

unread,
Apr 7, 2005, 8:13:41 PM4/7/05
to
I'm using Randy Birch's GetMacAddress function to get the MAC address of the
database server when the client software starts up.

http://vbnet.mvps.org/code/network/macaddressremote.htm

The crux of the function is the SendARP function:

Private Declare Function SendARP Lib "iphlpapi.dll" _
(ByVal DestIP As Long, _
ByVal SrcIP As Long, _
pMacAddr As Long, _
PhyAddrLen As Long) As Long

This is working fine, except for remote office clients which connect to the
internal subnet via VPN. these clients are able to cross lookup IP address
to the Host name and vice versa, but are unable to translate the IP address
to MAC address. Any ideas why SendARP would fail under this condition and
are there any workarounds which you can suggest?

Thanks immensely for any help which you can offer.

Joe Geretz


Harry Bates

unread,
Apr 21, 2005, 4:09:31 PM4/21/05
to
Just a guess, but depending on the VPN client you are using, it may create
it's own adapter & MAC address on the fly. Older Nortel clients do something
similar. In essence, the IP will not translate back to the NICs MAC address,
but back to the virtual adapters addressing layer. Also, some VPN clients
"lock out" all other network protocols and adapters to void creating a
multihomed exploitable workstation. Nortel also does this in some cases.
This might prohibit you from direct access via normal calls.

If you are looking for local MAC, you might want to enumerate the subkeys of

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards

then pull the GUID from the adapters. Compare the GUID to the subkeys of:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<GUID>

to get your IP Addressing. Use this addressing to poll for MAC.

Not sure if any of this helps, but it may help shed a little light on your
situation.

-Harry Bates
Lockheed-Martin

"Joseph Geretz" <jge...@nospam.com> wrote in message
news:OO4tW$8OFHA...@TK2MSFTNGP10.phx.gbl...

0 new messages