all that is technology

Peer to Peer networking with Raspberry Pi


In this post, I'll explain how to setup a peer-to-peer local network between Windows 7 machine and the Raspberry Pi. The raspbian version I used is 2012-12-16-wheezy-raspbian.

For networking we require an ethernet crossover cable. (Some say that pi does automatic crossover and hence straight cable is sufficient, however, I haven't checked it yet.)

First connect both the machines with the ethernet cable, then make a note of windows IP address and Subnet Mask. This is essential, because, the static IP that we assign to the pi should be in the same subnet. Though this is obvious, most of the time people forget it (as I did) and assign IP under different subnet; which will never work without a switch, hub or router. Alternatively, both windows IP and pi's IP could be manually configured with same subnet. However since windows assign an IP automatically, it is sufficient to configure only the pi.

Fine, in my case, following is my windows IP configuration.

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . :
   Autoconfiguration IPv4 Address. . :
   Subnet Mask . . . . . . . . . . . :
   Default Gateway . . . . . . . . . :

So, accordingly configure pi. Edit the interface file /etc/network/interfaces and make sure the following content is fed.

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static

Restart the network $ sudo /etc/init.d/networking restart and ensure the settings are reflected. Also, check if the SSH server is enabled, else enable it.

Thats it. On windows use PuTTY to establish the SSH connection with pi.

I'm now working on sharing internet from Windows to Pi.