Recently I had a contract where I did a stint as unix admin. Now I still consider myself a broadcast engineer, but it really was useful to deep dive unix for a few months.
Skip forward to my current role where I have to troubleshoot network problems for contribution video and control. Having nearly 50 remote sites to support can prove challenging. What we really needed was some of the unix networking test tools I had built experience of.
Step forward the Raspberry Pi Version 3 Model B. Normally i'm not a fan of using these in enterprise environments, TBH most of the people I work for can afford the very best gucci tools.
On this occasion though, and with so many sites, as long as we carefully document, build and install them it would certainly provide a massive advantage for a monitoring and troubleshooting tool.
- Provide a low cost linux based platform for deployment on each network leg.
- Install a number of networking troubleshooting and test tools.
- Provide serial connections (via a USB to Serial Convertor) to provide out of band management to other ip enabled remote devices.
- Ability to mount storage / support USB drives for the occasional remote media task.
What follows is my notes for setting up an image for the Raspberry Pi 3, using https://www.raspbian.org/ as the base OS. At each stage where relevant I have credited the link I got the information from, this will also include far more detail than my notes.
We are going to use this pi headless (no Keyboard, Video or Mouse (KVM)) but we do need to briefly set it up on KVM and obtain an ip-address.
Connect the pi to KVM and login with the GUI. In the Raspberry Pi configuration >> Config
Set the following.
- Boot to CLI
- Enable SSH
- Auto Login OFF
and note down the ip-address for
Now use a client like terminal for MacOSX or putty for windows and SSH to the ip address of your pi. Follow the prompts and login with u:pi password:raspberry
Now we need to make sure we are using all the space on our SD card
>> Expand FileSystem and follow the prompts.
Update your pi
sudo apt-get update
sudo apt-get upgrade
SET Static IP
sudo nano /etc/dhcpcd.conf
as follows (extract from man dhcpcd.conf):-
Configures a static value. If you set ip_address then dhcpcd will not attempt to obtain a lease
and just use the value for the address with an infinite lease time.
Here is an example which configures a static address, routes and dns.
sudo nano /etc/hosts
Edit the name after the loopback address of 127.0.0.1
Save and exit,
sudo nano /etc/hostname
Edit, Save and Exit
Commit the changes to the system and reboot the system for the changes to take effect. :
Follow that command with:
SET NTP Servers
sudo nano /etc/ntp.conf
Find lines starting with "server". Replace that lines for lines with servers from pool.ntp.org.
Now you can restart ntp service.
Here is command to check if time is synchronizing properly. To list NTP servers with which RPi is synchronizing:
Login as pi and the issue the
command to change password
create a new user (for example) u:noddy p:bigears
sudo adduser noddy
and you'll be prompted for a password for the new user noddy
The default pi user on Raspbian is a sudoer. This gives the ability to run commands as root when preceded by sudo, and to switch to the root user withsudo su.
To add a new user to sudoers, type
(from a sudoer user) and find the line root ALL=(ALL:ALL) ALL, found under the commented header '# User privilege specification'. Copy this line and switch from root to the username. To allow passwordless root access, change to NOPASSWD: ALL. The example below gives the user bob passwordless sudo access:
# User privilege specification
root ALL=(ALL:ALL) ALL
bob ALL = NOPASSWD: ALL
Disable the wireless radios on the Pi3 (Not good to be connecting to networks)
sudo nano /etc/modprobe.d/raspi-blacklist.conf
Add the following lines
You should now see some failures on restart, this is good and means the radios are disabled
Install some useful apps
sudo apt-get install the following
sudo apt-get nmap
mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool.
tool for active measurements of the maximum achievable bandwidth on IP networks.
Tcpdump prints out a description of the contents of packets on a network interface
ser2net provides a way for a user to connect from a network connection to a serial port.
VNC, or "Virtual Network Computing", is a connection system that allows you to use your keyboard and mouse to interact with a graphical desktop environment on a remote server.
Simple Network Management Protocol (SNMP) is a widely used protocol for monitoring the health and welfare of network equipment (eg. routers), computer equipment and even devices like UPSs. Net-SNMP is a suite of applications used to implement SNMP v1, SNMP v2c and SNMP v3 using both IPv4 and IPv6. The suite includes:
IPTraf is a console-based network statistics utility for Linux. It gathers a variety of figures such as TCP connection packet and byte counts, interface statistics and activity indicators, TCP/UDP traffic breakdowns, and LAN station packet and byte counts.
This is htop, an interactive process viewer for Unix systems.
MediaInfo is a convenient unified display of the most relevant technical and tag data for video and audio files.
Install ffmpeg from source
Its all in here
Mount Network Drives
Again probably best to read this.
Measure temp of raspberrypi:
Shortly Ill be posting the hardware setup ..
As we speak a 19" case is being printed on the Ultimaker2. While its a quick and dirty prototype it will serve to provide the basis for a better design.
Also I will demonstrate the serial terminal cabling, and how I use some of the tools I installed.