What's new

[DIY] - SmallNetworks - Learning by Doing

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

sfx2000

Part of the Furniture
Starting a thread here - as I don't see another place for this to land...

Loose notes below - RaspPI's are awesome!

=======

Gather the following;
  • Raspberry Pi 2/3 board (or kit)
  • I recommend the Hammond Raspberry Pi 2 case, but there are many...
  • SanDisk Ultra 32GB MicroSD card
  • SanDisk 128GB USB Thumbdrive
  • DLink USB2 Powered Hub - or similar
  • CyberPower Home/Office Surge Protector (4 110VAC outlets, 2USB outlets@2.1 amps)
  • CAT5 patch cable
  • USB to microUSB cable - to power the Pi
These items will only be needed for a bit during initial setup
  • USB Keyboard/Mouse
  • HDMI connection to TV/Monitor
=========

Once having the HW

Download the following tools:

  • SD Card Formatter 4.0
  • MobaXterm - one can use Putty or this, this is much better...
  • 7-Zip
  • Win32DiskImager

With the SD Card - use the SD-Card Formatter, full overwrite/erase, and format size adjustment - this is a Windows util, must run as Adminstrator

(some cards aren't right from factory, and don't let Windows/Mac disk utils format the card, not so good)

Go to http://ubuntu-mate.org/raspberry-pi/

why MATE - uses traditional apt for package management - not the cool new hotness "snap" - trying to keep this simple

(16.04 is an LTS release for ubuntu, so best to do this one now... and be happy for a couple of years)​

download image and write to card with Win32DiskImager - as Admin

it's an xz file, so 7-Zip can deal with this - once done, plug the card in, hook up keyboard mouse monitor (hdmi) ethernet and power up the Pi by plugging in the uUSB power source

Note - Pi/Pi2 need about 1.8A current at 5VDC, iPad charger is great for this - that 1.8A current assumes Keyboard/Mouse/Monitor hooked up direct - do not underestimate the power needed

(RPi doesn't have a power regulation PMIC on board, it assumes that the power supply can deliver a constant voltage vs. current demand)

=========

Initial Setup

With the GUI active - go thru the initial setup - set a primary userid/password - this user is the admin of the box - set the name as well

note - might not want to encrypt home folder, just saying...

go to starbucks - a long way away, and enjoy - this will take more than a while for MATE to get going...

embiggen the FS - see link - can either do this thru the MATE splash, or via CLI - do it via the splash is easy

Reboot

Note - MATE RaspPi will prompt you to install the rpi-update package - Might consider not doing that - bleeding edge kernel/firmware and there be dragons with driver issues and stuff

So now at a basic Ubuntu MATE desktop....

Now is a good time to configure network in network mgr - ipv4 - either DHCP, or make this now, outside of DHCP scope, and ipv6 to link-local - save some pain later on

reboot after that... check ifconfig to ensure it took...

=====

Update stuff - apt-get update/upgrade or SW update via the GUI

All up to date and fresh and easy, eh?

Note - make a note of the X11 stuff - sudo graphical enable/disable - once we go headless, don't need the graphical...

==

Setup root account passwd - you'll need this later

sudo passwd root - think of something easy to remember, but hard for others to guess.

Note - Might consider installing pwgen, and using that for password generation.

sudo apt-get install pwgen

pwgen 12

(spits out lots of good passwords)

==========

Clean up stuff you don't need - short list for now...

sudo apt-get purge wolfram-engine
sudo apt-get purge libreoffice*
sudo apt-get purge minecraft*
sudo apt-get purge sonic-pi

sudo apt-get autoremove - watch as space magically frees up

reboot again

=====

EDIT - SECTION REMOVED and REPOSTED
 
Last edited:
Optional items - might pick these up...

Edimax EW-781Un - wifi adapter - amazon direct link
TrendNet TU-ETG USB3 to Gigabit Adapter - amazon direct link

Using these - one wants to have that powered hub - the WiFi is optional, the USB-GigE adapter is very nice...
 
Anyways - where we're going - we don't need roads

;)

Going to measure us some latency across the network, get us some numbers on various units, and chart them out...

In the enterprise space, along with carrier space - we need to quantify what the network is doing - many of the consumer routers might touch on part of this, but for advanced SNB users, those options likely aren't enough - that's the reason for this series of posts on this thread - feel free to comment/add to the content...

We can do this on the cheap - this is the thread - but many of the steps above and below - can be done on any machine - VM's even...
 
And just for fun and show that RPi can surf....

snb_rpi2.png
 
I think the traffic.db file on the asus router can contain the raw data for the analysis needs of traffic monitoring. With a raspberry pi you can use it to pull the files, edit them, and then email reports.

That may detract from your intent. But once I get more I will edit this post to include the paticulars
 
I think the traffic.db file on the asus router can contain the raw data for the analysis needs of traffic monitoring. With a raspberry pi you can use it to pull the files, edit them, and then email reports.

That may detract from your intent. But once I get more I will edit this post to include the paticulars

I think AsusWRT supports SNMP, which I think is what sfx intends to use.
 
I think the traffic.db file on the asus router can contain the raw data for the analysis needs of traffic monitoring. With a raspberry pi you can use it to pull the files, edit them, and then email reports.

That may detract from your intent. But once I get more I will edit this post to include the paticulars

No, that's a good thing - I haven't said where I'm going with this - :D :D :D

However - since we're platform agnostic on this HOWTO/DIY - SNMP is something to look at, as that's where things are intended... not fetching files from proprietary platforms - standards are what they are...

Syslog is something else to consider...
 
Last edited:
@sfx2000 you forgot to mention lcd screens. There are inexpensive 7 inch screens for raspberry pi which includes the case too so its easy to just plug everything in. This makes it much more portable combined with a 2.1A output usb battery pack and wireless keyboard and mouse. Some of those screens include touch interface but i wouldnt compare them with the normal more expensive desktop monitors for display or even expensive phones when it comes to the touch interface. Although there are various sizes of screens for the raspberry pi make sure to choose one that fits the size you want, comes with a case to mount the pi in and doesnt need much power.
 
Optional items - might pick these up...

Edimax EW-781Un - wifi adapter - amazon direct link
TrendNet TU-ETG USB3 to Gigabit Adapter - amazon direct link

Using these - one wants to have that powered hub - the WiFi is optional, the USB-GigE adapter is very nice...

Interesting.....I have a few Pi's doing servery stuff (home automation, MySQL server etc...) - what do you use the second USB NIC for? More LAN might be useful, not sure what for however ;)
The speed will still be limited to USB2.0 levels, is there another advantage?

USB2.0 is 480MBps I think, does one get something close to this level?
What about link aggregation? :)

Thanks!
 
Interesting.....I have a few Pi's doing servery stuff (home automation, MySQL server etc...) - what do you use the second USB NIC for? More LAN might be useful, not sure what for however ;)
The speed will still be limited to USB2.0 levels, is there another advantage?

USB2.0 is 480MBps I think, does one get something close to this level?
What about link aggregation? :)

Thanks!

Good question - more LAN is always good - I wouldn't do link aggregation on the Pi - but having that second NIC offers the opportunity to do out-of-band things - along with additional routing options...

Performance wise - the onboard NIC is still USB based - and being 100BaseT, it's good for about 60Mbps max (iPerf numbers here) - The Trendnet USB3 to GigE adapter is good for about 200 to 220 Mbps, again using iPerf - the Pi2 can push that adapter fairly decently...
 
@sfx2000 you forgot to mention lcd screens. There are inexpensive 7 inch screens for raspberry pi which includes the case too so its easy to just plug everything in. This makes it much more portable combined with a 2.1A output usb battery pack and wireless keyboard and mouse. Some of those screens include touch interface but i wouldnt compare them with the normal more expensive desktop monitors for display or even expensive phones when it comes to the touch interface. Although there are various sizes of screens for the raspberry pi make sure to choose one that fits the size you want, comes with a case to mount the pi in and doesnt need much power.

The USB based screens are pretty nice, and shopping around, can get with touch input even...

Running the GUI does put some power demand on the Pi2 - and a bit of CPU overhead running a full windowed environment with a display manager and windowing system - for a small server app like what we're doing - better to disable the GUI, and run it headless once the initial setup is complete..

The Battery Pack is a very good idea actually - run the Pi2 from it, and let the wall adapter charge/maintain the battery - I've been considering this myself, as the power delivered from the battery should be very clean and fairly consistent...
 
And for now - it's not working very hard - at least not yet...

Pi2_HTOP.PNG
 
I think the traffic.db file on the asus router can contain the raw data for the analysis needs of traffic monitoring. With a raspberry pi you can use it to pull the files, edit them, and then email reports.

That may detract from your intent. But once I get more I will edit this post to include the paticulars

Wonder how they're storing the data - my first guess would be sqlite as it's very lightweight and efficient...

SNMP might actually offer more info, but always depends on what the MIB has to offer... worth mentioning if SNMP is even supported - not sure about Asus devices... some might have it, but might need to be turned on...

can always do a query - "snmpwalk -v 1 -c public 192.168.1.1" and see... (assuming of course that the router is at 192.168.1.1 - since we're just checking, if SNMP is supported, it'll respond with some output)
 
Bonus for today - obtaining CPU/GPU temp on the Pi


$ vi pitemp.sh
Code:
#!/bin/bash
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(date) @ $(hostname)"
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)"
echo "CPU => $((cpu/1000))'C"

write it out - do a quick chmod +x to make it executable - and then you can run it by ./pitemp.sh

looks like this...

$ ./pitemp.sh
Mon May 9 13:42:19 PDT 2016 @ raspy
GPU => temp=44.4'C
CPU => 44'C

;)
 
----- edit - changes and rewrite coming soon ------

If you like this thread - help out SmallNetBuilder by whitelisting your ad-blockers for smallnetbuilder.com and snbforums.com - any hardware, if you source it thru the Amazon, try to use the Smallnetbuilder Amazon Affiliate Links, and most importantly - participate and share what you know back to the community.

thx

sfx
 
Last edited:
So to summarize where we are to this point...

1) Setup Hardware
2) Install Linux
3) Update software/trim the fat
4) Installed a Web Server
5) Installed a database server and admin tools
6) Installed and configured a mail server

We're over half way done - next steps will be to drop in a few packages to make admin a bit easier by keeping tabs on things like updates and status - and then we'll start with the real goodies...

If you like this thread - help out SmallNetBuilder by whitelisting your ad-blockers for smallnetbuilder.com and snbforums.com - any hardware, if you source it thru the Amazon, try to use the Smallnetbuilder Amazon Affiliate Links, and most importantly - participate and share what you know back to the community.

thx

sfx


I have to admit; I'm lost here.

I do not know the point of this project? What is actually being built?

And this is only halfway done? Oh my!

What will this do in the end and what will it compare to (an off the shelf ready to run 'thingy')?

This might have interested me in my teens when time was all I had, but today? Not trying to put a damper on your efforts here sfx2000. Not at all. Just musing out loud (in the forum here) how precious time is and how worthless a few more dollars in my pocket really are.
 
I'm bored... hehe - the basic LAMP setup is needed for the scripts...

once this is all done - it'll be useful to quantify a network performance and status across multiple items - and then you can dashboard things from there. Capabilities, that in a 'off the shelf' thingy would run thousands of dollars...

We're doing this on the cheap - much like how, with certain software, we can do serious networking with a 'low cost' consumer router...

Not for everyone - but perhaps as folks step thru this little "how-to", they will also learn a bit - and this is always a good thing...

sfx2000, stop it!

Now I know what LAMP setup means! :D:D:D

Tim, can't you do something here? Lol...
 
Tim, can't you do something here? Lol...
Do what? You don't have to read the thread.

SFX: It would be helpful if you stated the point of the project in your first post.
 
Do what? You don't have to read the thread.

SFX: It would be helpful if you stated the point of the project in your first post.

Sorry, that was just my way of trying to be funny. :)

I don't really need anything done. ;)
 
SFX: It would be helpful if you stated the point of the project in your first post.

The base point was to impart some knowledge outside of the AsusWRT, and knowledge that can be useful for them as well - getting to the point - if folks are patient enough, and work thru it, by doing it, they will become better users/contributors, and as a result, an even better community... and perhaps more focused questions...

Secondary - I've littered this thread full of SEO terms that are not normally part of the SNB profile - I've gathered quite a bit of knowledge here, across RaspberryPI to Ubuntu, to the various applications, so when someone searches for Raspberry PI, Ubuntu and small server apps like MySQL, Apache, SNMP, etc.. it leverages into SNB's strong profile, and grows it more - which is a win for SNBForums, and the SmallNetBuilder community - heck, we can even bring into the community fresh insight and contributions from new members - is that not a win?

Tertiary - leverage into the HW recommendations for this project - Amazon Affiliate links are always good, and yes, that goes directly to supporting the community...

So as we go into this project deeper - going to pull in more references to other contributors - AsusWRT-RMerlin plays nicely into this - so does all the NAS vendors, the router vendors, other "part of the furniture" members and the platforms they prefer (this plays very nicely into EdgeRouters/MicroTik/pfSense).

Tim - if you would rather me stop - just say so... and we'll end it here...

sfx
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top