dan3008 wrote:So, I want to connect my 2 pi's to the internet (ones an email server the others a blog server), So now i'm designing a case, and was hoping to keep wires down. I've already integrated a powered usb hub, make only 1 power line, now i'm looking to make only 1 ethernet cable. I've looked at using a splitter, but that would still take 2 ports on my router. So i'm looking for a more effective way to achieve this shared connection?
I've considered including a hub in the case, but that would make it too big for the self. unless someone knows of a tiny (preferably passive or usb powered) 2 port hub?
I'd go for the splitter, but if you don't have 2 ports on your router, the simplest option would be to connect the ethernet to one pi, add a usb to ethernet adapter connected with a short crossover to the 2nd pi & route from pi #1 to pi# 2. If one of the Pi's will have a heavier network load, make that the directly connected one.
Off the top of my head you'll need to:
Manually configure the IP addresses of both Pi's [no DHCP]
Add a host route to Pi #2 on Pi #1 via the usb to ethernet device.
Add a default route to Pi #2 using Pi #1 as the gateway.
At this point you should be able to ping between the two devices.
Enable IP forwarding on Pi #1 [ sudo echo 1 > /proc/sys/net/ipv4/ip_forward ].
Add a static route for Pi #2 to your router with Pi #1 as the gateway.
At this point you should be able to ping Pi #2 from another device on your network.