jwilliams991
Posts: 31
Joined: Thu Jul 12, 2012 5:02 pm
Location: Norwich
Contact: Website Yahoo Messenger

Can I share my laptop's internet connection?

Wed Sep 05, 2012 5:29 pm

Can I use an ethernet cable to connect my Raspberry Pi to my Laptop and then share my Laptop's internet connection? If so then how?
Jake Williams

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25433
Joined: Sat Jul 30, 2011 7:41 pm

Re: Can I share my laptop's internet connection?

Wed Sep 05, 2012 5:32 pm

Yes, I believe you can, is your laptop running windows or Linux?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

jwilliams991
Posts: 31
Joined: Thu Jul 12, 2012 5:02 pm
Location: Norwich
Contact: Website Yahoo Messenger

Re: Can I share my laptop's internet connection?

Wed Sep 05, 2012 5:38 pm

jamesh wrote:Yes, I believe you can, is your laptop running windows or Linux?
windows
Jake Williams

User avatar
Licaon_Kter
Posts: 240
Joined: Wed Sep 05, 2012 10:12 am
Location: Between the keyboard and the chair.

Re: Can I share my laptop's internet connection?

Wed Sep 05, 2012 5:48 pm

set up windows ethernet: 192.168.100.1
set up windows wireless connection internet connection share
set up linux ethernet: 192.168.100.2
set up linux gateway: 192.168.100.1
set up linux dns 208.67.222.222

end
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)

jwilliams991
Posts: 31
Joined: Thu Jul 12, 2012 5:02 pm
Location: Norwich
Contact: Website Yahoo Messenger

Re: Can I share my laptop's internet connection?

Wed Sep 05, 2012 6:03 pm

Licaon_Kter wrote:set up windows ethernet: 192.168.100.1
set up windows wireless connection internet connection share
set up linux ethernet: 192.168.100.2
set up linux gateway: 192.168.100.1
set up linux dns 208.67.222.222

end
Do you put this in the config.txt or in the command line or what?
Jake Williams

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Can I share my laptop's internet connection?

Wed Sep 05, 2012 6:39 pm

The above instructions were very unhelpful.

To make sense of the above instructions...

Search the internet for "windows network bridge"
Search the internet for "windows set static ip address"
Search this forum for "set static address"

You may find the following thread useful
http://www.raspberrypi.org/phpBB3/viewt ... 26&t=12601

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Can I share my laptop's internet connection?

Wed Sep 05, 2012 6:52 pm

I find both of the last two helpful posts less than helpful.

IMHO, the most straightforward way to do this is to use "Internet Connection Sharing" on the Windows side. Now, I can't tell you directly how/where to find this in the Windows GUI stuff, because:

1) On XP, I can not really tell you where it is, since every time I've had to set it up, I've had to rummage through the various control panels to find it. And I don't remember now where it is, but it is easy to find.

2) Most people now are probably using Vista (puke) or 7 (retch), so any instructions I could give from XP probably wouldn't help anyway. But the point is, in any case, you should be able to find it.

Anyway, once you turn ICS on, then all you have to do is run a cable from the ethernet port on the Windows machine to the ethernet port on the Pi and it should "just work". The Pi will be able to access the Internet via the Wireless (or whatever the "main" connection on the Windows box is) connection. No setup is necessary on the Pi side (as long as the Pi is setup to use DHCP, as it is unless you've changed that).
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

User avatar
Licaon_Kter
Posts: 240
Joined: Wed Sep 05, 2012 10:12 am
Location: Between the keyboard and the chair.

Re: Can I share my laptop's internet connection?

Thu Sep 06, 2012 1:04 am

Since you said you use Windows I ( wrongfully) presumed you know how to use it.

> set up windows ethernet: 192.168.100.1
in Windows set up your ethernet card

> set up windows wireless connection internet connection share
In Windows set up your wireless card to

> set up linux ethernet: 192.168.100.2
> set up linux gateway: 192.168.100.1
these are here: http://elinux.org/RPi_Setting_up_a_static_IP_in_Debian

> set up linux dns 208.67.222.222
nameserver in /etc/resolv.conf

c'mon it's fun to learn ;)
BFQ+BFS or RT on a RPi? 4'real: https://github.com/licaon-kter/ (source and compiled!)

Raspberry wino
Posts: 49
Joined: Mon Mar 05, 2012 11:48 am

Re: Can I share my laptop's internet connection?

Fri Sep 07, 2012 10:00 am

When I got broadband, I also got a 4-port wired router. Whenever I want to connect more than one computer to the internet, I use an Ethernet cable to connect it to the router.

I'm a Linux user and it just worked with no fiddling about. Is internet sharing more difficult if you use MS Windows? Surely not.

Edit: I realise now, the above probably wasn't helpful to the OP. If you haven't got a simple router you'd need to spend money and get one or follow better advice than I can give from the others above.

bill.f
Posts: 20
Joined: Fri Aug 31, 2012 1:17 pm

Re: Can I share my laptop's internet connection?

Fri Sep 07, 2012 12:08 pm

One thing that you will need is a "crossover ethernet cable" which is different to a normal network cable, if you are NOT using a switch/hub/router and connecting the PI directly to the laptop.






Bill

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Can I share my laptop's internet connection?

Fri Sep 07, 2012 12:12 pm

bill.f wrote:One thing that you will need is a "crossover ethernet cable" which is different to a normal network cable, if you are NOT using a switch/hub/router and connecting the PI directly to the laptop.
Bill
This is absolute rubbish, please ignore it.

The Raspberry Pi has an auto-sensing NIC, any standard Ethernet cable will work.

bill.f
Posts: 20
Joined: Fri Aug 31, 2012 1:17 pm

Re: Can I share my laptop's internet connection?

Fri Sep 07, 2012 12:49 pm

by bredman » Fri Sep 07, 2012 1:12 pm

bill.f wrote:
One thing that you will need is a "crossover ethernet cable" which is different to a normal network cable, if you are NOT using a switch/hub/router and connecting the PI directly to the laptop.
Bill

This is absolute rubbish, please ignore it.
bredman is quite correct, and I have learned something today, please ignore me.

also I promise to not post absolute rubbish in future !!!


Bill

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 25433
Joined: Sat Jul 30, 2011 7:41 pm

Re: Can I share my laptop's internet connection?

Fri Sep 07, 2012 1:00 pm

I personally would have used the phrase 'I'm afraid that information is incorrect', just for the politeness.....
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Can I share my laptop's internet connection?

Fri Sep 07, 2012 1:02 pm

Apologies, Friday is not my favourite day.

Buck90
Posts: 1
Joined: Thu Jan 31, 2013 1:43 am

Re: Can I share my laptop's internet connection?

Thu Jan 31, 2013 2:22 am

[quote="Licaon_Kter"]Since you said you use Windows I ( wrongfully) presumed you know how to use it.

> set up windows ethernet: 192.168.100.1
in Windows set up your ethernet card

> set up windows wireless connection internet connection share
In Windows set up your wireless card to

> set up linux ethernet: 192.168.100.2
> set up linux gateway: 192.168.100.1
these are here: http://elinux.org/RPi_Setting_up_a_static_IP_in_Debian

> set up linux dns 208.67.222.222
nameserver in /etc/resolv.conf :/quote

Thanks so much for this after a few hours of tinkering around I finally managed to get it to work. Just to help out there for anyone that may need it. Firstly you need to bridge your connection, the Internet sharing won't work. So you can skip the setting up windows part above and replace it with bridging connections. Also replace the dns server above with your own dns server, you can find this through windows command prompt by typing ipconfig/all and scrolling down. Note those numbers.

Next type in the terminal
sudo leafpad /etc/resolv.conf
Edit the name serve with your own dns server

The rest is exactly the same as mentioned above

Again thanks so much, it took me a while to get this to work, wouldn't have done it without you

User avatar
aTao
Posts: 1091
Joined: Wed Dec 12, 2012 10:41 am
Location: Howlin Eigg

Re: Can I share my laptop's internet connection?

Thu Jan 31, 2013 5:12 am

Windows internet connection sharing sets up DHCP on the ethernet port. You do not need any settings on the RPi except its initial state.

http://windows.microsoft.com/en-GB/wind ... on-Sharing

Remember Windows is meant for people that arent into setting up networks so it does the work for you.
>)))'><'(((<

vsayanam
Posts: 12
Joined: Tue Nov 06, 2012 11:10 am

Re: Can I share my laptop's internet connection?

Thu Jan 31, 2013 6:00 am

It is quite easy. In Windows, allow Internet sharing. An IP of 192.168.0.2 will be automatically assigned to the Laptop's network card. Make static IP of 192.168.0.2 in Rasp Pi. Enter subnet mask and gateway (192.168.0.1). Also make an entry in /etc/resolv.conf with nameserver=192.168.0.2. Reboot and Rasp Pi will get Net all right.

vsayanam
Posts: 12
Joined: Tue Nov 06, 2012 11:10 am

Re: Can I share my laptop's internet connection?

Thu Jan 31, 2013 6:02 am

It is quite easy. In Windows, allow Internet sharing. An IP of 192.168.0.2 will be automatically assigned to the Laptop's network card. Make static IP of 192.168.0.2 in Rasp Pi. Enter subnet mask and gateway (192.168.0.1). Also make an entry in /etc/resolv.conf with nameserver=192.168.0.2. Reboot and Rasp Pi will get Net all right.

Sorry for the mistake. The nameserver = 192.168.0.1

vsayanam
Posts: 12
Joined: Tue Nov 06, 2012 11:10 am

Re: Can I share my laptop's internet connection?

Thu Jan 31, 2013 12:06 pm

Sorry for the number of mistakes..Was in a hurry as my Net connection was not stable..Windows will allot 192.168.0.1 to the laptop. Allot manually 192.168.0.2 to Rasp Pi (along with Subnet Mask, Gateway and entry for Nameserver in /etc/resolv.conf. ) Now Rasp Pi will get connected to the Internet (after rebooting, of course).

khingcat
Posts: 4
Joined: Thu Feb 07, 2013 6:20 am

Re: Can I share my laptop's internet connection?

Fri Mar 08, 2013 5:34 am

"An IP of 192.168.0.2 will be automatically assigned to the Laptop's network card. Make static IP of 192.168.0.2 in Rasp Pi. Enter subnet mask and gateway (192.168.0.1). Also make an entry in /etc/resolv.conf with nameserver=192.168.0.2."
Hi, vsayanam, I'm still a little confused with your guidance. First, I've search my laptop's Ip (using ipconfig/all, as was told above by Buck90), and I found that my laptop's IP is not 192.168.0.2, but 10.228.95.159 (I found it next to IPv4 address, is it right?). Subnet mask: 255.255.255.255, and Default gateway: 0.0.0.0
DNS Servers : 10.17.3.252.
I've enter on /etc/resolv.conf with nameserver with 10.228.95.159, but I still didn't get any internet connection on my RPi. Would you give me a more detail intruction, because I'm still a beginner on this forum?


Khingcat

nymar
Posts: 60
Joined: Mon Apr 01, 2013 4:59 pm

Re: Can I share my laptop's internet connection?

Tue Apr 02, 2013 9:21 am

Hi,

Can you help me doing the same with FEDORA ?? i have a laptop and R-PI on the same network.


Return to “Off topic discussion”