Thomas Mullaly

DevOps, Security and IT Leadership

CIDR Subnet Mask Cheat Sheet

Netmask              Netmask (binary)                 CIDR     Notes    
_____________________________________________________________________________
255.255.255.255  11111111.11111111.11111111.11111111  /32  Host (single addr)
255.255.255.254  11111111.11111111.11111111.11111110  /31  Unuseable
255.255.255.252  11111111.11111111.11111111.11111100  /30    2  useable
255.255.255.248  11111111.11111111.11111111.11111000  /29    6  useable
255.255.255.240  11111111.11111111.11111111.11110000  /28   14  useable
255.255.255.224  11111111.11111111.11111111.11100000  /27   30  useable
255.255.255.192  11111111.11111111.11111111.11000000  /26   62  useable
255.255.255.128  11111111.11111111.11111111.10000000  /25  126  useable
255.255.255.0    11111111.11111111.11111111.00000000  /24 "Class C" 254 useable

255.255.254.0    11111111.11111111.11111110.00000000  /23    2  Class C's
255.255.252.0    11111111.11111111.11111100.00000000  /22    4  Class C's
255.255.248.0    11111111.11111111.11111000.00000000  /21    8  Class C's
255.255.240.0    11111111.11111111.11110000.00000000  /20   16  Class C's
255.255.224.0    11111111.11111111.11100000.00000000  /19   32  Class C's
255.255.192.0    11111111.11111111.11000000.00000000  /18   64  Class C's
255.255.128.0    11111111.11111111.10000000.00000000  /17  128  Class C's
255.255.0.0      11111111.11111111.00000000.00000000  /16  "Class B"
     
255.254.0.0      11111111.11111110.00000000.00000000  /15    2  Class B's
255.252.0.0      11111111.11111100.00000000.00000000  /14    4  Class B's
255.248.0.0      11111111.11111000.00000000.00000000  /13    8  Class B's
255.240.0.0      11111111.11110000.00000000.00000000  /12   16  Class B's
255.224.0.0      11111111.11100000.00000000.00000000  /11   32  Class B's
255.192.0.0      11111111.11000000.00000000.00000000  /10   64  Class B's
255.128.0.0      11111111.10000000.00000000.00000000  /9   128  Class B's
255.0.0.0        11111111.00000000.00000000.00000000  /8   "Class A"
  
254.0.0.0        11111110.00000000.00000000.00000000  /7
252.0.0.0        11111100.00000000.00000000.00000000  /6
248.0.0.0        11111000.00000000.00000000.00000000  /5
240.0.0.0        11110000.00000000.00000000.00000000  /4
224.0.0.0        11100000.00000000.00000000.00000000  /3
192.0.0.0        11000000.00000000.00000000.00000000  /2
128.0.0.0        10000000.00000000.00000000.00000000  /1
0.0.0.0          00000000.00000000.00000000.00000000  /0   IP space

MikroTik RouterBoard Backup Script

#!/bin/bash

base=/home/backups/mikrotik/hosts

hour=`date "+%H"`
dow=`date "+%w"`
dom=`date "+%d"`

if [ "$dom" = "01" ]; then
	backup_file=`date "+%Y-%m-%d"`.monthly
elif [ "$dow" = "0" ]; then
	backup_file=`date "+%Y-%m-%d"`.weekly
else
	backup_file=`date "+%Y-%m-%d"`.daily
fi

find $base -mtime +30 -name "*weekly*" -exec rm {} \;
find $base -mtime +7 -name "*daily*" -exec rm {} \;

cd $base
ls -1 | while read host ; do
	echo backing up $host
	ssh -n admin-ssh@$host "/system backup save name=$backup_file" > /dev/null
	ssh -n admin-ssh@$host "/export file=$backup_file" > /dev/null
	scp admin-ssh@$host:$backup_file.backup $base/$host > /dev/null
	scp admin-ssh@$host:$backup_file.rsc $base/$host > /dev/null
	echo "rm $backup_file.backup" | sftp admin-ssh@$host &> /dev/null
	echo "rm $backup_file.rsc" | sftp admin-ssh@$host &> /dev/null
done

Request Tracker 4.2.9 Install on Ubuntu 14.04

I started a new job last week and one of the systems they don’t have is a ticket request tracker. I’ve come to be dependent on Request Tracker (RT) from my time at Northeastern University and at UMass Boston. At Orange, we managed our tasks with a share point list and an email alias, which worked fine, but looking back, I should have implemented RT.

The List of Os Variants in KVM

root@kvm:~# virt-install --os-variant list
win7                 : Microsoft Windows 7
vista                : Microsoft Windows Vista
winxp64              : Microsoft Windows XP (x86_64)
winxp                : Microsoft Windows XP
win2k                : Microsoft Windows 2000
win2k8               : Microsoft Windows Server 2008
win2k3               : Microsoft Windows Server 2003
openbsd4             : OpenBSD 4.x
freebsd8             : FreeBSD 8.x
freebsd7             : FreeBSD 7.x
freebsd6             : FreeBSD 6.x
solaris9             : Sun Solaris 9
solaris10            : Sun Solaris 10
opensolaris          : Sun OpenSolaris
netware6             : Novell Netware 6
netware5             : Novell Netware 5
netware4             : Novell Netware 4
msdos                : MS-DOS
generic              : Generic
debianwheezy         : Debian Wheezy
debiansqueeze        : Debian Squeeze
debianlenny          : Debian Lenny
debianetch           : Debian Etch
fedora18             : Fedora 18
fedora17             : Fedora 17
fedora16             : Fedora 16
fedora15             : Fedora 15
fedora14             : Fedora 14
fedora13             : Fedora 13
fedora12             : Fedora 12
fedora11             : Fedora 11
fedora10             : Fedora 10
fedora9              : Fedora 9
fedora8              : Fedora 8
fedora7              : Fedora 7
fedora6              : Fedora Core 6
fedora5              : Fedora Core 5
mageia1              : Mageia 1 and later
mes5.1               : Mandriva Enterprise Server 5.1 and later
mes5                 : Mandriva Enterprise Server 5.0
mandriva2010         : Mandriva Linux 2010 and later
mandriva2009         : Mandriva Linux 2009 and earlier
rhel7                : Red Hat Enterprise Linux 7
rhel6                : Red Hat Enterprise Linux 6
rhel5.4              : Red Hat Enterprise Linux 5.4 or later
rhel5                : Red Hat Enterprise Linux 5
rhel4                : Red Hat Enterprise Linux 4
rhel3                : Red Hat Enterprise Linux 3
rhel2.1              : Red Hat Enterprise Linux 2.1
sles11               : Suse Linux Enterprise Server 11
sles10               : Suse Linux Enterprise Server
opensuse12           : openSuse 12
opensuse11           : openSuse 11
ubuntutrusty         : Ubuntu 14.04 LTS (Trusty Tahr)
ubuntusaucy          : Ubuntu 13.10 (Saucy Salamander)
ubunturaring         : Ubuntu 13.04 (Raring Ringtail)
ubuntuquantal        : Ubuntu 12.10 (Quantal Quetzal)
ubuntuprecise        : Ubuntu 12.04 LTS (Precise Pangolin)
ubuntuoneiric        : Ubuntu 11.10 (Oneiric Ocelot)
ubuntunatty          : Ubuntu 11.04 (Natty Narwhal)
ubuntumaverick       : Ubuntu 10.10 (Maverick Meerkat)
ubuntulucid          : Ubuntu 10.04 LTS (Lucid Lynx)
ubuntukarmic         : Ubuntu 9.10 (Karmic Koala)
ubuntujaunty         : Ubuntu 9.04 (Jaunty Jackalope)
ubuntuintrepid       : Ubuntu 8.10 (Intrepid Ibex)
ubuntuhardy          : Ubuntu 8.04 LTS (Hardy Heron)
virtio26             : Generic 2.6.25 or later kernel with virtio
generic26            : Generic 2.6.x kernel
generic24            : Generic 2.4.x kernel

How to Create a Gold Master Windows 7 KVM Guest Domain Using Virsh

root@kvm:/var/lib/libvirt/images# virt-install -n Gold-Win7 -r 1024 /
--disk path=/var/lib/libvirt/images/Gold-Win7.qcow2,size=40,format=qcow2 /
-c /var/lib/libvirt/images/iso/7600.16385.090713-1255_x64fre_enterprise_en-us_EVAL_Eval_Enterprise-GRMCENXEVAL_EN_DVD.iso /
--accelerate --network network=default --connect=qemu:///system --vnc /
--noautoconsole -v --os-type=windows --os-variant=win7

Starting install...
Allocating 'Gold-Win7.qcow2'                              |  40 GB     00:00     
Creating domain...                                        |    0 B     00:01     
Domain installation still in progress. Waiting for installation to complete.

How to Create a Gold Master Windows XP KVM Guest Domain Using Virsh

I’m going to recreate my windows xp domain and fix the mistakes I made earlier. I thought that Windows XP didn’t like the qcow2 format, even though I knew it shouldn’t matter. It turns out that Windows XP didn’t like having the disk bus to be virtio, I removed that configuration option and it saw the disk when I booted off the install iso. I also had to remove the virtio option from the network configuration setting.

How to Delete a KVM Guest Using Virsh

My virtualization needs are usually for sandboxing and learning. I intended to start learning more devopsy ways of deploying but I have current needs to learn some new server and client software in a traditional desktop and server IT environment. That’s why I’m reverting back in my posts to making a gold master image of a server or desktop and cloning it.