Direct Network Connection Between Windows PC and Raspberry Pi

145,875

113

48

Published

Introduction: Direct Network Connection Between Windows PC and Raspberry Pi

About: Engineer. Educator. Entrepreneur.

Here's a simple method to connect to your Raspberry Pi through SSH from a Microsoft Windows based PC or Laptop.

All you need is :

1. A Windows based machine with an Ethernet adapter
2. An Ethernet cable (a normal patch cord or a crossover cable - both work)
3. A Raspberry Pi Model B

Unlike most of the other methods described online, you do not need to :

1. Use an Ethernet or WiFi router
2. Have a monitor or any display connected to the Raspberry Pi
3. Have a keyboard connected to the Raspberry Pi
4. Edit any files on the Raspberry Pi's SD Card


Here's how to proceed.

1. Download DHCP Server for Windows. It is a 100kB download available here.
2. Go to the IPv4 properties page of the Ethernet adapter and set a fixed IP address, say 192.168.2.1
3. Run the DHCP Server Wizard (downloaded above)
4. Select the Ethernet adapter from the list shown
5. Save the configuration file and start up the DHCP Server
6. Click the 'Continue as tray app' button in the server control panel.
7. Boot up the Raspberry Pi
8. A popup notification shows the IP address assigned by the DHCP server to the Raspberry Pi.
9. Use a SSH client, like PuTTy, to connect to the IP address shown

Voila ! You are connected to your Raspberry Pi.

Share

    Recommendations

    • Clocks Contest

      Clocks Contest
    • Casting Contest

      Casting Contest
    • Woodworking Contest

      Woodworking Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    48 Comments

    Hello,

    After a lot of trials, this way of connecting raspberry pi and my laptop works for me. I do not know the details of dhcp, or how to do it manually on windows 7 , but it works. Thank you for sharing the info.

    Thank you very much for the info.

    Is there some limitation causing that I'm not able to connect my RPiB+ over patchcord (directly connected to laptop) USING FIXED IP ADDRESS?

    I wanted RPiB+ to use fixed IP address instead of DHCP, so I set it; now it works when RPiB+ is connected to my local LAN over switch (and router), but when I connect it directly to my laptop (with accordingly changed IP address of laptop), it does not work!? I have already tried a lot of possibilities, but still no ping...

    Does RPiB+ remember previous MAC address of router, so after connecting laptop with other MAC address it refuses to connect? Or something else? Thanks for any idea... #J

    1 reply

    An older thread, but I'm posting some info for those who are reading this.

    "Does RPiB+ remember previous MAC address of router,"

    Simple home-type switches and routers do NOT use MAC or IP addresses.

    Needed to disable firewall for ethernet connections and only then my B+ connected.

    can i also share pc internet on my pi via this method

    what if my rasberrypi runs a windows 10 IOT??

    I have followed your instructions but get the following error:

    "Network error: Connection refused", when I try to run PuTTy.

    Please help.

    Thanks

    Alan

    Tried this but DHCP server still disabled & unable to obtain status from DHCP server.

    Any ideas ?

    Alan

    Thanks for the help :)

    yay, thanks for the tutorial, after some attempts I got it running

    Fantastic start! Some extra info:

    You can connect the R.Pi to the internet by adding some routing info like this:

  • sudo ip route delete default dev eth0
  • sudo ip route add default via <windows box ip address>
  • Its fine till step 7, but I did not get any pop-up notification. I've tried it twice and checked everything.How do I get it to work?

    4 replies

    hi h3manth, i'm not sure why the pop-up notification is not coming up. when selecting the ethernet adapter while installing the dhcp server, ensure that it shows the IP address you configured previously. If it is showing 0.0.0.0 next to the ethernet adapter, it may cause a problem.

    The IP address is showing 0.0.0.0 in the dhcp server, and you're right, it's causing a problem. I don't ever get a pop up. As far as I can tell I have my local area connection ipv4 set up correctly according to your video. I've tried several different IPs but it just keeps showing 0.0.0.0. How do I fix this?

    Hello bhulsey1,

    Did you get your problem solved. I am having the same problem. If you did get this fixed, could you tell me what you did?

    Hi

    i experienced the same issue too. However, once i tried booting up the Rpi and connecting it to the laptop via the ethernet cable, then followed by setting up of DHPC wiz, the problem is gone.

    Hope that helps the rest who are experiencing the 0.0.0.0 issue.

    thank you!! worked for me ... as my raspberry pi address was in different network and my laptop was connected to different network, I had to set the gateway address equal to the ip assigned by dhcp to my laptop .

    sir if i connect my raspberry pi to router of my pc with ethernet cable and use the steps of this in my pc will this post help me?

    Thanks! It works perfect.