1

I'll dump some common info here, but I would love a step by step, from scratch on how I can create a network bridge between my Raspberry Pi (running Raspbian) and Laptop (Windows 7 with LAN and WiFi) to allow internet access to both and SSH between my RPi and laptop.

I want to share internet connection from WiFi to RPi using LAN port.

I'd prefer my RPi having a static ip, for SSH'ing purposes, but using DHCP if it's easier is fine.

I'm using default /etc/network/interfaces now:

auto lo
iface lo inet loopback

auto eth0
allow-hotplug eth0
iface eth0 inet manual

auto wlan0
allow-hotplug
wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

auto wlan1
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

rpi: ping 8.8.8.8 -> connect: Network is unreachable
rpi: ping laptopIP -> connect: Network is unreachable
rpi hostname -I   -> 169.254.229.14

laptop ping 169.254.229.14  -> works
laptop ssh 169.254.229.14   -> works
laptop ipconfig -> Wireless->IPv4: 169.168.0.116
                   Subnet: 255.255.255.0
                   Default Gateway: 192.168.0.1

                   LAN->IPv4: 169.254.244.255

NOTE
I tried previously the other day, and my RPi was on the network with address of 192.168.0.103 and it had internet access, but after a reboot it didn't work again. So I've reset everything, to try again.

I'll update with any more info that is needed.

OS
RPi: Latest Raspbian
Laptop: Windows 7 (64 bit)

  • So your concern is to be able to ssh into the pi from the laptop, and for the pi to have Internet access? Is this correct? I ask because introducing the term "bridge" adds confusion to your question. – Tyson Oct 3 '15 at 13:01
  • I have my rpi connected to my laptop via an ethernet cord. My intention is that. To be able to ssh into my pi from my laptop, and for my rpi to have access to the internet. The term "bridge" is because I have a network bridge between my LAN and wifi on my laptop, which in some instances gave my rpi access to internet, but it stopped working for some unknown reason. So I'm trying from scratch to get my desired outcome as you mentioned, the proper way. – jake Oct 3 '15 at 13:07
  • Is there a reason that you want to directly connect the two? For example, my pi is connects to the router, has internet access, and I can ssh into from any computer on the network. – Tyson Oct 3 '15 at 13:13
  • I don't have access to directly connect my pi to my router, I'd prefer to keep it close by for easy restarts and shut downs. I'm not sure if there's a sleep mode where I can keep 24/7 ssh access to my pi, but also allow it not to run 24/7 at full strength, but unless that's possible, having it next to my laptop is the next best thing. – jake Oct 3 '15 at 13:15
  • For the best help then you should edit the OS of your laptop into the question. – Tyson Oct 3 '15 at 13:45
1

Plug the Ethernet cable into your Windows PC and Raspberry Pi

On your Windows PC click the network icon in the bottom right hand corner of the taskbar and click "Open Network and Sharing Center" Click "Change adaptor settings" Hold Ctrl and click on your current wifi network and Local Area Connection Right click and click "Bridge Connections" Enter administrator password if prompted

On your Raspberry Pi enter the terminal and write ping www.google.com

If you cannot connect the in the terminal write sudo ifconfig eth0 <IP> netmask <NETMASK> where:

  • <IP> is an IP-address in you network which is free
  • <NETMASK> is the netmask of your network (usually 255.255.255.0. You can check it by going on cmd on Windows and writing ipconfig

On your Raspberry Pi enter the terminal and write ping www.google.com If this fails again enter the terminal on your Raspberry Pi and write sudo route add default gw <GIP> eth0 where <GIP> is the IP address of the default gateway (this is usually 192.168.0.1 or 192.168.1.1. You can check by going on cmd on Windows and writing ipconfig)

You should now be able to do ping www.google.com

And you will be able to remote into your pi from your laptop or ssh.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.