0

Is it possible to daisy chain the ethernet connection between pi's

Internet/ethernet in to pi #1 then share this internet connection with pi #2 via usb to ethernet adapter? or otherwise?

  • Certainly possible, it's called routing. What OS do your RPi's have? Do you want to avoid investing in a switch? – Gerard H. Pille Mar 7 '18 at 8:28
  • WiFi-accesspoint might be an option as well... – CousinCocaine Mar 7 '18 at 11:28
  • im on raspbian 9, yeah want try without a switch if possible... – Matt Bell Mar 8 '18 at 11:01
0

Assuming your internet conection is with the WiFi interface Assuming you're running a good distro for the Pi like Ubuntu 16.04 or Raspbian.

You can install a firewall like [preferred] Shorewall Firewall. It uses configuration files that are then compiled and a set of iptables commands are created and inserted into a bash script that runs the firewall with masquerading. This way your internal LAN network masquerades behind your external WAN WiFi interface.

I have a basic configuration that uses (4) files: - policy - the basic policy of the firewall, - rules - the rules you create for in/out trafffic, - interfaces - the external interface [WAN], - zones - the zones of the firewall. See https://shorewall.org/

Here are my configuration files for my firewall/router, a Pi 3 B:

rpi3b as the HOMENET firewall and router

Network hardware Configuration

  • eth0 as the external interface. On-board eth interface.
  • eth1 as the local 10.0.100.240/28 interface. USB/eth dongle #3.
  • eth2 as the local 10.0.200.240/28 interface. USB/eth dongle #4.
  • USB layout: [ 1 ][ 2 ] [ 3 ][ 4 ]

Operating System

  • Ubuntu Mate 16.04.

Firewall

  • Shorewall firewall v5.0.4.

Firewall configurataion

/etc/shorewall/policy

#

SOURCE DEST POLICY LOG LIMIT: CONNLIMIT:

$FW net ACCEPT net all DROP NFLOG

The FOLLOWING POLICY MUST BE LAST

all all REJECT NFLOG

#END

/etc/shorewall/rules

#

ACTION SOURCE DEST PROTO

Ping(DROP) net $FW DNS(ACCEPT) $FW net SSH(ACCEPT) loc $FW ACCEPT $FW net icmp

Remote ssh access from the net to internal system ix

DNAT net fw:10.0.100.241:22 tcp 11701

#END

/etc/shorewall/zones

ZONE TYPE

# fw firewall net ipv4 loc ipv4

#END

/etc/shorewall/interfaces

#

ZONE INTERFACE BROADCAST OPTIONS

net detect dhcp,tcpflags,logmartians # external loc detect tcpflags,logmartians # internal 100 subnet loc detect tcpflags,logmartians # internal 200 subnet

#END

/etc/shorewall/masq

#

INTERFACE:DEST SOURCE ADDRESS

10.0.100.240/28,10.0.200.240/28

#END

0

Yes, it is possible. You can enable ip forwarding on every raspi so all of them work as router. But then you have to setup different networks for every ethernet connection so you can route packets between the networks, e.g.

rpiA[eth1:192.168.0.1/24] -> rpiB[eth0:192.168.0.2/24 # eth1:192.168.1.1/24] -> rpiC[eth0:192.168.1.2/24]

You can fiddle with the netmask to reduce the size of the different networks.

Better is to use a bridge on every raspi so all of them have the same broadcast domain.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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