Tuesday, April 21, 2026
HomeIoT5 Causes a Raspberry Pi Belongs in Your Community Lab

5 Causes a Raspberry Pi Belongs in Your Community Lab

[ad_1]

It’s Pi Day, everybody — my favourite crowd-sourced vacation. And never simply due to my deep affection for fruit/sugar-filled pastries. Nope, because it was first launched ten years in the past, I’ve liked the Raspberry Pi microcomputer. So, after I was requested if I had any concepts for a Pi-Day weblog, I knew precisely what I wished to jot down. So, I deliver you… 5 Causes a Raspberry Pi Belongs in Your Community Lab!

3 Raspberry Pis & 1 Apple Pie in a Network Lab
3 RPis and 1 Apple Pie within the Lab

I bear in mind after I was learning for my CCIE and constructing out my community lab. This was earlier than the route/swap (now referred to as enterprise networks) lab was virtualized, and my lab was made up of 4 Catalyst 3K switches and 6 ISR G2 routers. Whereas many of the blueprint centered on routing protocols, layer 2 networking, and spanning-tree (a lot spanning-tree), a CCIE continues to be anticipated to grasp and work with community providers.

What do I imply by “community service”? On this case, I’m referring to protocols like DHCP, DNS, NTP, TACACS, RADIUS, TFTP, FTP, and so on, and so on. These providers are elementary to the right operation of nearly any manufacturing community, however it may be a little bit of a ache and really feel like a waste of time and sources to set them up within the community lab you utilize for learning. When engineers don’t simply skip them fully, typically they’ll benefit from the minimal capabilities accessible on community units themselves throughout the lab. And whereas a Cisco router can act as a DHCP or DNS server, it isn’t precisely a practical setup; there are limitations on what you are able to do.

Enter the Raspberry Pi.  For anyplace between 15 to 40 {dollars}, you possibly can add a Linux server to your lab that may run these providers and, in some circumstances, use the identical software program utilized in your manufacturing community.

At all times searching for a superb cause to lab one thing up, I began a brand new git repository and determined to strive a few of these out myself.

You need to see an instance? After all, I can by no means say no to you. Let me present you a preview of…

Pi-DHCP

For a extra thorough walkthrough of establishing ISC DHCP Server on a Raspberry Pi see Utilizing a Raspberry Pi as a DHCP Server in my git repository.

ISC DHCP Server (typically simply referred to as “dhcpd”) is a broadly used DHCP server, and an important one so as to add to your lab. The truth is, most of the instance DHCP configuration guides from Cisco use ISC DHCP because the reference server. Putting in it onto a Raspberry Pi is as straightforward as:

sudo apt-get set up isc-dhcp-server

Like most Linux purposes, you configure the DHCP server with a config file. Right here’s the one I put collectively for my residence lab:

# dhcpd.conf

# DNS Configuration for the community lab
choice domain-name "lab.instance";
choice domain-name-servers 192.168.192.11;

# Setting the default lease time to 2 minutes and max to 1 hour
default-lease-time 120;
max-lease-time 3600;

# That is the subnet on my residence community. No configuration is 
# offered as a result of I do not need to hear/reply to requests
# however including it avoids errors/warnings from the service
subnet 10.92.1.0 netmask 255.255.255.128 {
}

# That is my community lab phase configured on eth0
# A variety of IPs to assign is offered, in addition to the 
# default gateway/router
subnet 192.168.192.0 netmask 255.255.255.0 {
  vary 192.168.192.101 192.168.192.120;
  choice routers 192.168.192.1;
}

# This assigns a static IP tackle to a lab shopper gadget
host lab-client {
  {hardware} ethernet b8:27:eb:d3:22:e7;
  fixed-address 192.168.192.12;
}

As soon as it’s began up and working, I configured my lab swap to request an IP tackle from DHCP on a VLAN interface.

lab-switch#conf t
Enter configuration instructions, one per line.  Finish with CNTL/Z.
lab-switch(config)#interface vlan 192
lab-switch(config-if)#ip tackle dhcp 

I watch the DHCP logs on the Raspberry Pi and may watch the total DHCP course of occur.

Feb 26 16:00:05 lab-server dhcpd[828]: DHCPDISCOVER from a0:ec:f9:ab:39:d3 through eth0
Feb 26 16:00:06 lab-server dhcpd[828]: DHCPOFFER on 192.168.192.101 to a0:ec:f9:ab:39:d3 (lab-switch) through eth0
Feb 26 16:00:06 lab-server dhcpd[828]: DHCPREQUEST for 192.168.192.101 (192.168.192.11) from a0:ec:f9:ab:39:d3 (lab-switch) through eth0
Feb 26 16:00:06 lab-server dhcpd[828]: DHCPACK on 192.168.192.101 to a0:ec:f9:ab:39:d3 (lab-switch) through eth0

How superior is that!? As a Linux server, a Raspberry Pi can present nearly any community service you want in your lab. Listed below are another guides I put collectively for a few of my favourite providers in my community lab.

Whereas experimenting and studying how routing protocols, VLANs, and spanning-trees work can maintain a community engineer busy for hours, in some unspecified time in the future you’re most likely going to need to see some site visitors from purchasers in your community. The place do you get purchasers? Perhaps you’ve got some previous computer systems mendacity round gathering mud. Or perhaps you acquire an previous server off eBay. Or in a pinch, you need to use one in all your community routers or switches as a shopper. These choices work… however every of them has their very own downsides.

Issues like:

  • Even previous laptops, desktops, and servers can price some huge cash
  • Sustaining 5+-year-old {hardware} is usually a big-time funding
  • Area, noise, energy, ugliness

A Raspberry Pi is a good choice. For a similar cash as a few previous, out of date servers you should purchase a number of brand-new Raspberry Pis. They’re easy units, straightforward to setup and reset to default by imaging an SD card. And they’re small, silent, and take up far much less energy than an previous server.

There are a number of totally different Raspberry Pi fashions accessible right now, so you should definitely order the one which has the community connectivity that meets your wants.  I typically like to select up fashions which have each wi-fi networking and a bodily Ethernet interface included.

Raspberry Pi 3B
A Raspberry Pi 3B with wired and wi-fi networking

This is without doubt one of the Raspberry Pi Mannequin 3Bs that I’ve in my lab. Certain, it was launched in 2015, however nonetheless runs like a champ. I’ve about 5 of those that I exploit for various initiatives.

Constructing on the second cause, the Raspberry Pi may be greater than only a easy shopper endpoint in your lab. It makes a fairly darn good lab administration station. What I imply by ‘lab administration station’ is the workstation you utilize for doing community configurations, managing units, upgrading software program, and so on. Mainly, all of the stuff you most likely use your laptop computer for.

I do know what you’re pondering… “Hank, are you telling me to throw away my laptop computer? I actually like my laptop computer. It’s acquired stickers and every little thing throughout it.”

No, that’s not what I’m saying. I don’t find out about your lab setup, however I’ve acquired my community lab tucked away in a nook of my workplace. And whereas it’s not as uncomfortable or awkward as some knowledge closets or knowledge facilities I’ve labored in, it isn’t precisely as ergonomically designed as my regular desk space. However numerous community lab work requires console connections to units, transferring community cables from one gadget to a different, beginning one thing and coming again hours later.

The strategy I’ve taken is utilizing one in all my Raspberry Pis as a devoted lab administration station.

Raspberry Pi Console Server
Raspberry Pi with USB Console into Cisco Swap

Some Raspberry Pi fashions include 4 or extra USB ports, so I can join and depart console cables to the switches and routers for straightforward console entry at any time when I make a mistake and have to get direct entry.

# Discover the USB Console gadget for my swap
pi@lab-client:~ $ ls -l /dev/ttyAC*
crw-rw---- 1 root dialout 166, 0 Mar  4 14:48 /dev/ttyACM0

# Open a serial connection to the swap 
pi@lab-client:~ $ display screen /dev/ttyACM0 9600

# Configure / Handle the swap
lab-switch>en
Password: 
lab-switch#present ip int bri | exc unas
Interface              IP-Deal with      OK? Technique Standing                Protocol
Vlan192                192.168.192.101 YES DHCP   up                    up      

I join the Raspberry Pi to my residence wi-fi, and the bodily ethernet connection to the lab swap. This twin hooked up community setup permits me to SSH into the Raspberry Pi from the consolation of my desk and have the identical connectivity as if I have been sitting on the ground subsequent to the gear.

Tip from Hank: Whenever you join a pc to each wi-fi and wired networks on the similar time, all fashionable working techniques will want the wired connection over the wi-fi one.  This makes full sense from a efficiency perspective, however in a lab use case like this it will not be what you need.  That is managed by a route “metric” identical to on a community router.  You possibly can configure the Raspberry Pi to have the next metric for the ethernet interface than wi-fi.  Instance:

interface eth0
static ip_address=192.168.192.12/24
static routers=192.168.192.1

# By default ethernet interfaces are given a metric 
# 200 + interface index. This might make the eth0 
# routes most popular over wlan0. However I would like wlan0 to
# be most popular to permit web entry. So I set 
# the metric for the eth0 interface to 500
metric 500

For extra particulars on community configuration of a Raspberry Pi see my brief information TL:DR for Configuring Community Interfaces on Raspberry Pi in my git repository.

There’s yet one more profit to utilizing a Raspberry Pi as a lab administration station; it provides you an opportunity to be taught and discover Linux. Linux continues to develop in visibility and significance for community engineers, and IT professionals on the whole. Whereas Linux is usually a bit intimidating for engineers extra used to the world of Home windows or macOS, utilizing a Raspberry Pi as your lab administration station provides you the prospect to make use of Linux as a part of your exploration and work. You possibly can be taught primary Linux abilities similar to:

  • file administration
  • community configuration and instruments
  • putting in purposes
  • configuring and managing providers
  • find out how to exit vim with out unplugging your laptop

Is there something that will get a community engineer as excited as sniffing packets on the community? I’m undecided there’s… Perhaps the primary profitable ping throughout a newly constructed community. That may be a fairly candy feeling as nicely.

However again to capturing packets… the Raspberry Pi can do that too. And the fashions which have each wi-fi and wired community connections are very nicely suited to the job of community sniffer as a result of you possibly can connect with it over the wi-fi connection whereas the wired connection is busy slurping packets.

First up, I set up tcpdump on my Raspberry Pi.

sudo apt-get set up tcpdump

What about Wireshark you ask?  Wireshark can run on a Raspberry Pi too, nevertheless it’s a a lot “heavier” software than tcpdump.  What I typically have discovered finest is to seize with tcpdump on the Raspberry Pi, after which evaluation the captured file on my fundamental workstation with Wireshark. 

Second, configure a monitor session on my lab swap (a Cat 3650) to ship all site visitors destined to the Raspberry Pi that acts as my DHCP and DNS server to my new sniffer.

! Connection to my lab-server Raspberry Pi
monitor session 1 supply interface Gi1/0/1

! Connection to my lab-sniffer Raspberry Pi 
monitor session 1 vacation spot interface Gi1/0/11

! Verify configuration
present monitor session 1

# Output 
Session 1
---------
Kind                     : Native Session
Supply Ports             : 
    Each                 : Gi1/0/1
Vacation spot Ports        : Gi1/0/11
    Encapsulation        : Native
          Ingress        : Disabled

And at last, I exploit tcpdump to seize all DHCP site visitors.

sudo tcpdump -i eth0 -v port 67 or port 68

# Output
tcpdump: listening on eth0, link-type EN10MB (Ethernet), snapshot size 262144 bytes
20:46:02.181634 IP (tos 0x0, ttl 64, id 40790, offset 0, flags [DF], proto UDP (17), size 328)
    192.168.192.102.bootpc > 192.168.192.11.bootps: BOOTP/DHCP, Request from b8:27:eb:d3:22:e7 (oui Unknown), size 300, xid 0xde321e7e, secs 65535, Flags [none]
        Shopper-IP 192.168.192.102
        Shopper-Ethernet-Deal with b8:27:eb:d3:22:e7 (oui Unknown)
        Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message (53), size 1: Request
            Shopper-ID (61), size 7: ether b8:27:eb:d3:22:e7
            MSZ (57), size 2: 1472
            Hostname (12), size 10: "lab-client"
            Unknown (145), size 1: 1
            Parameter-Request (55), size 14: 
            Subnet-Masks (1), Classless-Static-Route (121), Static-Route (33), Default-Gateway (3)
            Area-Title-Server (6), Hostname (12), Area-Title (15), MTU (26)
            BR (28), Lease-Time (51), Server-ID (54), RN (58)
            RB (59), Unknown (119)
20:46:02.194360 IP (tos 0x0, ttl 64, id 39778, offset 0, flags [DF], proto UDP (17), size 328)
    192.168.192.11.bootps > 192.168.192.102.bootpc: BOOTP/DHCP, Reply, size 300, xid 0xde321e7e, secs 65535, Flags [none]
        Shopper-IP 192.168.192.102
        Your-IP 192.168.192.102
        Shopper-Ethernet-Deal with b8:27:eb:d3:22:e7 (oui Unknown)
        Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message (53), size 1: ACK
            Server-ID (54), size 4: 192.168.192.11
            Lease-Time (51), size 4: 300
            Subnet-Masks (1), size 4: 255.255.255.0
            Default-Gateway (3), size 4: 192.168.192.1
            Area-Title-Server (6), size 4: 192.168.192.11
            Area-Title (15), size 11: "lab.instance"

Fairly slick!

For a extra thorough walkthrough of doing packet seize/evaluation on a Raspberry Pi take a look at the information Visitors Evaluation and Seize in my git repository.

And our ultimate cause for right now, you possibly can add “purposes” to your community lab by working them on the Raspberry Pi.  Why would you need to do that you just surprise… There are various causes you may want an software in your house lab.

  • Generate lifelike shopper/server site visitors for packet seize
  • Experiment with quality-of-service configurations to both prioritize or limit software entry
  • Construct firewall guidelines round software entry
  • Create NAT/PAT guidelines for accessing an software
  • Discover and perceive protocols like HTTP and REST APIs

And whilst you may definitely write your individual software, on this open-source world there’s nearly no finish to the purposes you possibly can shortly set up and run in your Raspberry Pi with very restricted effort. And it may be even simpler when you set up Docker in your Raspberry Pi and leverage the massive variety of ARM-based photographs accessible.

Some concepts for purposes to run in in your Raspberry Pi

  • NetBox – Community Supply of Reality
  • WordPress – Weblog / Web site
  • Zabbix – Community Monitoring
  • Postfix – E mail Server
  • Plex – Media Server
  • RetroPi – Recreation Emulator (this one is generally only for enjoyable, won’t be numerous community site visitors)

Be aware: I’ve not put in the entire above purposes on Raspberry Pi so can’t remark firsthand on their setup.

Effectively, there you’re. 5 glorious causes a Raspberry Pi needs to be the subsequent addition you make to your lab. Are you already utilizing a Raspberry Pi in your lab? Inform me about it within the feedback or over on Twitter (@hfpreston). So lengthy for now, I’m off to eat that apple pie from the image.

Should you’d prefer to have a good time Pi Day with extra than simply one thing candy and attractive, take a look at the Cisco Studying Community Retailer’s Pi Day Sale on March 14, 2022 starting at 8am Pacific Time. Completely satisfied Pi Day!

Comply with Cisco Studying & Certifications

Twitter, Fb, LinkedIn and Instagram.

Share:



[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments