I’m no networking expert but I’ve figured this out after a few hours of on the Googles. I’m using an old VGA monitor and an RCA to VGA converter to get terminal access to the Raspberry Pi in order to change it’s network settings (yeah it’s pretty stupid). I’d like to go headless and not have to use this janky setup with a baby wireless keyboard.
I assume that you’ve already connected your Raspberry Pi to your computer that’s running Windows 7 via an Ethernet cable.
Let’s start with changing the network settings on the Raspberry Pi. I like using vim, but you can also use nano or simple vi in order to edit the file. Remember to sudo if you don’t have root permission.
$ sudo vim /etc/network/interfaces
Your file may look like the following, and may also include lines configuring wlan0 (probably your usb WIFI dongle):
# /etc/network/interfaces auto lo eth0 iface lo inet loopback iface eth0 inet dhcp
You’ll want to change thehe fo line containing the eth0 dhcp configuration to static as well as defining what those static parameters are going to be. Like So…
# /etc/network/interfaces auto lo eth0 iface lo inet loopback iface eth0 inet static address 192.168.1.2 netmask 255.255.255.0 gateway 192.168.1.3
Take note of the address and gateway, we’ll need these later. The Host ID portion (the last set of numbers in the dotted-decimal-notation) of the address and gateway. You can choose a Host ID of any number between 0 and 254 (255 is reserved for broadcast). I chose 2 and 3 for simplicity.
Either reboot the Pi or stop and start the network interface.
$ sudo /etc/init.d/networking stop $ sudo /etc/init.d/networking start
You can double check everything worked by running ifconfig.
$ ifconfig eth0 Link encap:Ethernet HWaddr b8:27:eb:75:3f:6f inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1450 errors:0 dropped:0 overruns:0 frame:0 TX packets:792 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:152906 (149.3 KiB) TX bytes:129553 (126.5 KiB)
Now, in Windows 7…
Open Network and Sharing Center from the Start Menu
Click on Change adapter settings on the left hand side
Now you’ll be given a list of network adapters, hopefully yours is shorter than mine, I’ve got a lot of junk going on. Identify the network adapter that your Ethernet cable/Raspberry Pi are connected to. For me, Unidentified network seemed fun and I know my Ethernet adapter is Broadcom something or other, so I figured Local Area Connection is what I wanted.
And this is where the magic happens. Select Use the following IP address radio button (if there’s already information, write it down so you can revert it back when you want to use the internet again). Input the same thing you had on the Raspberry Pi EXCEPT set the Default gateway to the IP address of the Raspberry Pi and the IP address to the gateway of the RaspberryPi (flip flop). The Subnet mask remains the same for both.
Hit OK on the dialogue box… and the next one.
Now Windows 7 should pop up saying it recognized a new network (it won’t if you ticked the “don’t ask me again” previously). Select Home since we trust the Raspberry Pi.