Posts: 2
Joined: Fri Apr 05, 2013 7:16 pm
Location: NC, USA

Accessing Internet and SSH through Ethernet from Windows

Sun Apr 07, 2013 12:12 am

This guide explains how to access RPi using ssh and share the internet of your windows machine using the same ethernet terminal. (Assuming Windows has wifi internet access)


[*] No need of a monitor or TV, HDMI cable, keyboard etc
[*] Can use your laptop to access the RPi terminal using Putty (SSH)
[*] Can access ssh and internet through one single ethernet connection


[*]this guide assumes that you have windows 8 as your development platform. But the steps should be similar to other windows versions.
[*]This post assumes that you have access to your raspbian filesystem and you are able to edit files in RPi either using ssh terminal / using a usb keyboard or using your sdcard on a linux laptop (windows can't read raspbian file system)
[*] Requires "putty" to be installed on your windows system.

Step 1. First share your existing wifi internet on windows. For this go to Network and Sharing center -> Change adapter settings ->Right click on wifi network -> properties -> click sharing tab -> check “allow users to access the internet”. That completes the configuration on windows side. Now we can start configuring the RPi connection.

Important Note :

On most of the machines when you click OK after checking the “allow users to access the internet you...” option, Windows will automatically assign an ip to the ethernet port and will display it to you as an alert. In my case it was In case Windows assigns your IP to please understand that all the “192.168.0” corresponds to “192.168.137” in rest of this document. Otherwise go ahead with a static IP of

Step 2. Set up a static ip for the Ethernet Connection in your machine for eg: ( or the ip assigned by windows as mentioned in step 1) For this go to Network and Sharing center -> Change adapter settings -> Right click on Ethernet -> Properties -> Select IPv4 -> Properties -> and configure a static ip. See screenshot below
screenshot.jpg (55.65 KiB) Viewed 11145 times
3. SSH to RPi and edit the /etc/network/interfaces file using following command

Code: Select all

sudo nano /etc/network/interfaces	

Configure it as shown below:
screenshot2.jpg (52.39 KiB) Viewed 11145 times
Press Ctrl+O and then enter to save. This file is where all the network configurations are made. Ignore first 2 lines. It is the configuration for loop back adapter. The next two paragraphs configures the Ethernet and wifi of the Rpi. Here Ethernet uses static ip (or if windows assigned to PC) and netmask and gateway (which is the ip that we configured for the machine) . Similarly wifi is configured in the next paragraph. Ignore the wifi configuration too. We are just interested in the ethernet (eth0) paragraph.

If you have the Ethernet configuration like this, you can ssh to your raspberry pi using any laptop through Ethernet provided the Ethernet ip on the laptop is set as

4. Now comes the part where RPi access the internet of our machine. We know the gateway is We should let RPi know this ip (the nameserver). For this edit the /etc/resolv.conf file using the command below.

Code: Select all

sudo nano /etc/resolv.conf

Change your nameserver to
That is it. Now if we restart our RPi and ssh to it ( via windows, we will have the internet shared from your laptop to RPi. This is a big step as we can now install all the softwares using

Code: Select all

sudo apt-get install <package name> 
or update raspbian using

Code: Select all

sudo apt-get update
as well as ssh to the Rpi using the same ethernet connection. Now to check if the RPi has internet we can use the following command, basically it downloads the webpage which is not possible without internet connection.

Code: Select all

wget http://www.google.com
If this command copies the website to your home page.... cout<< "mission accomplished :D"

If you want to do the same with a Linux (Ubuntu) machine follow this link
http://www.raspberrypi.org/phpBB3/viewt ... 26&t=13211

Posts: 12
Joined: Thu Jan 05, 2012 1:56 pm

Re: Accessing Internet and SSH through Ethernet from Windows

Tue Apr 23, 2013 11:51 am

This works fine for Win7 as well.

Just a point of note to anyone who cannot see the sharing tab (see step 1): make sure that internet sharing is not enabled for the ethernet connection already. If it is, you will not be able to enable it for the wifi connection (in my experience).

Posts: 6
Joined: Thu Aug 22, 2013 7:18 pm

Re: Accessing Internet and SSH through Ethernet from Windows

Tue Aug 27, 2013 2:49 pm

I think assigning static ips to the ethernet connection on the PC and to the raspberry Pi makes it unnecessarily complicated. Instead of assigning static ips, just install samba on the PI.

Code: Select all

sudo apt-get install samba
With samba installed, you can find the IP of your PI anytime using the ping command from windows command line

Code: Select all

ping raspberrypi 
where raspberrypi is the hostname of your PI.

The ping would return the IP address assigned to PI using DHCP. Now you can ssh into PI using the IP address returned.

Posts: 2
Joined: Fri Dec 13, 2013 6:10 am

Re: Accessing Internet and SSH through Ethernet from Windows

Sat Jan 04, 2014 6:36 pm

Tried this, doesn't work .The default gateway is the same as the IP address. This does not make sense. Please advise.

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 22 guests