<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>LINICKX.com</title><link>https://www.linickx.com/</link><description></description><lastBuildDate>Sun, 11 Jan 2026 19:36:00 +0000</lastBuildDate><item><title>Wi-Fi (Broadcom BCM4331) for an old iMac (iMac13,1) in 2026</title><link>https://www.linickx.com/wi-fi-broadcom-bcm4331-for-an-old-imac-imac131-in-2026</link><description>&lt;p&gt;My Christmas project this year was to make my old 2012 iMac work; previously I have used &lt;a href="https://dortania.github.io/OpenCore-Legacy-Patcher/"&gt;OpenCore Legacy Patcher&lt;/a&gt; to keep MacOS going but that was become less useable -- Enter Linux!
This note is specifically geared towards OpenSUSE Tumbleweed, but is hopefully helpful for anyone trying similar with any other distro.&lt;/p&gt;
&lt;h2&gt;TLDR;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Install b43-fwcutter&lt;/li&gt;
&lt;li&gt;Download &lt;a href="https://web.archive.org/web/20240708013600/http://www.lwfinger.com/b43-firmware/broadcom-wl-6.30.163.46.tar.bz2"&gt;broadcom-wl-6.30.163.46.tar.bz2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;sudo b43-fwcutter -w /usr/lib/firmware broadcom-wl-6.30.163.46.wl_apsta.o&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Reboot &amp;amp; Hope!&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Long form&lt;/h2&gt;
&lt;p&gt;Booting from the tumbleweed ISO/USB worked well, obviously the bluetooth keyboard/mouse don't work, but bluetooth is detected and will work later. Wi-Fi is not detected at all, an Ethernet cable was required to get networking up. Upon completing the install, I started to investigate how to fix Wi-Fi. On Tumbleweed, the &lt;code&gt;pullin-bcm43xx-firmware&lt;/code&gt; package provides &lt;code&gt;/usr/sbin/install_bcm43xx_firmware&lt;/code&gt; however, even tho it "runs", it has an error and Wi-Fi still doesn't work and the reason is because &lt;code&gt;www.lwfinger.com/b43-firmware/&lt;/code&gt; no longer exists.&lt;/p&gt;
&lt;p&gt;Browsing the internet archive, I found a working snapshot for 8th July 2024: &lt;a href="https://web.archive.org/web/20240708013600/http://www.lwfinger.com/b43-firmware/"&gt;https://web.archive.org/web/20240708013600/http://www.lwfinger.com/b43-firmware/&lt;/a&gt; &lt;/p&gt;
&lt;h3&gt;Steps:&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Download &lt;a href="https://web.archive.org/web/20240708013600/http://www.lwfinger.com/b43-firmware/broadcom-wl-6.30.163.46.tar.bz2"&gt;broadcom-wl-6.30.163.46.tar.bz2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;If it's not installed, you'll need &lt;code&gt;b43-fwcutter&lt;/code&gt;, so &lt;code&gt;sudo zypper install b43-fwcutter&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Unpack the archive: &lt;code&gt;tar -xjf broadcom-wl-6.30.163.46.tar.bz2&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Install the driver:  &lt;code&gt;sudo b43-fwcutter -w /usr/lib/firmware broadcom-wl-6.30.163.46.wl_apsta.o&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Reboot ... there's probably a way to avoid the reboot by restating Network Manager, but whatever!&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After the reboot, you should see the WLAN adapter available.&lt;/p&gt;
&lt;h3&gt;Closing thoughts.&lt;/h3&gt;
&lt;p&gt;I am hosting a copy of the driver here, incase the archive goes down: &lt;a href="https://www.linickx.com/files/2026/01/broadcom-wl-6.30.163.46.tar.bz2"&gt;www.linickx.com/files/2026/01/broadcom-wl-6.30.163.46.tar.bz2&lt;/a&gt;. For me, the driver only seems to be working on 2.4Ghz, even tho' the BCM4331 support 5Ghz 802.11a 🤷🏻‍♂️ ... and performance seems to be a poor 5Mb/s. But for now, I'm on with this as my plan is to use the iMac as a kinda distraction free SSH or Writing terminal; perhaps I can fix that later and update here.&lt;/p&gt;
&lt;p&gt;If anyone knows how to get the nVidia driver working &lt;a href="https://infosec.exchange/@linickx"&gt;please hit me up&lt;/a&gt; as I'm having to manually tweak the screen brightness with each reboot.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nick Bettison</dc:creator><pubDate>Sun, 11 Jan 2026 19:36:00 +0000</pubDate><guid isPermaLink="false">tag:www.linickx.com,2026-01-11:wi-fi-broadcom-bcm4331-for-an-old-imac-imac131-in-2026</guid><category>Linux</category><category>iMac</category><category>MacOS</category><category>Apple</category><category>OSX</category></item><item><title>Home Assistant on KVM - Disable Secure Boot</title><link>https://www.linickx.com/home-assistant-on-kvm---disable-secure-boot</link><description>&lt;p&gt;The documentation for running &lt;a href="https://www.home-assistant.io/installation/alternative#hypervisor-specific-configuration"&gt;HAOS on KVM&lt;/a&gt; is pretty good but not enough for me, in fairness it state that &lt;em&gt;Secure Boot&lt;/em&gt; is not supported, but the clues given to disable that are a little cryptic, this post are my notes.&lt;/p&gt;
&lt;h2&gt;Preface: Some personal tweaks.&lt;/h2&gt;
&lt;p&gt;I used the &lt;code&gt;virt-install&lt;/code&gt; command given, but the default tries to connect to the console -- which without secure boot disabled is just a blank screen, so &lt;code&gt;--noautoconsole&lt;/code&gt; is needed.&lt;/p&gt;
&lt;p&gt;Also, I don't have a default network, all my VM's are on a bridge interface which means I also need &lt;code&gt;--network bridge=br0&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;So, my final install command looks like:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;virt-install --name haos --description &amp;quot;Home Assistant OS&amp;quot; --os-variant=generic --ram=4096 --vcpus=2 --disk /opt/haos/haos_ova-16.2.qcow2,bus=scsi --controller type=scsi,model=virtio-scsi --import --graphics none --boot uefi --network bridge=br1 --noautoconsole
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;( &lt;em&gt;Change your disk path as necessary&lt;/em&gt; )&lt;/p&gt;
&lt;h2&gt;Now: To disable secure boot.&lt;/h2&gt;
&lt;p&gt;You VM is probably running, but not working, shut it down with &lt;code&gt;sudo virsh shutdown haos&lt;/code&gt; it might be stuck, so you might have to use &lt;code&gt;sudo virsh destroy hasos&lt;/code&gt; to forcefully kill it.&lt;/p&gt;
&lt;p&gt;Now run &lt;code&gt;sudo virsh edit haos&lt;/code&gt;, this should open an XML like this screenshot:&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/2025/09/Some-XML-from-KVM.png" class="img-fluid" &gt;&lt;/p&gt;
&lt;p&gt;It doesn't matter if it's not exactly the same, your hypervisor might have selected a different EFI firmware. Next steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Change &lt;em&gt;enrolled-keys&lt;/em&gt; to &lt;code&gt;no&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Change &lt;em&gt;secure-boot&lt;/em&gt; to &lt;code&gt;no&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;👉🏼 &lt;strong&gt;Delete the line starting with&lt;/strong&gt; &lt;code&gt;&amp;lt;loader readonly='yes' ...&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;👉🏼 &lt;strong&gt;Delete the line starting with&lt;/strong&gt;  &lt;code&gt;&amp;lt;nvram template= ...&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Save &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The final XML snippet should look something like:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-xml"&gt;&amp;lt;os firmware='efi'&amp;gt;
    &amp;lt;type arch='x86_64' machine='pc-i440fx-10.0'&amp;gt;hvm&amp;lt;/type&amp;gt;
    &amp;lt;firmware&amp;gt;
      &amp;lt;feature enabled='no' name='enrolled-keys'/&amp;gt;
      &amp;lt;feature enabled='no' name='secure-boot'/&amp;gt;
    &amp;lt;/firmware&amp;gt;
    &amp;lt;boot dev='hd'/&amp;gt;
&amp;lt;/os&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;First boot: Reset nvram.&lt;/h2&gt;
&lt;p&gt;After making the above changes, when you start (&lt;em&gt;power-on&lt;/em&gt;) the machine for the first time you need to get KVM to select a new firmware, so run:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;virsh start haos --reset-nvram
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After that's been done once, then normal start should work, even autostart.&lt;/p&gt;
&lt;h2&gt;Done!&lt;/h2&gt;
&lt;p&gt;I use &lt;a href="https://cockpit-project.org"&gt;cockpit&lt;/a&gt; to manage my KVMs, this is what it looks like! 😊&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/2025/09/HomeAssiatnt-KVM-Cockpit.png" class="img-fluid" &gt;&lt;/p&gt;
&lt;h3&gt;References:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;https://libvirt.org/kbase/secureboot.html#changing-an-existing-vm&lt;/li&gt;
&lt;li&gt;https://www.home-assistant.io/installation/alternative#hypervisor-specific-configuration&lt;/li&gt;
&lt;/ul&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nick Bettison</dc:creator><pubDate>Sun, 21 Sep 2025 13:48:00 +0100</pubDate><guid isPermaLink="false">tag:www.linickx.com,2025-09-21:home-assistant-on-kvm---disable-secure-boot</guid><category>HomeAssistant</category><category>KVM</category><category>Linux</category></item><item><title>Building Custom RUT240 Teltonika Packages</title><link>https://www.linickx.com/building-custom-rut240-teltonika-packages</link><description>&lt;p&gt;I'm in the process of trying to see if I can get DNS over HTTPS working, &lt;a href="https://community.teltonika-networks.com/24534/how-to-install-or-enable-dns-over-https"&gt;my forum post&lt;/a&gt; didn't provide a direct answer therefore I'm going to document the build/compile/install process, at time of writing I'm not 100% sure if the package is going to work or meet my requirements but there's little infomation avilable on this topic that I figure this post will help someone! &lt;/p&gt;
&lt;h2&gt;Some comments on the Teltonika RUT240&lt;/h2&gt;
&lt;p&gt;The &lt;a href="https://teltonika-networks.com/product/rut240/"&gt;RUT240&lt;/a&gt; is a niftly little box, 2x Ethernet Ports, 2.4Ghz WiFi and 4G.&lt;br /&gt;
The marketing material describes the Operating system as: &lt;em&gt;"RutOS (OpenWrt based Linux OS)"&lt;/em&gt;.  Which is accurate, but there's a little detail, the verion of OpenWRT that RutOS is based on is &lt;a href="https://openwrt.org/releases/15.05/start"&gt;15.05.1&lt;/a&gt; "Chaos Calmer" released in 2015 and last updated in 2016, so although the RUT240 featurelist is very impressive, under the hood there's some old tech.&lt;br /&gt;
Some googling suggests that you can re-flash &lt;em&gt;some&lt;/em&gt; Teltonika boxes with the latest OpenWRT however you are flash/storage dependent, the RUT240 doesn't have enough storage space to do this.&lt;/p&gt;
&lt;h2&gt;A word of Warning!&lt;/h2&gt;
&lt;p&gt;Back in the day, &lt;a href="https://www.linickx.com/tag/rpm"&gt;I used to build RPM packages&lt;/a&gt; from sourse for RHEL and this process can quickly become &lt;em&gt;dependency hell&lt;/em&gt;, be mindful of effort Vs reward as this packaging lark can be a bit of a rabbit hole!&lt;/p&gt;
&lt;h2&gt;Building&lt;/h2&gt;
&lt;p&gt;Given that I haven't gotten DOH working yet, I'm going to document a simple example and upgrade curl &amp;amp; ca-bundle (&lt;em&gt;the version of wget that comes with Rutos is compiled without HTTPS so this is going to be useful!&lt;/em&gt;)&lt;/p&gt;
&lt;p&gt;To get started you &lt;a href="https://community.teltonika-networks.com/15655/rut240-sdk-build-fail-on-ubuntu-19-10"&gt;&lt;em&gt;need&lt;/em&gt;&lt;/a&gt; Ubuntu 16.04, one option is to build yourself a virtal machine, I'm going to use docker:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ docker run -it ubuntu:16.04
root@17da442b8e85:/# cd
root@7f2c92d1ed06:~#
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;Note: Docker by default starts the shell in &lt;code&gt;/&lt;/code&gt; type &lt;code&gt;cd&lt;/code&gt; to do everything in the &lt;code&gt;$HOME&lt;/code&gt; directory (&lt;code&gt;/root&lt;/code&gt;)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Ubuntu isn't ready to build stuff, install the developer packages with these commands:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;apt-get update; apt install subversion g++ zlib1g-dev build-essential git python python3 libncurses5-dev gawk gettext unzip file libssl-dev wget libelf-dev ecj fastjar java-propose-classpath rsync swig time python3-setuptools libncursesw5-dev ccache xsltproc vim tree
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;At this point, you can download the Chaos Calmer source code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git clone https://github.com/openwrt/chaos_calmer.git
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will create a &lt;code&gt;chaos_calmer&lt;/code&gt; folder in &lt;code&gt;/root&lt;/code&gt; that will be your build environment.&lt;/p&gt;
&lt;p&gt;To update curl, I'm going to step up one version of firmware from 15.05.1 to &lt;a href="https://openwrt.org/releases/17.01/start"&gt;17.01 Lede&lt;/a&gt;; the reason I'm not going to latest &amp;amp; greatest is to reduce the risk that curl has a dependenciy that needs updating, and so-one and so-forth.&lt;/p&gt;
&lt;p&gt;Curl is part of the firmware, i.e. not in packages repo so download the older branch:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git clone -b lede-17.01 https://github.com/openwrt/openwrt.git; mv openwrt lede-17.01-openwrt
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then replace the old package like so:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;rm -fr ~/chaos_calmer/package/network/utils/curl
cp -av ~/lede-17.01-openwrt/package/network/utils/curl ~/chaos_calmer/package/network/utils/
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To build &lt;code&gt;ca-bundle&lt;/code&gt; I could clone the whole &lt;a href="https://github.com/openwrt/packages/tree/lede-17.01"&gt;lede packages repo&lt;/a&gt; and copy the files, however this package includes certificates which are date bound, so I'm going to be forced to go latest &amp;amp; greatest, and looking at &lt;a href="https://github.com/openwrt/openwrt/tree/master/package/system/ca-certificates"&gt;looking at the package&lt;/a&gt; we only need one file, so let's just update that:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;cd chaos_calmer/package/system/ca-certificates/  
rm Makefile
wget  https://raw.githubusercontent.com/openwrt/openwrt/master/package/system/ca-certificates/Makefile
cd ~/chaos_calmer
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Before building, &lt;a href="https://wiki.teltonika-networks.com/view/RUT240_Package_Manager#Custom_package_upload"&gt;according Teltonika&lt;/a&gt; you need to update the Makefile of your package and add in some RUTOS specifics...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;vi package/network/utils/curl/Makefile
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Somewhere near the top of the file, insert this..&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;PKG_ROUTER:=RUT240
PKG_FIRMWARE:=01.12.3
PKG_TLT_NAME:=curl
PKG_VERSION_PM:=1.0
&lt;/code&gt;&lt;/pre&gt;
&lt;blockquote&gt;
&lt;p&gt;NOTE: If you're running later firmware, update as applicable.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And again for &lt;code&gt;ca-certificates&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;vi package/system/ca-certificates/Makefile
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Update lie this...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;PKG_ROUTER:=RUT240
PKG_FIRMWARE:=01.12.3
PKG_TLT_NAME:=ca-certificates
PKG_VERSION_PM:=1.0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next step, is to run &lt;code&gt;make menuconfig&lt;/code&gt; &lt;/p&gt;
&lt;p&gt;&lt;a href="/files/2020/11/make-menu-config.png"&gt;&lt;img src="/files/2020/11/make-menu-config.png"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;... and select your package (&lt;em&gt;press spacebar to make an &lt;code&gt;M&lt;/code&gt; appear&lt;/em&gt;), if you don't do this you'll have issue with later commands:&lt;/p&gt;
&lt;p&gt;Base sytem -&amp;gt; CA Certificates&lt;/p&gt;
&lt;p&gt;&lt;a href="/files/2020/11/make-menu-config-2.png"&gt;&lt;img src="/files/2020/11/make-menu-config-2.png"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Network -&amp;gt; File Transfer -&amp;gt; Curl&lt;/p&gt;
&lt;p&gt;&lt;a href="/files/2020/11/make-menu-config-3.png"&gt;&lt;img src="/files/2020/11/make-menu-config-3.png"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Exit and save the config. You are ready to build &amp;amp; setup the enrviornment, be warned this will take a long time to run!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;make tools/install
make toolchain/install
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If all has gone well, you'll be back at the prompt and it's time to start building your packages, start with your depnedencies:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;make package/ca-certificates/compile
make package/ca-certificates/install
make package/curl/compile
make package/curl/install
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;IF&lt;/em&gt; that finished without error, then the packages should be built in your bin directory...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;root@40e297a4fa8d:~/chaos_calmer# tree bin/
bin/
`-- ar71xx
    `-- packages
        |-- base
        |   |-- ca-bundle_20200601-1_all.ipk
        |   |-- libcurl_7.52.1-10_ar71xx.ipk

&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Copy &amp;amp; Install&lt;/h2&gt;
&lt;p&gt;Now all that's left is to copy &amp;amp; install the files. Since we built them in a docker container, step 1 is to get them out. First find your container ID:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
40e297a4fa8d        ubuntu:16.04        &amp;quot;/bin/bash&amp;quot;         16 hours ago        Up 16 hours                             serene_leakey
$
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;My ID is &lt;code&gt;40e297a4fa8d&lt;/code&gt; so that's the name of the server in the docker cp command, which looks like this...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ docker cp 40e297a4fa8d:/root/chaos_calmer/bin/ar71xx/packages/base/ca-bundle_20200601-1_all.ipk .
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Rename the file as recommended by Teltonika...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ mv ca-bundle_20200601-1_all.ipk tlt_custom_pkg_ca-bundle_20200601-1_all.ipk
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And then do a simple SSH Copy (SCP) to your router...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ scp tlt_custom_pkg_ca-bundle_20200601-1_all.ipk root@192.168.1.1:~/
tlt_custom_pkg_ca-bundle_20200601-1_all.ipk                                                                                                                               100%  114KB 113.1KB/s   00:01    
$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Finally, SSH onto your router and install with: &lt;code&gt;opkg install ./tlt_custom_pkg_ca-bundle_20200601-1_all.ipk&lt;/code&gt; for the ca-bundle and repeat for Curl!&lt;/p&gt;
&lt;h2&gt;End&lt;/h2&gt;
&lt;p&gt;This may or may not be the official Teltonika way of doing things so your milage may vary!&lt;/p&gt;
&lt;p&gt;References:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;https://wiki.teltonika-networks.com/view/RUT240_Package_Manager#Custom_package_upload&lt;/li&gt;
&lt;li&gt;https://openwrt.org/docs/guide-developer/single.package&lt;/li&gt;
&lt;/ul&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nick Bettison</dc:creator><pubDate>Sun, 22 Nov 2020 14:41:00 +0000</pubDate><guid isPermaLink="false">tag:www.linickx.com,2020-11-22:building-custom-rut240-teltonika-packages</guid><category>Linux</category><category>Teltonika</category><category>RutOS</category><category>OpenWRT</category></item><item><title>snmpwalk v3 and snmpget v3 examples</title><link>https://www.linickx.com/snmpwalk-v3-and-snmpget-v3-examples</link><description>&lt;p&gt;I always forget the syntax for snmpwalk/snmpget v3; so posting here to remember.&lt;/p&gt;
&lt;h3&gt;snmpwalk version 3&lt;/h3&gt;
&lt;p&gt;The command is: &lt;code&gt;snmpwalk -v3  -l authPriv -u snmp-poller -a SHA -A "PASSWORD1"  -x AES -X "PASSWORD1" 10.10.60.50&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Example output:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[nick@server ~]$  snmpwalk -v3  -l authPriv -u snmp-poller -a SHA -A &amp;quot;PASSWORD1&amp;quot;  -x AES -X &amp;quot;PASSWORD1&amp;quot; 10.10.60.50
SNMPv2-MIB::sysDescr.0 = STRING: Cisco Adaptive Security Appliance Version 9.6(2)11
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.9.1.1199
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (201155400) 23 days, 6:45:54.00
SNMPv2-MIB::sysContact.0 = STRING:
SNMPv2-MIB::sysName.0 = STRING: fw01.local
SNMPv2-MIB::sysLocation.0 = STRING:
SNMPv2-MIB::sysServices.0 = INTEGER: 4
IF-MIB::ifNumber.0 = INTEGER: 1
IF-MIB::ifIndex.1 = INTEGER: 1
IF-MIB::ifDescr.1 = STRING: Adaptive Security Appliance 'v101' interface
IF-MIB::ifType.1 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifMtu.1 = INTEGER: 1500
IF-MIB::ifSpeed.1 = Gauge32: 1000000000
IF-MIB::ifPhysAddress.1 = STRING: aa:11:22:33:44:55
IF-MIB::ifAdminStatus.1 = INTEGER: up(1)
IF-MIB::ifOperStatus.1 = INTEGER: up(1)
IF-MIB::ifLastChange.1 = Timeticks: (6600) 0:01:06.00
IF-MIB::ifInOctets.1 = Counter32: 56388261
IF-MIB::ifInUcastPkts.1 = Counter32: 316701
...
[nick@server ~]$ 
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;snmpget version 3&lt;/h3&gt;
&lt;p&gt;A command for just getting the hostname: &lt;code&gt;snmpget -v3  -l authPriv -u snmp-poller -a SHA -A "PASSWORD1"  -x AES -X "PASSWORD1" 10.10.60.50 sysName.0&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Example output:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[nick@server ~]$ snmpget -v3  -l authPriv -u snmp-poller -a SHA -A &amp;quot;PASSWORD1&amp;quot;  -x AES -X &amp;quot;PASSWORD1&amp;quot; 10.10.60.50 sysName.0
SNMPv2-MIB::sysName.0 = STRING: fw01.local
[nick@server ~]$
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A command for getting the hostname and the uptime: &lt;code&gt;snmpget -v3  -l authPriv -u snmp-poller -a SHA -A "PASSWORD1"  -x AES -X "PASSWORD1" 10.10.60.50 sysName.0 system.sysUpTime.0&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Example output:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[nick@server ~]$ snmpget -v3  -l authPriv -u snmp-poller -a SHA -A &amp;quot;PASSWORD1&amp;quot;  -x AES -X &amp;quot;PASSWORD1&amp;quot; 10.10.60.50 sysName.0 system.sysUpTime.0
SNMPv2-MIB::sysName.0 = STRING: fw01.local
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (14100) 0:02:21.00
[nick@server ~]$
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;These tests are on a Cisco ASA.&lt;/h3&gt;
&lt;p&gt;This is the ASA snmp v3 config used:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;snmp-server group the-noc v3 priv
snmp-server user snmp-poller the-noc v3 auth sha PASSWORD1 priv aes 128 PASSWORD1
snmp-server host v101 10.10.62.100 version 3 snmp-poller
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I've used the same password for authentication &amp;amp; encryption to make it easy. The username is "snmp-poller", the source of my polling is "10.10.61.100", the group "the-noc" is for if you have more than one user account.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nick Bettison</dc:creator><pubDate>Sat, 01 Apr 2017 15:22:00 +0100</pubDate><guid isPermaLink="false">tag:www.linickx.com,2017-04-01:snmpwalk-v3-and-snmpget-v3-examples</guid><category>Cisco</category><category>Security</category><category>Linux</category><category>SNMP</category><category>snmpget</category><category>snmpwalk</category></item><item><title>Automated Let's Encrypt Certificates</title><link>https://www.linickx.com/automated-lets-encrypt-certificates</link><description>&lt;p&gt;Last month &lt;a href="https://twitter.com/linickx/status/704614443653660672"&gt;I was very pleased&lt;/a&gt; that I had managed an automated &lt;a href="https://letsencrypt.org/"&gt;Let's Encrypt certificate&lt;/a&gt; renewal; the other night the renewal broke as the certificate was issued from a different intermediate CA, so help others out I thought I'd share with you my cron script.&lt;/p&gt;
&lt;p&gt;Before copy/pasting this script, you need to get started with &lt;a href="https://github.com/diafygi/acme-tiny"&gt;tiny acme&lt;/a&gt;. I also recommend you read &lt;a href="https://scotthelme.co.uk/setting-up-le/"&gt;this post by Scott Heleme&lt;/a&gt; as it walks through the end-to-end process.&lt;/p&gt;
&lt;p&gt;Once you're all setup, you can use something like the below script on a monthly basis (&lt;em&gt;update paths for your environment and the email address&lt;/em&gt;):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#!/bin/bash
echo &amp;quot;----------------------&amp;quot;
echo &amp;quot;Start:&amp;quot; `date`

# Backup
cp -v /home/letsencrypt/priv/signed.crt /home/letsencrypt/priv/old/signed_$(date +%F).crt
cp -v /home/letsencrypt/priv/chained.pem /home/letsencrypt/priv/old/chained_$(date +%F).crt

# Renewal
python /home/letsencrypt/bin/letsencrypt_tiny.py --account-key /home/letsencrypt/priv/my.key --csr /home/letsencrypt/priv/my.csr --letsencrypt-dir /home/letsencrypt/challenges/ &amp;gt; /home/letsencrypt/priv/signed.crt 

# Find Issuer
ISSUER=`openssl x509 -noout -issuer -in /home/letsencrypt/priv/signed.crt | awk 'NF&amp;gt;1{print $NF}'`

echo &amp;quot;Certificate issued by $ISSUER&amp;quot;

case $ISSUER in
    X1)
        ISSUER_CERT=&amp;quot;https://letsencrypt.org/certs/lets-encrypt-x1-cross-signed.pem&amp;quot;
        ;;
    X2)
        ISSUER_CERT=&amp;quot;https://letsencrypt.org/certs/lets-encrypt-x2-cross-signed.pem&amp;quot;
        ;;
    X3)
        ISSUER_CERT=&amp;quot;https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem&amp;quot;
        ;;
    X4)
        ISSUER_CERT=&amp;quot;https://letsencrypt.org/certs/lets-encrypt-x4-cross-signed.pem&amp;quot;
        ;;
    *)
        echo -e &amp;quot;Undefined Intermediate CA - Please fix /home/letsencrypt/bin/letsencrypt.sh - Failed to match Intermediate CA $ISSUER not found&amp;quot; | mail -s &amp;quot;LE Renewal Error&amp;quot; &amp;quot;changeme_at_gmail_dot_com&amp;quot;
        echo &amp;quot;** Error: Failed to match Intermediate CA $ISSUER not found **&amp;quot;
        cp -v /home/letsencrypt/priv/old/chained_$(date +%F).crt /home/letsencrypt/priv/chained.pem
        exit
    ;;
esac

# Download Intermetdiate CA Cert
echo &amp;quot;Cert URL: $ISSUER_CERT&amp;quot;
wget -O - $ISSUER_CERT &amp;gt; /home/letsencrypt/priv/intermediate.pem

# Build Chain
cat /home/letsencrypt/priv/signed.crt /home/letsencrypt/priv/intermediate.pem &amp;gt; /home/letsencrypt/priv/chained.pem

# Restart nginx to install the cert
sudo service nginx reload
echo &amp;quot;End:&amp;quot; `date`
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Things to note if the renewal breaks:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;It doesn't retry. Look at adding this smart renewal script to your daily cron: &lt;a href="https://github.com/ScottHelme/Lets-Encrypt-Smart-Renew/blob/master/smartRenew.sh"&gt;https://github.com/ScottHelme/Lets-Encrypt-Smart-Renew/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;It emails you and puts the old certificate chain back (&lt;em&gt;then quits&lt;/em&gt;)&lt;/li&gt;
&lt;/ol&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nick Bettison</dc:creator><pubDate>Tue, 05 Apr 2016 17:01:00 +0100</pubDate><guid isPermaLink="false">tag:www.linickx.com,2016-04-05:automated-lets-encrypt-certificates</guid><category>certificate</category><category>linux</category><category>security</category><category>ssl</category></item><item><title>pip install crassh</title><link>https://www.linickx.com/pip-install-crassh</link><description>&lt;div style="float:right"&gt;&lt;a href="/files/2016/02/atom_screenshot.png"&gt;&lt;img src="/files/2016/02/atom_screenshot.png" alt="atom screenshot" height="93px" width="168px"/&gt;&lt;/a&gt;&lt;/div&gt;

&lt;p&gt;Recently myself (&lt;em&gt;and a maybe colleague or two&lt;/em&gt;) has been copy/pasting parts of &lt;a href="https://github.com/linickx/crassh/"&gt;C.R.A.SSH&lt;/a&gt; (crassh) my python script for automating commands on Cisco IOS devices into personal scripts to get something done; knowing there must be a better a way I decided to turn crassh into a module which can/should be easy to install on linux or OSX systems with &lt;a href="https://pypi.python.org/pypi/pip"&gt;pip&lt;/a&gt;. PIP is a python (cross platform) package manager that now crassh is available in, i.e. &lt;code&gt;pip install crassh&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Below is an output from my machine, as you can see pip will install any necessary dependencies:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ pip install crassh
Collecting crassh
  Downloading CraSSH-2.02.tar.gz
Collecting paramiko&amp;gt;=1.10 (from crassh)
  Using cached paramiko-1.16.0-py2.py3-none-any.whl
Collecting pycrypto!=2.4,&amp;gt;=2.1 (from paramiko&amp;gt;=1.10-&amp;gt;crassh)
Collecting ecdsa&amp;gt;=0.11 (from paramiko&amp;gt;=1.10-&amp;gt;crassh)
  Using cached ecdsa-0.13-py2.py3-none-any.whl
Building wheels for collected packages: crassh
  Running setup.py bdist_wheel for crassh
Successfully built crassh
Installing collected packages: pycrypto, ecdsa, paramiko, crassh
Successfully installed crassh-2.2 ecdsa-0.13 paramiko-1.16.0 pycrypto-2.6.1
$
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I'm about to start work on some proper documentation , but to get you started there are four functions that most people will want/use: &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;crassh.connect()&lt;/li&gt;
&lt;li&gt;crassh.send_command()&lt;/li&gt;
&lt;li&gt;crassh.disconnect()&lt;/li&gt;
&lt;li&gt;crassh.readtxtfile()&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The first three are self explanatory, the last one is very useful as it'll read in a plain text file (&lt;em&gt;one line at at time&lt;/em&gt;) and use it as an array, typically the plain text file would be a list of IP address to connect to or a list of commands to execute.&lt;/p&gt;
&lt;p&gt;To show how crassh can be used, below is a simple example to audit to switches for the SNMP community string &lt;code&gt;public&lt;/code&gt; - &lt;strong&gt;A security no-no!&lt;/strong&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#!/usr/bin/env python
# coding=utf-8

import crassh

# Variables
routers = [&amp;quot;10.159.83.135&amp;quot;, &amp;quot;10.159.83.136&amp;quot;]
username = &amp;quot;nick&amp;quot;
password = &amp;quot;nick&amp;quot;

# Loop
for device in routers:

    hostname = crassh.connect(device, username, password)
    output = crassh.send_command(&amp;quot;show run | inc snmp-server community&amp;quot;, hostname)
    crassh.disconnect()

    # Split the output by spaces so we can search the response
    words = output.split()

    # Look for &amp;quot;public&amp;quot; in the output
    for x in words:
        if x == &amp;quot;public&amp;quot;:
            print(&amp;quot;DANGER: Public SNMP Community set on %s [%s]&amp;quot; % (hostname, device))
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I've saved the file as &lt;code&gt;no_public.py&lt;/code&gt; and this is the response...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ python no_public.py 
Connecting to 10.159.83.135 ... 
Connecting to 10.159.83.136 ... 
DANGER: Public SNMP Community set on r2 [10.159.83.136]
$
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Obviously you could do a lot more than just output but hopefully this'll give you an idea.&lt;/p&gt;
&lt;p&gt;NOTE: Instead of routers being an array, I could have done &lt;code&gt;routers = crassh.readtxtfile("./routers.txt")&lt;/code&gt; where routers.txt was a plain text file with one IP address per line.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nick Bettison</dc:creator><pubDate>Sun, 14 Feb 2016 11:23:00 +0000</pubDate><guid isPermaLink="false">tag:www.linickx.com,2016-02-14:pip-install-crassh</guid><category>python</category><category>crassh</category><category>linux</category><category>cisco</category><category>osx</category></item><item><title>Alpine Linux Raspberry Pi and Wireless (WiFi) firmware</title><link>https://www.linickx.com/alpine-linux-raspberry-pi-and-wireless-wifi-firmware</link><description>&lt;p&gt;&lt;a href="http://pidora.ca"&gt;Pidora&lt;/a&gt; doesn't appear to be being maintained anymore and CentOS/Fedora support for the &lt;a href="https://www.raspberrypi.org"&gt;Pi&lt;/a&gt; appears to be focused on the version 2 hardware, so I've been looking for an alternative distro. I'm very early on in my experimentation with docker, and docker is not in anyway related to my Pi, but since the &lt;a href="https://news.ycombinator.com/item?id=10998667"&gt;unofficial announcement&lt;/a&gt; that they were moving away from Ubuntu to to &lt;a href="alpinelinux.org/"&gt;Alpine Linux&lt;/a&gt;, I thought that's was as good a distro to try as any... funny how we're influenced by the media.&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://wiki.alpinelinux.org/wiki/Raspberry_Pi"&gt;Alpine Linux Raspberry Pi&lt;/a&gt; install guide is &lt;em&gt;insanely easy&lt;/em&gt;, unpack the files onto a single disk partition, no fricking around with partitions, no &lt;code&gt;dd&lt;/code&gt; just unpack and boot! The &lt;a href="http://wiki.alpinelinux.org/wiki/Connecting_to_a_wireless_access_point"&gt;Alpine WiFi guide&lt;/a&gt; isn't bad either but IMHO isn't complete as I couldn't start the &lt;code&gt;wpa_supplicant&lt;/code&gt; service:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pi # /etc/init.d/wpa_supplicant start
 * Starting WPA Supplicant Daemon ...
Successfully initialized wpa_supplicant
Could not set interface wlan0 flags (UP): Resource temporarily unavailable
nl80211: Could not set interface 'wlan0' UP
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
wlan0: Failed to initialize driver interface
 * start-stop-daemon: failed to start `/sbin/wpa_supplicant'
 * Failed to start wpa_supplicant 
 * ERROR: wpa_supplicant failed to start
pi #
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A quick poke at &lt;code&gt;/var/log/messages&lt;/code&gt; reveals that the service is missing firmware:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;kern.info kernel: [33264.393174] ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'
kern.warn kernel: [33264.393356] rt2800usb 1-1.4:1.0: Direct firmware load for rt2870.bin failed with error -2
kern.warn kernel: [33264.393377] rt2800usb 1-1.4:1.0: Falling back to user helper
daemon.err /etc/init.d/wpa_supplicant[2101]: start-stop-daemon: failed to start `/sbin/wpa_supplicant'
kern.err kernel: [33264.423493] ieee80211 phy0: rt2x00lib_request_firmware: Error - Failed to request Firmware
daemon.err /etc/init.d/wpa_supplicant[2083]: ERROR: wpa_supplicant failed to start
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;a href="http://www.amazon.co.uk/gp/product/B00EZOQFHO"&gt;USB WiFi Adapter&lt;/a&gt; I purchased has a lot of reviews saying "&lt;em&gt;it just works&lt;/em&gt;" on various Pi distro's and it worked fine in pidora, so I figured that this driver was probably something generic. A few googles later and I find the &lt;a href="https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/tree/"&gt;Linux Kernel Firmware page&lt;/a&gt; and I find a copy of &lt;a href="https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/plain/rt2870.bin"&gt;rt2870.bin&lt;/a&gt; which I place in &lt;code&gt;/lib/firmware/&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;After a little &lt;code&gt;/etc/init.d/wpa_supplicant restart&lt;/code&gt; I have working WiFi!&lt;/p&gt;
&lt;p&gt;The alpine documentation is clear, on a Pi the install is in disk-less mode and forces everything into memory, therefore I'm going to loose the firmware after a reboot. To make the change persistent, run &lt;code&gt;lbu include /lib/firmware/rt2870.bin;lbu commit&lt;/code&gt;... give it a reboot, and cross your fingers!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nick Bettison</dc:creator><pubDate>Tue, 09 Feb 2016 17:41:00 +0000</pubDate><guid isPermaLink="false">tag:www.linickx.com,2016-02-09:alpine-linux-raspberry-pi-and-wireless-wifi-firmware</guid><category>Alpine</category><category>Linux</category><category>WiFi</category><category>Raspberry Pi</category></item><item><title>CentOS7 - syslog-ng: Error setting capabilities, capability management disabled; error=Operation not permitted</title><link>https://www.linickx.com/centos7--syslog-ng-error-setting-capabilities-capability-management-disabled-erroroperation-not-permitted</link><description>&lt;p&gt;I've just installed &lt;a href="https://www.balabit.com/network-security/syslog-ng"&gt;syslog-ng&lt;/a&gt; from &lt;a href="https://fedoraproject.org/wiki/EPEL"&gt;epel&lt;/a&gt; onto a test CentOS7 box and found that the service wouldn't start, a quick verify of my &lt;code&gt;syslog-ng.conf&lt;/code&gt;, with &lt;code&gt;syslog-ng -s&lt;/code&gt; came back like so...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;syslog-ng: Error setting capabilities, capability management disabled; error='Operation not permitted'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;a href="http://serverfault.com/questions/524518/error-setting-capabilities-capability-management-disabled"&gt;debain fix&lt;/a&gt; suggests something like: &lt;code&gt;syslog-ng -no-caps -s&lt;/code&gt;, which seems to work. What is odd is that &lt;code&gt;/usr/lib/systemd/system/syslog-ng.service&lt;/code&gt; doesn't have it, but the service still seems to work once you've fixed and syntax errors!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nick Bettison</dc:creator><pubDate>Wed, 23 Dec 2015 12:13:00 +0000</pubDate><guid isPermaLink="false">tag:www.linickx.com,2015-12-23:centos7--syslog-ng-error-setting-capabilities-capability-management-disabled-erroroperation-not-permitted</guid><category>CentOS</category><category>Linux</category><category>Syslog-NG</category></item><item><title>Cisco NTP Authentication to Linux Server</title><link>https://www.linickx.com/cisco-ntp-authentication-to-linux-server</link><description>&lt;div style="float:right"&gt;
&lt;a href="/files/2015/05/ntp.png"&gt;&lt;img src="/files/2015/05/ntp-150x150.png" /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;NTP Authentication is a recommended best security practice; there are a lot of documents out there on how to setup NTP authentication between two Cisco IOS devices but anything between Cisco and LINUX is few and far between.&lt;/p&gt;
&lt;p&gt;I have setup a LINUX Server (&lt;em&gt;Redhat/CentOS&lt;/em&gt;) box, that will act as an upstream proxy to &lt;a href="http://pool.ntp.org"&gt;pool.ntp.org&lt;/a&gt;. NTP authentication will be enabled on the LINUX box so that the downstream Cisco IOS box (&lt;em&gt;router/switch&lt;/em&gt;) can be configured with authentication.&lt;/p&gt;
&lt;h2&gt;CentOS Server config&lt;/h2&gt;
&lt;p&gt;Start with installing and starting NTP.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo yum install ntpd
sudo systemctl start  ntpd.service
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;... don't forget to open the firewall...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo firewall-cmd --permanent --zone=public --add-port=123/udp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next, add a key to &lt;code&gt;/etc/ntp/keys&lt;/code&gt;...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# For more information about this file, see the man page ntp_auth(5).
#
# id    type    key
1 M Cisco123
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What I've done here is, add a key with id &lt;code&gt;1&lt;/code&gt; that is type &lt;code&gt;MD5&lt;/code&gt; (&lt;em&gt;authentication&lt;/em&gt;), the key is &lt;code&gt;Cisco123&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Now, setup &lt;code&gt;/etc/ntp.conf&lt;/code&gt;, below is an example of a minimal config (&lt;em&gt;with comments removed, backup your original&lt;/em&gt;).&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

driftfile /var/lib/ntp/drift
restrict default nomodify notrap nopeer noquery
restrict 127.0.0.1
restrict ::1

restrict 1.1.1.0 mask 255.255.255.252 nomodify notrap
restrict 2.2.2.0 mask 255.255.255.252 nomodify notrap

server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

keys /etc/ntp/keys
trustedkey 1

disable monitor
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Take note of two things.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;code&gt;trustedkey 1&lt;/code&gt; must match the ID in &lt;code&gt;/etc/ntp/keys&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;restrict 1.1.1.0 mask 255.255.255.252 nomodify notrap&lt;/code&gt; this says that any client (&lt;em&gt;i.e IOS router&lt;/em&gt;) in the 1.1.1.0/30 network can &lt;strong&gt;query&lt;/strong&gt; out CentOS time server&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Restart NTP to make the changes effective.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo systemctl restart  ntpd.service
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Use &lt;code&gt;ntpq&lt;/code&gt; to check its working...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[nick@CentOS7 ~]$ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*ntp1.as34288.ne 85.158.25.72     2 u   31   64  377   56.363  -52.207  15.576
+ntp.coreless.ne 77.40.226.114    2 u   30   64  377   64.117  -45.444  10.966
-fra94-1-78-193- 212.83.158.83    3 u   23   64  377   42.197  -44.928  10.275
+dn3t.de         129.69.1.153     2 u   98   64  376   44.418  -42.061   7.436
[nick@CentOS7 ~]$
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Don't move onto the IOS box until &lt;code&gt;ntpq&lt;/code&gt; shows a &lt;code&gt;*&lt;/code&gt; next to one of the upstream servers. You need clocks sync'd on the linux box before the IOS one will work. It should take at least 5 minutes to sync up; if you are having issues, manually set the linux clock to within a minute and restart the NTP service.&lt;/p&gt;
&lt;h2&gt;Cisco IOS Config&lt;/h2&gt;
&lt;p&gt;My Cisco router is 1.1.1.1, my linux server is 1.1.1.2, make sure both boxes can ping each other ;-)&lt;/p&gt;
&lt;p&gt;The router config is...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ntp authentication-key 1 md5 Cisco123
ntp trusted-key 1
ntp server 1.1.1.2 key 1
ntp authenticate
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Take note of the order! I wasted loads of time troubleshooting the debug error &lt;code&gt;NTP Core(INFO): 1.1.1.2 C01C 8C bad_auth no key&lt;/code&gt; because the command order is &lt;strong&gt;fussy&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can check it's working with the &lt;code&gt;show ntp association&lt;/code&gt; commands... notice on the detailed version is says &lt;code&gt;authenticated&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;R1#show ntp as

  address         ref clock       st   when   poll reach  delay  offset   disp
*~1.1.1.2         81.94.123.17     3     41     64     7 16.017  -4.263  1.893
 * sys.peer, # selected, + candidate, - outlyer, x falseticker, ~ configured
R1#show ntp as detail
1.1.1.2 configured, ipv4, authenticated, our_master, sane, valid, stratum 3
ref ID 81.94.123.17   , time D9104931.F7121393 (13:46:25.965 UTC Wed May 27 2015)
our mode client, peer mode server, our poll intvl 64, peer poll intvl 64
root delay 56.70 msec, root disp 63.87, reach 7, sync dist 6302.70
delay 16.01 msec, offset -4.2633 msec, dispersion 1.89, jitter 6199.94 msec
precision 2**24, version 4
assoc id 42451, assoc name 1.1.1.2
assoc in packets 40, assoc out packets 42, assoc error packets 0
org time 00000000.00000000 (00:00:00.000 UTC Mon Jan 1 1900)
rec time D91049C8.3C62C714 (13:48:56.235 UTC Wed May 27 2015)
xmt time D91049C8.3C62C714 (13:48:56.235 UTC Wed May 27 2015)
filtdelay =   107.76   51.78   16.01   19.97   23.99   19.84   32.00   43.89
filtoffset = 16398.9   76.43   -4.26   -1.38   22.31   27.85   22.48    8.67
filterror =     0.00    0.99    1.87    1.90    1.93    1.96    1.99    2.02
minpoll = 6, maxpoll = 10

R1#
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Footnote&lt;/h3&gt;
&lt;p&gt;NTP authentication is one way, the client authenticates the response from the server, so authentication is optional.&lt;/p&gt;
&lt;p&gt;I also have another router (&lt;em&gt;2.2.2.2&lt;/em&gt;) talking to the CentOS linux server (&lt;em&gt;1.1.1.2&lt;/em&gt;) with a default config....&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ntp server 1.1.1.2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And it works just fine...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;R2#show ntp as

  address         ref clock       st   when   poll reach  delay  offset   disp
*~1.1.1.2         81.94.123.17     3     18     64     1 39.632  -1.911 187.61
 * sys.peer, # selected, + candidate, - outlyer, x falseticker, ~ configured
R2#
R2#
R2#show ntp as det
1.1.1.2 configured, ipv4, our_master, sane, valid, stratum 3
ref ID 81.94.123.17   , time D9104B06.F4F12334 (13:54:14.956 UTC Wed May 27 2015)
our mode client, peer mode server, our poll intvl 64, peer poll intvl 64
root delay 47.43 msec, root disp 55.89, reach 1, sync dist 322.40
delay 39.63 msec, offset -1.9110 msec, dispersion 187.61, jitter 34.98 msec
precision 2**24, version 4
assoc id 48023, assoc name 1.1.1.2
assoc in packets 8, assoc out packets 8, assoc error packets 0
org time 00000000.00000000 (00:00:00.000 UTC Mon Jan 1 1900)
rec time D9104B96.A0AFE3F2 (13:56:38.627 UTC Wed May 27 2015)
xmt time D9104B96.A0AFE3F2 (13:56:38.627 UTC Wed May 27 2015)
filtdelay =    76.05   48.05   39.83   56.03   39.85   39.63    0.00    0.00
filtoffset =   64.31   33.05    5.55   17.13  -11.56   -1.91    0.00    0.00
filterror =     0.00    0.03    0.06    0.09    0.12    0.15 16000.0 16000.0
minpoll = 6, maxpoll = 10

R2#
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So make sure your clients have authentication enabled.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nick Bettison</dc:creator><pubDate>Wed, 27 May 2015 14:10:00 +0100</pubDate><guid isPermaLink="false">tag:www.linickx.com,2015-05-27:cisco-ntp-authentication-to-linux-server</guid><category>Cisco</category><category>Linux</category><category>NTP</category><category>CentOS</category><category>Security</category></item><item><title>RPM SPECS for Python CiscoConfParse</title><link>https://www.linickx.com/rpm-specs-for-python-ciscoconfparse</link><description>&lt;p&gt;Recently I have been using &lt;a href="http://www.pennington.net/py/ciscoconfparse/"&gt;ciscoconfparse&lt;/a&gt; to loop through Cisco configs, installing on my local laptop is straightforward with &lt;code&gt;pip&lt;/code&gt; however getting it onto a &lt;em&gt;customers&lt;/em&gt; linux jump server can be a bit more tricky (proxies, build deps and the like).&lt;/p&gt;
&lt;p&gt;For Redhat/Centos (6) boxes I found an out of date &lt;a href="http://anorien.csc.warwick.ac.uk/mirrors/OBS/warwick.ac.uk:/CSC:/Public/CentOS_6/src/python-ciscoconfparse-1.2.15-1.1.csc.src.rpm"&gt;.src.rpm&lt;/a&gt;  therefore I have updated the &lt;a href="http://www.rpm.org/max-rpm/ch-rpm-inside.html"&gt;SPEC&lt;/a&gt; file:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/files/2015/03/python-ciscoconfparse.spec"&gt;python-ciscoconfparse.spec&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I have made two changes, I updated to the ciscoconfparse 1.2.16 and added the python-ipaddr dependency.&lt;/p&gt;
&lt;p&gt;To build your own yo will also need:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="/files/2015/03/python-setuptools_hg.spec"&gt;python-setuptools_hg.spec&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The only change I have made there is to add the correct download URL to the &lt;code&gt;Source&lt;/code&gt; so that it build without the human having to put the package in the right directory.... other than that all other build deps should be in the standard &lt;code&gt;base&lt;/code&gt; repositories.&lt;/p&gt;
&lt;p&gt;Building them is straight forward with &lt;code&gt;rebuild -ba&lt;/code&gt;, I have &lt;a href="https://www.linickx.com/rebuilding-rpms-getting-started-guide"&gt;an old post here&lt;/a&gt;... fedora have a much &lt;a href="https://fedoraproject.org/wiki/How_to_create_an_RPM_package"&gt;more comprehensive one here&lt;/a&gt;... I haven't uploaded pre-built RPMs &lt;a href="/files/rpm/"&gt;to my repo&lt;/a&gt; as I haven't found the need to for years, maybe this is a good excuse to resurrect it!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Nick Bettison</dc:creator><pubDate>Mon, 30 Mar 2015 15:59:00 +0100</pubDate><guid isPermaLink="false">tag:www.linickx.com,2015-03-30:rpm-specs-for-python-ciscoconfparse</guid><category>Linux</category><category>Python</category><category>CentOS</category><category>Redhat</category><category>Cisco</category></item></channel></rss>