How to get assigned IPs by hostednetwork?

54,055

Solution 1

I've also had this problem, and I solved it like this:

  • create a WiFi hotspot:

    netsh wlan set hostednetwork mode=allow ssid=ProvaMi key=pippo123

    netsh wlan start hostednetwork

  • Assign the hotspot a name in the "Network and sharing center > change adapter settings" (in my case: "TestWIFI")

  • Set a static IP address for the WiFi network:

    netsh interface ip set address "TestWIFI" static 192.168.159.1 255.255.255.0 196.168.159.1

Now, using a program that provides a DHCP server on windows (http://www.dhcpserver.de/cms/), I configured the server to generate the

[SETTINGS]
IPPOOL_1=192.168.159.2-254
IPBIND_1=192.168.159.1
AssociateBindsToPools=1

Now, the DHCP server will update its own settings file (dhcpsrv.ini) with the IP address and the DNS name of any connected client.

Hope this helps.

Note: all the above (IP addresses, passwords, etc.) are examples for my test configuration. Of course you'd need to use your own settings.

Solution 2

arp -a will dump out your arp (or Address Resolution Protocol) tables - this is the mapping of ip addresses to mac address

then look for all dynamic addresses under the interface you are using - the output looks something like this/

Interface: 192.168.0.106 --- 0xe
  Internet Address      Physical Address      Type
  192.168.0.1           c4-a8-1d-84-f3-59     dynamic
  192.168.0.101         00-1e-8f-76-95-5e     dynamic
  192.168.0.105         00-10-75-57-7a-e8     dynamic
  192.168.0.126         00-1c-25-20-1a-a0     dynamic
  192.168.0.255         ff-ff-ff-ff-ff-ff     static
  224.0.0.22            01-00-5e-00-00-16     static
  224.0.0.251           01-00-5e-00-00-fb     static
  224.0.0.252           01-00-5e-00-00-fc     static
  224.0.0.253           01-00-5e-00-00-fd     static
  239.2.0.252           01-00-5e-02-00-fc     static
  239.192.152.143       01-00-5e-40-98-8f     static
  239.255.255.250       01-00-5e-7f-ff-fa     static
  255.255.255.255       ff-ff-ff-ff-ff-ff     static
Share:
54,055

Related videos on Youtube

Giovanni Mounir
Author by

Giovanni Mounir

Computer Programmer; C#, PHP, MySQL, HTML and Javascript developer

Updated on September 18, 2022

Comments

  • Giovanni Mounir
    Giovanni Mounir over 1 year

    I just started using Microsoft Virtual WiFi or hostednetwork from Command Prompt to share my internet connection through my WiFi adapter and it's good so far! The only issue I face however is that I can't find a way to display the assigned IP addresses to the clients connected to the Virtual WiFi, is this possible? If not, then how can I get the range of IPs that the client should have been assigned to when the client connected to the Virtual WiFi?

    I can see the clients on "My Network Places" however, from the client machine, when I see the assigned IP and try to ping it from the machine hosting the Virtual WiFi I get no response. So how can I get the client IP address in order to ping/connect to the client?

    Example: On my client's machine when I do ipconfig it shows an empty value for Default Gateway and the IP address is 192.168.137.1. However when I go to the machine which hosts the Virtual WiFi and ping that IP, I get no response

    Edit: typing netsh wlan show hostednetwork shows the current status of the Virtual WiFi, it also shows the MAC addresses of the connected clients, however it doesn't show the IPs unfortunately. Example:

    > netsh wlan show hostednetwork
    Hosted network settings
    -----------------------
        Mode                   : Allowed
        SSID name              : "Giovanni-PC"
        Max number of clients  : 100
        Authentication         : WPA2-Personal
        Cipher                 : CCMP
    
    Hosted network status
    ---------------------
        Status                 : Started
        BSSID                  : 56:5a:04:6f:88:09
        Radio type             : 802.11n
        Channel                : 11
        Number of clients      : 1
            00:19:32:45:71:da        Authenticated <-- (a client)
    

    Edit 2: On the client's machine, there's no value for Default Gateway. I'm also not sharing an internet connection, I just want to connect to the client's machine through FTP to copy data, could this be the problem?

  • Giovanni Mounir
    Giovanni Mounir almost 10 years
    On which device? I looked on the client and did so, it showed: DHCP Enabled: No, IPv4 Address: 192.168.137.1. However trying to ping that IP address from the host machine doesn't work. Any thoughts?
  • DragoonHP
    DragoonHP almost 10 years
    Run this command on the host machine.
  • Giovanni Mounir
    Giovanni Mounir almost 10 years
    IP Address on host machine is: 192.168.173.1. Host enabled: Yes. Autoconfiguration Enabled: Yes.
  • DragoonHP
    DragoonHP almost 10 years
    You should see something like this: i.imgur.com/SdAAIiW.png
  • Giovanni Mounir
    Giovanni Mounir almost 10 years
    That's what I see! (Host) IPv4 Address: 192.168.173.1. (Client) IPv4 Address: 192.168.137.1
  • DragoonHP
    DragoonHP almost 10 years
    Weird, I just checked and ping works fine for me. Check to see if the connection is established properly. Share a folder or drive and check to see if you can access if from your client/host. Sorry I couldn't be of much help.
  • Giovanni Mounir
    Giovanni Mounir almost 10 years
    It says Limited Access on my client's machine although I'm sharing internet connection now. I even switched to Connectify and shared the internet connection through the WiFi and it still shows Limited Access. Did a /release and /renew but it's still the same thing. Also restarted the host system. What's weird is that it shows that DHCP is not enabled on the client system however on the host it says that DHCP is enabled. That's also fine however, thanks for trying! Hugely appreciated.
  • Giovanni Mounir
    Giovanni Mounir almost 10 years
    Just worked on my Windows XP! I can ping the machine's IP now! Although on Windows 7 this wasn't possible, I think it was a problem with the client machine anyways. This time I used Windows XP to host the adhoc network however; Windows 7 as a host machine caused the same issue. Thank you for all your help!
  • ganesh
    ganesh over 8 years
    This answer might be correct but it needs some fleshing out. E.g. Why does that work? What does it do. Tell that arp -a shows the arp cache, etc etc
  • katriel
    katriel about 8 years
    In conjunction with netsh wlan show hostednetwork, this gives me the IPs of clients which is what I came here looking for
  • Daniel Möller
    Daniel Möller almost 8 years
    "...of course you'd need to use your own settings." --- Ok, I'm a newbie here, but what should my own settings be? Based on what? How do I choose an IP, a gateway? What are the rules for the "hosted network" and the client's ip/gateway/DNS?
  • Alec Istomin
    Alec Istomin over 6 years
    in windows 10 you can get the list for single interface: arp -a -N 192.168.137.1
  • elliotching
    elliotching about 5 years
    Actually any number can be use since this is just local usage. But mostly in common we always seen ip start with 192.168.XXX.XXX in anywhere regarding to IP address especially TP-LINK / DLink home router. So we could follow that number. Now if you have done started up your hostednetwork, you could type "ipconfig" in command promp windows. And you should saw your ip address is already here and just use that ip. follow Nova's answer accordingly with your own ip address. About subnet mask, please use 255.255.255.0.