windy54
Posts: 83
Joined: Sat Dec 29, 2012 3:37 pm

Networking PIs in school, is the following correct?

Sat Feb 07, 2015 2:04 pm

Hi,
Background - I run a code club in a primary school and we have several raspberry PIs which are not being used enough due to a lack of displays. School has vga monitors and we only have a couple of converters, also they take some time setting up. I have been talking to the IT technician about networking them all and the problem is a lack of IP addresses due to the number of PCs, IPads etc.

We now have an eight port switch and if I follow the instructions in the raspberry PI website I see how I can set up a DHCP server to allocate an IP address to each PI on their own network, let's say addresses in range 192.168.1.1 to 1.8
Let's say the switch is then connected to the school network on say 10.1.1.1
If we install tightvncserver on the schools PC's how do we log into a PI on its sub network.

Is this where network forwarding comes in?
In the switch would I root say port 91 to the first PI, 92 to the second etc?
As I write this I can see that each PI would probably need a static address.

As you can no doubt gather from this post, I know some of the jargon but have never actually had to create a network!

Thanks

Steve

User avatar
topguy
Posts: 5757
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Networking PIs in school, is the following correct?

Sat Feb 07, 2015 2:37 pm

You should definitly NOT install a DHCP server on the same network as the school network without some guidance from the guys managing the network. You can easily make a lot of interference when the schools PCs start getting their IP-adresses from your DHCP server.

Static ip-adresses is safer, but as you assume you will need something to route traffic from the school network to the Pi network.
There are ways of doing this but you WILL have to cooperate with the IT-people.

One way is to give the PCs you want to use as VNC-clients an extra IP-address whis is on the same sub-net as the Pis. Its possible for a windows computer to have both 192.168.x.x and 10.x.x.x address on the same network card. That way those machines can talk to the Pis, but it should be static ip-adresses all around.

User avatar
DougieLawson
Posts: 36096
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Networking PIs in school, is the following correct?

Sat Feb 07, 2015 2:44 pm

If you have one subnet on 192.168.1.x and the other on 10.1.1.x you will need to set-up a router between the two. That's non-trivial.

Why not re-number the whole school to use 10.1.0.1 to 10.1.255.254 with netmask 255.255.0.0 (/16) and you can have 65,534 stations connected and everyone can see everyone else?
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
PeterO
Posts: 5001
Joined: Sun Jul 22, 2012 4:14 pm

Re: Networking PIs in school, is the following correct?

Sat Feb 07, 2015 3:08 pm

Dear School IT manager,

I want to put a few Raspberry Pis on your network, so you are going to have to change the IP Addressing scheme for the whole school.

Love,
A badly advised Teacher ....

:D :D :D PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
DougieLawson
Posts: 36096
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Networking PIs in school, is the following correct?

Sat Feb 07, 2015 3:20 pm

Did I miss a smiley? :mrgreen: :geek: :mrgreen: :geek: :mrgreen:
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

windy54
Posts: 83
Joined: Sat Dec 29, 2012 3:37 pm

Re: Networking PIs in school, is the following correct?

Sat Feb 07, 2015 5:36 pm

Well thanks for the comments, there is NO WAY I was going to do this myself I was trying to understand what is involved.

Steve

MrBukey
Posts: 2
Joined: Mon Feb 09, 2015 7:33 am

Re: Networking PIs in school, is the following correct?

Mon Feb 09, 2015 7:59 am

Okay... So the first thing I'd say is that you really don't want to be multi-homing other computers (that's giving them another IP address as suggested further up the thread) if you can help it.

As already said, you definitely don't want to be adding another DHCP server on the same network, that will cause you major problems.

The first thing to ask of whomever manages the DHCP server is "why" the scope addresses are running out:

- Is it that you're on a wide area network with other schools and that you only have a small allocation of IP addresses for your school? (If so is it possible to get a larger allocation / another subnet allocated?)

- Is it that the scope settings are set incorrectly, eg so that DHCP leases last for a very long time so that there's some really, really old addresses that have been taken but not released? (If so is it possible to get the lease time dropped to a reasonable length of time eg 7 days / 3 days so that those addresses are freed up automatically in a reasonable amount of time, especially where people's personal older devices are concerned?).

- Is it that the DHCP server was simply given a scope that was "deemed" to be large enough at the time of configuration, but now subsequently isn't? (If so is it possible to extend the scope, or add an additional scope?)

Any, or all, of the above may be in play in your particular network, and any or all of the steps will improve the situation - not just for you - but for your school network.

At a complete guess, I'm guessing your subnet has been configured to a Class C / 255.255.255.0 subnet (simply as it's what most people do), which would give 254 addresses. I'd find it surprising if there were 254 devices in total in use (but I may just be out of touch with the amount of tech in primary schools these days!). I suspect that the DHCP scope was actually setup as a smaller subset of the subnet, and there could be headroom to extend it (or add a second scope) without a huge reconfiguration of IP addressing. Obviously, if you are part of a wide area network with a shared IP addressing scheme you may have actually been handed a smaller subnet, so you may need to ask for assistance from the network team to add an additional subnet and configure routers, etc.

All of this may seem like a large task/ask - but it's really not. Ask the right people that manage these things on your network and it should all be very straightforward. Obviously if you're part of a wide area network with shared IP addressing you may need to wait for change windows, etc. but aside from that it really shouldn't be too much of a problem.

The worst case scenario is that you really are already using 254 devices on a class C private subnet, in which case you have two options:

- As has already been suggested, a simple change to the subnet class (and extension of the DHCP scope, or addition of another DHCP scope).

- A separate physical network (and IP addressing scheme) with router - whether you use static IP addresses or DHCP.

The first of those two options seems the most sensible. I know topguy also suggested this and PeterO jokingly suggested it was too much to ask and that you're badly advised, but you really haven't been (subject to the other things above being checked first - eg actual subnet IP address and DHCP usage) - the simple fact is that if the DHCP scope availability has no headroom, then something will need to be done sooner or later anyway, and it's better to be done now whilst planning to do something than once it starts bringing the school to a halt.

Hope that helps!

MrB.

windy54
Posts: 83
Joined: Sat Dec 29, 2012 3:37 pm

Re: Networking PIs in school, is the following correct?

Wed Aug 12, 2015 5:41 pm

In answer to MrB post from February , I have just been into school talking to the IT guy, the problem of a lack of addresses was caused by too long a lease time, 8 days I think. So they have got lots of PC,s IPads etc and when visitor is or teachers brought their own phone or laptop in for a few hours, they were taking out a lease for over a week.

This is all being sorted for next term so we should be able to network the PIs,
Watch this space!

steve

gdt
Posts: 85
Joined: Thu Jul 19, 2012 10:19 am

Re: Networking PIs in school, is the following correct?

Fri Aug 14, 2015 11:35 am

If you want to do something in the meantime you could use IPv6 Link Local networking.

To activate IPv6 delete the file /etc/modprobe.d/ipv6.conf and reboot. The computer will acquire a IPv6 Link Local address with no configuration of the network required.

You can now SSH from one nearby machine to another nearby machine which is also running IPv6. But typing the addresses is highly inconvenient.

To fix that install multicast DNS (mDNS) with "sudo apt-get install libnss-mdns". To listen to mDNS configure the "hosts" line of /etc/nsswitch.conf to read "hosts: files myhostname mdns_minimal [NOTFOUND=return] dns". To advertise SSH using mDNS add a file /etc/avahi/services/ssh.service containing:

Code: Select all

<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
  <name replace-wildcards="yes">%h</name>
  <service>
    <type>_ssh._tcp</type>
    <port>22</port>
  </service>
</service-group>
followed by the command "sudo /etc/init.d/avahi-daemon restart".

Activate IPv6 and install and configure mDNS on all of the RPis which you want to use IPv6 Link Local networking.

Let's say the nearby machine is named 'fred' (its command line prompt will be '…@fred ~ $'). From your machine you say "ssh fred.local" to connect to it. Technically-speaking by 'nearby machine' I mean 'both the machines are on the same VLAN'.

Since Apple Macs already ship with IPv6 and Zeroconf (mDNS) running adding those features to the Raspberry Pi brings no new issues to the network.

MrBukey
Posts: 2
Joined: Mon Feb 09, 2015 7:33 am

Re: Networking PIs in school, is the following correct?

Fri Aug 14, 2015 7:39 pm

Hey Steve,

Glad you found the root cause and it's being handled. Good luck for September and the start of the new school year. :)

MrB.

Return to “Networking and servers”