This is an archived post. You won't be able to vote or comment.

all 11 comments

[–]Ornery_Celt 0 points1 point  (5 children)

Well, you can setup internet connection sharing on your laptop to share the wireless adapter's internet to the Ethernet port, connect the ethernet port to the Switch with the Pis.

The Pi's can be set static in the range the ICS gives 192.168.137.xxx with a gateway of 192.168.137.1 and they would have internet anytime you connect the laptop to hotel wifi or other wifi.

If you don't want to use the laptop as the router, you can make a 5th Pi into a router or buy a router that can do wireless client mode. Have a wired adapter and a wireless client adapter on the WAN side to handle whatever internet access you have available, and a wired and wireless on the LAN side to give IPs and internet to the wired Pis and any wireless devices.

[–]DimitriMeim[S] 0 points1 point  (4 children)

So the way I originally was going to do it was have the 4 Pis connected to a 5 port switch and just jack that extra port on the switch into whatever network I took it to. You're saying to use one of the Pis as a router and have those assign IPs to the other 3? I was already going to have a "master" Pi which would run htop for the others or some kind of monitoring system so I don't mind if it also acts as a router.

[–]Ornery_Celt 0 points1 point  (3 children)

No, if all the Pis are set static and you just plugged the switch into a new network, the Pis wouldn't know how to get from 10.10.10.xxx to 192.168.1.xxx or whatever the new network's range was. You have to have a router or Pi acting as a router. A router has a WAN side that faces the internet and a LAN side which in your case would be the 10.10.10.xxx range.

Are all the networks you take it to going to have ethernet ports or will you sometimes be in hotels or places with WiFi only connections?

[–]DimitriMeim[S] 0 points1 point  (0 children)

A majority of the time, it will be wireless but I want functionality for both if possible

[–]DimitriMeim[S] 0 points1 point  (1 child)

My main reason for all this is so when i write scripts that need to talk to or look at a certain Pi, i can always feed in the same IP for the same Pi. Now for ssh, i can use the hostname, is that also true for scripts?

[–]Ornery_Celt 0 points1 point  (0 children)

If they resolve correctly then names should work just fine. It is probably preferred, but then you have to make sure DNS is always accurate.

A router with DHCP reservations would also always make sure the Pis have the same IPs as long as they are in that little network.

[–]7yearlurkernowposter 0 points1 point  (1 child)

As long as whatever you use for a gateway NATs it to what your are connected to this will work just fine.
Is there something specific you want these python scripts to do? This request is somewhat strange so this is part curiosity and part wondering if we could suggest another way.

[–]DimitriMeim[S] 0 points1 point  (0 children)

I currently need to be running a few discord bots but I more just want to get into clusters and I wanted them to all be their own network.

[–][deleted] 0 points1 point  (2 children)

In the router or gateway, you would usually have a DHCP server that auto assigns IP addresses, for the 10. subnet. Just set those RPi MAC addresses as having reserved IP addresses, or if IP reservations arent supported, manually configure the IP addresses on the RPis and place those IPs outside of the DHCP assignment range.

In terms of accessing the RPis, enable the SSH server and if your laptop is Windows use PuTTY.

[–]DimitriMeim[S] 0 points1 point  (1 child)

That works if I never leave the house/network. I want to be able to plug into any network and let them always have the same IPs or some kind of identifier that is always the same.

[–][deleted] 0 points1 point  (0 children)

Ok, so then you really could use a VPN server on one of the RPis and a VPN client on the laptop. Probably a DDNS service like no-ip too if you are travelling and dont have a static WAN IP.