Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to determine the IP of my Raspberry Pi which is attached to my PC via Ethernet and has a dynamic IP.

share|improve this question
up vote 3 down vote accepted

Option 1:
Look into your DHCP Server. If it displays all DHCP leases, you can see it there.

Option 2:
Or try to find it in your arp table if you know your Raspberry PI's MAC address. Open a cmd prompt for that and type arp -a. It then shows you a list of all known IP-MAC pairs. If it's not in there, try to ping your broadcast address and enter arp -a again. The broadcast IP is always the last IP in your subnet. For example the broadcast IP of subnet is

Option 3:
You could also scan all devices in your network for an open port if you know a specific port that is only open on your Raspberry Pi. Say, your Raspberry Pi is open on port 80, you could scan all IP addresses in your subnet for port 80. If you don't have too much Webservers in your network (maybe only a few printers and routers of which you know the IP address of course), you will find your Raspberry Pi very quick.
Sadly, I don't know how to use nmap because I use a Powershell script to scan ports. I could paste it here if you want to try it. Simply let me know in the comments if you'd like to try my script.

Edit: Here's my script. Usage below.

function Test-Port {

        [parameter(Position=0)][string[]]$Computer=(Read-Host "Target: "),
        [parameter(Position=1)][string[]]$Port=(Read-Host "Ziel-Port: "),

$ErrorActionPreference = "SilentlyContinue"
$ResultObjects = @()

foreach ($Target in $Computer) {
    foreach ($p in $Port) {
        $ResultObjects += P_Test-Port
    } # end port foreach
} #end target foreach

return $ResultObjects
} #end function

function P_Test-Port {

        $tcpclient = new-object
        $con = $tcpclient.BeginConnect($Target,$p,$null,$null)
        $wait = $con.AsyncWaitHandle.WaitOne($timeout,$false)
        [bool]$Open = $false

        # check the connection
            # close connection and report timeout
            [string]$result = ("Connection Timeout (" + $Timeout + " ms)")
            $failed = $true
        } else {
            $tcpclient.EndConnect($con) | out-null
            if(!$?){[string]$result = ("Closed / Filtered");$failed = $true}
            [string]$result = ("Open")
            $failed = $false
            $Open = $true

        $objTestPortResult = new-object System.Object
        $objTestPortResult | Add-Member -type NoteProperty -name Host -value $Target
        $objTestPortResult | Add-Member -type NoteProperty -name Port -value $p
        $objTestPortResult | Add-Member -type NoteProperty -name Result -value $result
        $objTestPortResult | Add-Member -type NoteProperty -name Open -value $Open

        return $objTestPortResult

Copy this script and paste it into your powershell. You can then use it as follows:
Test-Port <IP-Address[]> <Port[]>

Example: Test-Port,AnyComputerName 80,443
This will scan the computers and AnyComputerName for open ports 80and 443. You can simply pass one argument for Computername and Port or pass multiple comma separated values.

To scan your whole subnet for port 80 you would do this as follows (assuming you're using subnet
$ips = 1..254 | Foreach-Object { "192.168.0.$_" } ; Test-Port $ips 80

Let me know if you need more information or simply give me the port that you want to scan for, I'll create your command for you then.

share|improve this answer
Yes please could you please post it. – gbhall Aug 12 '12 at 12:52
Appended my portscan script with short usage explanation... – wullxz Aug 12 '12 at 13:03
Thank you so much! You're an absolute legend! Looping through all IPs searching for port 22 did the trick. Brilliant script and I thank you again for all of your help. Hopefully it will help many more people because researching this not many easy solutions like the one given (albeit you had to write the script) were available. – gbhall Aug 12 '12 at 13:42
No problem. I just copied that script. It helped me many times before ;) btw: forgot to tell you how to filter the results. By adding | ? { $ -eq $true } you can just display the results where the port is open. – wullxz Aug 12 '12 at 14:02
Legend! Thank you again. Definitely keeping this in my toolkit. – gbhall Aug 12 '12 at 14:27

If you know the RasPi host name you can just ping it. If it responds tot the ping, it'll tell you it's IP address.

No script needed.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .