Internet Connection Sharing via Switch

12,057

Solution 1

You need to use Windows Internet Connection Sharing on your laptop to share an internet connection with the Raspberry Pis, or you can use one of the Raspberry Pis as a router. There are lots of ways of doing that. Running OpenWRT on it is just one option.

Solution 2

Yes, you're describing exactly what Internet Connection Sharing (ICS) is. Microsoft explains how to use it here.

The details: Essentially you're turning your laptop into a home router. The Wi-Fi adapter becomes the WAN and the ethernet adapter becomes the LAN. Just like a home router, your laptop will become a gateway with a static IP on the LAN, it will serve DHCP to clients on the LAN, and it will accept DNS requests from the LAN and forward Internet-addressed ones to the WAN.

The alternative: Use a wireless bridge. Some inexpensive home routers (e.g. ASUS, TP-Link) support being used as a wireless bridge.

Solution 3

It is quite possible to use laptop to recieve internet via wifi, then redristribute it via a simple switch as ICS includes its own DHCP implementation. You must also configure your Raspberri Pi's to use the laptop as a proxy. Also, you must consider that when sharing a network connection through a switch, it is possible you may need to use a 'crossover cable' from your laptop to the switch or some switches have autoMDI(MDIX) at the uplink port to allow use of a standard ethernet cord. For reference, read especially bottom 'Uplink Port' section, http://www.pcweenie.com/hni/lan/lan3.shtml

Share:
12,057

Related videos on Youtube

Manos
Author by

Manos

Growing-up the same time computers became widely adopted, sparked a great interest and set fire to my curiosity, driving me to explore the framework that defines the operation of these marvelous machines. Diving deeper into the operation of the different stacked computer technologies out there, it quickly became obvious to me that software development is what intrigues me the most. Even though I consider myself a full-stack developer who understands how things really work, I lean towards technologies such as node.js, Java, old-school C, Android and iOS. Most of my free time is taken by the fine sport of Sailing, in which I had several national and international distinctions with the colours of Greece. Finally, other interests include travellig, mathematics and current frontiers of space exploration.

Updated on September 18, 2022

Comments

  • Manos
    Manos over 1 year

    i want to ask if is possible to share an internet connection via a switch.

    Two raspberry pi are connected to the switch and a windows laptop that is wirelessly connected to the internet.

    Is it possible for the laptop to share its internet connection through the switch?

    • Naidim
      Naidim about 10 years
      What OS is the laptop running?
    • Manos
      Manos about 10 years
      Windows 7 64 bit
  • Manos
    Manos about 10 years
    I enable ics sharing but it doesnt seem to work
  • Manos
    Manos about 10 years
    So i need to set the laptop default gateway at rpis ?
  • Manos
    Manos about 10 years
    I set lan adapter ip as default gw, still nothing.
  • Jason
    Jason about 10 years
    Just use DHCP on the Pis. This is an option, correct?
  • 吴环宇
    吴环宇 about 10 years
    I believe he/she is asking if the Windows 7 PC can be used as a router. Not that many routers will allow the WAN side to be wireless.
  • monkey0506
    monkey0506 over 5 years
    Using ICS, I have always had to assign static IPs on the client. For the host, ICS automatically assigns a static IP (e.g., 192.168.137.1) to the Ethernet port which connects to the client(s). Then I can connect the host directly to a single client device, or connect the host to an Ethernet switch. All clients (if using a switch) should have a unique, but static IP address (e.g., 192.168.137.2, 192.168.137.3, etc.) and have the default gateway (of the client device) set to the static IP of the host (e.g., 192.168.137.1).