Unconfigured Ad Widget

Collapse

Raspberry Pi 4B firewall running OpenBSD!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cowboy T
    Calguns Addict
    • Mar 2010
    • 5725

    Raspberry Pi 4B firewall running OpenBSD!

    Yes, it's true! OpenBSD runs on the Raspberry Pi 4B, and pretty nicely, at that.

    The advantage of this is that OpenBSD, as a firewall, including the spamd functionality, uses about 10-20% CPU on an old 1997 Sun UltraSPARC 5 "Pizza Box". That means OpenBSD as a firewall is not that CPU-intensive. This is good.

    This means the Raspberry Pi 4B, which is an order of magnitude more powerful than the UltraSPARC 5, and has 8GB DRAM and four ARM cores, will be just cruisin' along, all the while sippin' tiny little bits of electricity. This is really good.

    The key is to get a USB-to-TTL-Serial converter, using a CP2102 chip (what I use) or similar. You use three pins on the 40-pin GPIO interface. The pinout is as follows.

    GND wire -> Pin 6 (GND)
    RXD wire -> Pin 8 (TXD)
    TXD wire -> Pin 10 (RXD)

    That's all you have to hook up. The default TTL serial speed is 115,200 bps, so you'd configure your comm program that way.

    NOTE: it was pins 8 and 10 that I had trouble figuring out. I thought that the RXD wire would go to the RXD pin on the Pi. Nope. The RXD wire goes to the TXD pin on the Pi, and similar for pin 10 (TXD wire to the Pi's RXD pin).

    Then, to get access to the serial port, you can fire up your comm program. Remember to engage 115,200 bps, 8 bits, no parity, 1 stop bit (115200, 8N1).

    I use the "screen" command on my GNU/Linux desktops (Slackware and Debian, at present), like below. We're assuming that your USB-to-serial adaptor's device name is /dev/ttyUSB0, the standard name if you have one plugged in to your box.

    cowboyt@slackbox$ screen /dev/ttyUSB0 115200

    If you're not sure what it showed up as, you can do "ls -l /dev/ttyUSB*", and that should get you what it's called. Also, be sure you're in the right group for access to your comm port; you may need to put your user ID in, for example, the "modem" group, depending on your GNU/Linux distibution.

    If you're on Microsoft Windows, it should show up under Device Manager.

    Either way, that's how you get access to it--serially.

    Then, you download the latest OpenBSD image, preferably the arm64 version. I use the Raspberry Pi Imager program to do this; it's nice and GUI, so it's easy to use. Point it to the arm64 image that you downloaded and let 'er rip.

    Then, proceed with the OpenBSD installation as you normally would. Note that I hooked up an external USB 3.0 SSD drive and installed OpenBSD to there. You'd configure the Pi to boot from USB just like you would if you were running Raspbian (a.k.a. Raspberry Pi OS). It's pretty straight forward.

    And now, I have a fully functional anti-spam, stateful packet-filtering firewall that sips just a little bit of power.

    Gotta love it.
    "San Francisco Liberal With A Gun"
    F***ing with people's heads, one gun show at a time. Hallelujah!
    http://www.sanfranciscoliberalwithagun.com (reloading info w/ videos)
    http://www.liberalsguncorner.com (podcast)
    http://www.youtube.com/sfliberal (YouTube channel)
    ----------------------------------------------------
    To be a true Liberal, you must be 100% pro-Second Amendment. Anything less is inconsistent with liberalism.
  • #2
    Cowboy T
    Calguns Addict
    • Mar 2010
    • 5725

    The network interfaces, BTW, are TP-Link USB 3.0-to-GigE adaptors. The specific model number is UE300. These use Realtek chipsets (RTL8153) which are fully OpenBSD-friendly.
    "San Francisco Liberal With A Gun"
    F***ing with people's heads, one gun show at a time. Hallelujah!
    http://www.sanfranciscoliberalwithagun.com (reloading info w/ videos)
    http://www.liberalsguncorner.com (podcast)
    http://www.youtube.com/sfliberal (YouTube channel)
    ----------------------------------------------------
    To be a true Liberal, you must be 100% pro-Second Amendment. Anything less is inconsistent with liberalism.

    Comment

    • #3
      xfer42
      CGN/CGSSA Contributor
      CGN Contributor
      • Sep 2007
      • 709

      Nice. Ive been thinking about doing one of these.
      Ive been running an old Core2 Quad Q8200 in a 4U case. It used to be a wannabe NAS. The storage was offloaded to one of those 2U Supermicro 12 hot swap bay, dual Xeon jet engine sounding servers. Now the firewall is just an old, power hungry giant case that only firewalls and provides DHCP services (and heats dixie cups for pepper seed germination).

      Id like a low powered solution that runs unix/linux and maybe no HDD (definitely no SSD)

      Comment

      • #4
        Cowboy T
        Calguns Addict
        • Mar 2010
        • 5725

        Actually, SSD's are a good idea with low-powered systems. The reason is logging. If you have a firewall, you want the logs not only to be written real-time without delay (SSD's being faster than microSD are good for this), but you also want extra space for bits that go bad over time. SSD's are designed with this in mind for many writes and rewrites, over years. MicroSD's, while solid-state storage, aren't designed for nearly as many read/write cycles.

        The alternative would be a 2.5" platter drive (HDD). It'd have to be pretty low-power of an HDD, but they also last a long time.

        Those jet engine sounding servers are great for certain things like, say, running Splunk or NetWitness or an industrial-strength database like PostgreSQL. Today, an AMD Ryzen 5 box is quite enough CPU power even for a lot of those tasks if you're running them at home. For a NAS, a Raspberry Pi 4 or similar is a fine solution if you use, say, an externally powered array of 8TB SATA HDD's. For a home firewall application, those jet engine sounding servers are WAY overkill. Might as well use a semi-tractor-trailer to go grocery shopping for your family! :-)

        I think you'd like the Pi 4 or similar in this role.
        "San Francisco Liberal With A Gun"
        F***ing with people's heads, one gun show at a time. Hallelujah!
        http://www.sanfranciscoliberalwithagun.com (reloading info w/ videos)
        http://www.liberalsguncorner.com (podcast)
        http://www.youtube.com/sfliberal (YouTube channel)
        ----------------------------------------------------
        To be a true Liberal, you must be 100% pro-Second Amendment. Anything less is inconsistent with liberalism.

        Comment

        • #5
          xfer42
          CGN/CGSSA Contributor
          CGN Contributor
          • Sep 2007
          • 709

          I know SSDs are good on power. I just dont trust them like I used to at this time since Ive had 4 go out in the past year, all Samsungs, all 1TB, one NVMe (bad sectors, locked in RO mode, completely dead, whatever). Those stopped working immediately, or maybe one day of notice. Some were only used for VMware images and barely used.

          The dual Xeon is used for NAS, containers (minecraft, VPN, various services), container development and KVM guests (video surveillance). Its nice to fire up a VPN container, and just route a hosts traffic to it instead of installing VPN software on the host. Its an old tank rockin' 2x E5-2697 v2 processors (48 logical cpus) and 128GB of ram but we can certainly peg it.

          I honestly dont look at FW logs anymore, except when troubleshooting. I keep all of the logging turned off on all rules and just run custom scripts to mitigate certain things (like create a fw rule to drop an IP if it fails to SSH into host 3 times in one minute). I would be ok sending logs to the NAS via syslog.

          As the weather heats up, Ill be looking more into it. The network closet gets hot

          Thanks.

          Comment

          Working...
          UA-8071174-1