New books

Ordered on Amazon today:

I’m not sure what to make of the fact that these books are nearly 20 years old… totally out of date, but all that is available? What’s up with that?

Netfilter and iptables

This evening I read the iptables man page and Linux iptables Pocket Reference from cover-to-cover; my notes are here: Netfilter.

I think at this point I am ready to use iptables in anger for the first time in a long time, and the first time ever on a router.

However, before I take that on, I’m going to have a quick diversion into the following books, and then sleep, and I will do my iptables programming when I wake up tomorrow.

QEMU/KVM Attaching a Virtual NIC Directly to a Physical Interface

Man, it took me a while to figure out how to do this! Over on Attaching a Virtual NIC Directly to a Physical Interface I figured out I could use this XML in Virtual Machine Manager (virt-manager) for my NIC device:

<interface type='direct'>
  <source dev='enp9s0' mode='bridge'/>
</interface>

That then gets expanded automatically to something like this:

<interface type="direct">
  <mac address="52:54:00:ce:5b:09"/>
  <source dev="enp9s0" mode="bridge"/>
  <target dev="macvtap4"/>
  <model type="rtl8139"/>
  <alias name="net0"/>
  <address type="pci" domain="0x0000" bus="0x10" slot="0x01" function="0x0"/>
</interface>

Update: ah, balls. This doesn’t completely work, because the guest can’t connect to the host, and vice versa, even though both the host and the guest can connect to the internet. This is a problem for another day. Maybe this or this will help?

Mail log IP address count

The following monster will parse the mail log and report on unique host connections along with a count.

cat /var/log/mail.log | \
  grep ' connect from unknown' | \
  awk '{ print $8 }' | \
  sort | \
  sed -n 's/.*\[\([0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\)\].*/\1/p' | \
  awk '{count[$1]++} END {for (word in count) print count[word], word}' | \
  sort -n

Network outage

I’m in the process of moving some of my web systems to new servers. The blog.jj5.net has been completed, svn.jj5.net is a working progress, and some of www.jj5.net is broken until I can get around to fixing that too. This outage will manifest as some images which won’t load in blog posts. I’m sleepy now, so I’ll try and fix this tomorrow when I wake up.