Netmask table

Bitmask (Bits) Dotted Decimal Hexadecimal Binary
/0 0.0.0.0 0x00000000 00000000 00000000 00000000 00000000
/1 128.0.0.0 0x80000000 10000000 00000000 00000000 00000000
/2 192.0.0.0 0xc0000000 11000000 00000000 00000000 00000000
/3 224.0.0.0 0xe0000000 11100000 00000000 00000000 00000000
/4 240.0.0.0 0xf0000000 11110000 00000000 00000000 00000000
/5 248.0.0.0 0xf8000000 11111000 00000000 00000000 00000000
/6 252.0.0.0 0xfc000000 11111100 00000000 00000000 00000000
/7 254.0.0.0 0xfe000000 11111110 00000000 00000000 00000000
/8 255.0.0.0 0xff000000 11111111 00000000 00000000 00000000
/9 255.128.0.0 0xff800000 11111111 10000000 00000000 00000000
/10 255.192.0.0 0xffc00000 11111111 11000000 00000000 00000000
/11 255.224.0.0 0xffe00000 11111111 11100000 00000000 00000000
/12 255.240.0.0 0xfff00000 11111111 11110000 00000000 00000000
/13 255.248.0.0 0xfff80000 11111111 11111000 00000000 00000000
/14 255.252.0.0 0xfffc0000 11111111 11111100 00000000 00000000
/15 255.254.0.0 0xfffe0000 11111111 11111110 00000000 00000000
/16 255.255.0.0 0xffff0000 11111111 11111111 00000000 00000000
/17 255.255.128.0 0xffff8000 11111111 11111111 10000000 00000000
/18 255.255.192.0 0xffffc000 11111111 11111111 11000000 00000000
/19 255.255.224.0 0xffffe000 11111111 11111111 11100000 00000000
/20 255.255.240.0 0xfffff000 11111111 11111111 11110000 00000000
/21 255.255.248.0 0xfffff800 11111111 11111111 11111000 00000000
/22 255.255.252.0 0xfffffc00 11111111 11111111 11111100 00000000
/23 255.255.254.0 0xfffffe00 11111111 11111111 11111110 00000000
/24 255.255.255.0 0xffffff00 11111111 11111111 11111111 00000000
/25 255.255.255.128 0xffffff80 11111111 11111111 11111111 10000000
/26 255.255.255.192 0xffffffc0 11111111 11111111 11111111 11000000
/27 255.255.255.224 0xffffffe0 11111111 11111111 11111111 11100000
/28 255.255.255.240 0xfffffff0 11111111 11111111 11111111 11110000
/29 255.255.255.248 0xfffffff8 11111111 11111111 11111111 11111000
/30 255.255.255.252 0xfffffffc 11111111 11111111 11111111 11111100
/31 255.255.255.254 0xfffffffe 11111111 11111111 11111111 11111110
/32 255.255.255.255 0xffffffff 11111111 11111111 11111111 11111111

Create a ipmp group over tagged VLANS

this is over nxge4 and nxge10, vlan503 and vlan800, IMPORTANT: reboot after placing files

 /etc/hostname.nxge503004
 crmdev41/26 netmask + broadcast + group crmdevnew1 deprecated -failover up
 addif crmdev/26 netmask + broadcast + failover up
/etc/hostname.nxge503010
 crmdev42/26 netmask + broadcast + group crmdevnew1 deprecated -failover standby
/etc/hostname.nxge800004
 crmdev11/26 netmask + broadcast + group crmdev10new deprecated -failover up
 addif crmdev10/26 netmask + broadcast + failover up
/etc/hostname.nxge800010
 crmdev12/26 netmask + broadcast + group crmdev10new deprecated -failover standby

Script to create FLARs

This one will login to a list of servers and create a flar in a NFS share

#!/bin/ksh

for h in `cat hosts.txt`;do
        echo "----------------------- $h"
cat <<EOF  > /tmp/$h
mkdir -p /b; mount -F nfs 10.80.120.219:/space /b; ls /b
time flarcreate -n "$h" -c -S -R / /b/flars/$h.flar
umount /b
EOF
scp /tmp/$h $h:/tmp
ssh $h /tmp/$h
done

Rsync many solaris server’s non-OS filesystems in parallel

This one will run rsyncs in the background for each host it finds in hosts.txt, and save each host’s progress in a log.

#!/bin/ksh
for h in `cat hosts.txt`;do
 echo "----------------------- $h"
 (
 ssh $h df -k | egrep -v 'cdrom|^Filesystem|/$|/devices$|/system/contract$|/proc$|/etc/mnttab$|/etc/svc/volatile$|/system/object$|/etc/dfs/sharetab$|/dev/fd$|/tmp$|/var$|/var/run$|/dev/vx/dmp$|/dev/vx/rdmp$|/cores$|/var/crash$' | awk '{ print $NF }' | while read l;do
 mkdir -p /space/$h$l
 echo "rsync --progress -zrtva $h:$l/ /space/$h$l/"
 rsync --progress -zrtva $h:$l/ /space/$h$l/
 done
 ) 2>&1 > ${h}.log &
 done