Get IP_address for endpoint

Discussion in 'IP Phones' started by Elbhrawy, Jan 17, 2010.

  1. Elbhrawy

    Joined:
    Aug 5, 2009
    Messages:
    17
    Likes Received:
    0
    I need to make a function($network , $vendor ,$mac) and return the $ipaddress for the endpoint.
     
  2. danardf

    Joined:
    Dec 3, 2007
    Messages:
    8,069
    Likes Received:
    12
    Hi.

    You can use a shell cmd and take the result:

    # arp -n or
    # apr -a

    Play with the pipe - grep ( | grep ) to filter it.

    Use in same time: nmap -sP --send-ip -n 192.168.1.0/24 with also | grep the vendor.

    nmap -sP --send-ip -n 192.168.1.0/24 | grep Cisco for example.

    Like that with this cmd you have the Mac address, and with arp you may have the IP address.

    Now, with different php functions like explode for example, you can make what you want.

    It's a way... :cheer:
     

Share This Page