User avatar
Mahan_Micro
Posts: 44
Joined: Tue Aug 04, 2015 8:52 pm

sharing the internet between laptop and RPI

Mon Aug 31, 2015 9:06 pm

Hi
I work raspberry pi with XRDP and remote desktop on windows 7
my laptop has internet (home wifi)
but my RPI dosent have internet
I connect to rpi by remote desktop with the ip that ifconfig command gives to me

when I share the internet on LAN , i cant connect to RPI with last ip (that if config give). how i can find the new ip????
how i can use internet on my board by this condition???? :?: :?:
If your Dreams Don't Scare You , They Aren't Big Enough

User avatar
Laurens-wuyts
Posts: 716
Joined: Wed Aug 21, 2013 7:35 pm
Location: Belgium
Contact: Website

Re: sharing the internet between laptop and RPI

Mon Aug 31, 2015 9:11 pm

You can try to scan your network using advanced IP scanner.
Look in the column "Manufacturer" for "Raspberry Pi Foundation". ;)

Laurens

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: sharing the internet between laptop and RPI

Mon Aug 31, 2015 11:08 pm

It's because when you are sharing the Internet from your laptop, it creates its own LAN, giving the laptop an IP address different from your home WLAN, acting as a router and giving the IP address to the Pi. To the Pi, it looks like the laptop is the router and its getting Internet.

I like Fing, I'm nit sure if there is a version for windows.
There are 10 types of people: those who understand binary and those who don't.

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: sharing the internet between laptop and RPI

Tue Sep 01, 2015 1:59 am

you can cross connect RPI and laptop by ethernet cable and use laptop WIFI internet
lets say your router is at 192.168.1.1
after sharing the wifi network on a win laptop
it changes the ethernet port to a sub network, something like 192.168.33.50
but you can force the ethernet port back to a fix 192.168.1.10 ( not need sub network )

the RPI you want on 192.168.1.101 on the other side of that (cross) cable
-a-
sudo nano /boot/cmdline.txt
add in the first line: [space]ip=192.168.1.101::192.168.1.10
-b-
sudo nano /etc/network/interfaces
add: dns-nameservers 8.8.8.8 8.8.4.4
-c-
sudo reboot

now you can find something in internet, test
ping google.com
sudo apt-get update

ps you could even move the cable back from laptop port to router
and talk via wifi router RPI,
but the 192.168.1.10 is now like a wrong configured gateway and causes problems
in that case can edit it back to 192.168.1.1

User avatar
Mahan_Micro
Posts: 44
Joined: Tue Aug 04, 2015 8:52 pm

Re: sharing the internet between laptop and RPI

Tue Sep 01, 2015 6:27 am

KLL wrote:you can cross connect RPI and laptop by ethernet cable and use laptop WIFI internet
lets say your router is at 192.168.1.1
after sharing the wifi network on a win laptop
it changes the ethernet port to a sub network, something like 192.168.33.50
but you can force the ethernet port back to a fix 192.168.1.10 ( not need sub network )

the RPI you want on 192.168.1.101 on the other side of that (cross) cable
-a-
sudo nano /boot/cmdline.txt
add in the first line: [space]ip=192.168.1.101::192.168.1.10
-b-
sudo nano /etc/network/interfaces
add: dns-nameservers 8.8.8.8 8.8.4.4
-c-
sudo reboot

now you can find something in internet, test
ping google.com
sudo apt-get update

ps you could even move the cable back from laptop port to router
and talk via wifi router RPI,
but the 192.168.1.10 is now like a wrong configured gateway and causes problems
in that case can edit it back to 192.168.1.1
Thank you :!:
I tested it by I dont see difference !
can you explain to me what happen in this routin that you say?!
now I find its ip by ip scanner and it was : 192.168.137.143
and rpi hasnt internet !!
If your Dreams Don't Scare You , They Aren't Big Enough

betruk
Posts: 36
Joined: Fri Apr 24, 2015 8:17 am

Re: sharing the internet between laptop and RPI

Tue Sep 01, 2015 6:32 am

First off, I couldn’t create a bridge between Ethernet and my WiFi. So I am goin’ to tell you how I got internet using Internet Connection Sharing and Crossover Cable.

1. In order to SSH to the RPi you need to set an IP address in your subnet in the RPi by editing the /boot/cmdline.txt file
2. Share Internet in your windows Machine and take note of the Ethernet IP.
3. SSH into the RPi and change IP to static in same subnet and add DNS(if it not already there) and Change the cmdline.txt to its previous version
4. Ping to see if it works

drgeoff
Posts: 11095
Joined: Wed Jan 25, 2012 6:39 pm

Re: sharing the internet between laptop and RPI

Tue Sep 01, 2015 9:02 am

betruk wrote:... and Crossover Cable.
You never need a crossover cable to do anything with a RPi. Its ethernet jack is autosensing. A standard or crossover cable will work.
Quis custodiet ipsos custodes?

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: sharing the internet between laptop and RPI

Tue Sep 01, 2015 9:04 am

Mahan_Micro wrote:I find its ip by ip scanner and it was : 192.168.137.143
and rpi hasnt internet !!
-a- is the RPI ethernet connected to router or to the laptop?
-b- on win laptop cmd "ipconfig", what you see?
-c- on RPI terminal "ifconfig", what you see?
but best is you report all like with this script on RPI:
http://kll.engineering-news.org/kllfusi ... nfo.sh.txt

User avatar
Mahan_Micro
Posts: 44
Joined: Tue Aug 04, 2015 8:52 pm

Re: sharing the internet between laptop and RPI

Wed Sep 02, 2015 3:51 pm

KLL wrote:
Mahan_Micro wrote:I find its ip by ip scanner and it was : 192.168.137.143
and rpi hasnt internet !!
-a- is the RPI ethernet connected to router or to the laptop?
-b- on win laptop cmd "ipconfig", what you see?
-c- on RPI terminal "ifconfig", what you see?
but best is you report all like with this script on RPI:
http://kll.engineering-news.org/kllfusi ... nfo.sh.txt
thanks dear KLL !
I will tested again but now my problem is :
in windows 7 when i click on my wifi properties and then click on sharring and then I tick the "allow other network to..."
beside the Lan network I see "no internet access" !
and I don't know what I must do !
I think first I must solve this and test yor help again.
If your Dreams Don't Scare You , They Aren't Big Enough

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: sharing the internet between laptop and RPI

Thu Sep 03, 2015 3:12 am

as i say viewtopic.php?p=809633#p809633
force the laptop ethernet port IP back to 192.168.1.10
and reboot the RPI with cmdline.txt add in the first line: [space]ip=192.168.1.101::192.168.1.10

PiGraham
Posts: 4095
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: sharing the internet between laptop and RPI

Thu Sep 03, 2015 5:22 am

You could connect the Pi to the router, either by USB WiFi or Ethernet cable. By default the Pi will get an IP address from the router by DHCP and should have internet access.

elham
Posts: 1
Joined: Sun Apr 17, 2016 5:25 pm

Re: sharing the internet between laptop and RPI

Sun Apr 17, 2016 6:08 pm

Hi
I have the same problem, If you have find the solution, could you explain please?

Return to “Beginners”