Subnet Cheat Sheet

NetworkNet maskBinaryHosts
/32255.255.255.25511111111 11111111 11111111 111111111
/31255.255.255.25411111111 11111111 11111111 111111102
/30255.255.255.25211111111 11111111 11111111 111111004
/29255.255.255.24811111111 11111111 11111111 111110008
/28255.255.255.24011111111 11111111 11111111 1111000016
/27255.255.255.22411111111 11111111 11111111 1110000032
/26255.255.255.19211111111 11111111 11111111 1100000064
/25255.255.255.12811111111 11111111 11111111 10000000128
/24255.255.255.011111111 11111111 11111111 00000000256
/23255.255.254.011111111 11111111 11111110 00000000512
/22255.255.252.011111111 11111111 11111100 000000001’024
/21255.255.248.011111111 11111111 11111000 000000002’048
/20255.255.240.011111111 11111111 11110000 000000004’096
/19255.255.224.011111111 11111111 11100000 000000008’192
/18255.255.192.011111111 11111111 11000000 0000000016’384
/17255.255.128.011111111 11111111 10000000 0000000032’768
/16255.255.0.011111111 11111111 00000000 0000000065’536
/15255.254.0.011111111 11111110 00000000 00000000131’072
/14255.252.0.011111111 11111100 00000000 00000000262’144
/13255.248.0.011111111 11111000 00000000 00000000524’288
/12255.240.0.011111111 11110000 00000000 000000001’048’576
/11255.224.0.011111111 11100000 00000000 000000002’097’152
/10255.192.0.011111111 11000000 00000000 000000004’194’304
/9255.128.0.011111111 10000000 00000000 000000008’388’608
/8255.0.0.011111111 00000000 00000000 0000000016’777’216
/7254.0.0.011111110 00000000 00000000 0000000033’554’432
/6252.0.0.011111100 00000000 00000000 0000000067’108’864
/5248.0.0.011111000 00000000 00000000 00000000134’217’728
/4240.0.0.011110000 00000000 00000000 00000000268’435’456
/3224.0.0.011100000 00000000 00000000 00000000536’870’912
/2192.0.0.011000000 00000000 00000000 000000001’073’741’824
/1128.0.0.010000000 00000000 00000000 000000002’147’483’648
/00.0.0.000000000 00000000 00000000 000000004’294’967’296

Ubuntu do-release-upgrade reconnect

Usually I do a release upgrade over the network, using ssh with the command

do-release-upgrade

For some reasons the connection to host I’m upgrading dies.

No panic. Reconnect to the host with ssh. If it does not work, try port 1022.

Then execute the following command:

screen list
here is a screen on:
    root/1234.ubuntu-release-upgrade-screen-window   (09/15/2014 07:48:02 AM)    (Detached)
1 Socket in /var/run/screen/S-root.

Now try to reconnect with

screen -d -r root/1234.ubuntu-release-upgrade-screen-window

The connection is established again and you can continue where you were.

How Do I Update The Root Hints Data File for BIND Named Server?

My local nameserver root zone file is outdated. It has no information about IPv6 and recently changed root server IP address.

How do I update my root hints data file on a Linux server?

You can download it:

wget --user=ftp --password=ftp ftp://ftp.rs.internic.net/domain/db.cache -O /etc/bind/db.root

Or you can generate it yourself:

dig +bufsize=1200 +norec NS . @a.root-servers.net | egrep -v ';|^$' | sort > /etc/bind/db.root

After all, refresh the name server:

rndc reload

After all the content of the file looks like this:

.			518400	IN	NS	a.root-servers.net.
.			518400	IN	NS	b.root-servers.net.
.			518400	IN	NS	c.root-servers.net.
.			518400	IN	NS	d.root-servers.net.
.			518400	IN	NS	e.root-servers.net.
.			518400	IN	NS	f.root-servers.net.
.			518400	IN	NS	g.root-servers.net.
.			518400	IN	NS	h.root-servers.net.
.			518400	IN	NS	i.root-servers.net.
.			518400	IN	NS	j.root-servers.net.
.			518400	IN	NS	k.root-servers.net.
.			518400	IN	NS	l.root-servers.net.
.			518400	IN	NS	m.root-servers.net.
a.root-servers.net.	518400	IN	A	198.41.0.4
a.root-servers.net.	518400	IN	AAAA	2001:503:ba3e::2:30
b.root-servers.net.	518400	IN	A	192.228.79.201
b.root-servers.net.	518400	IN	AAAA	2001:500:84::b
c.root-servers.net.	518400	IN	A	192.33.4.12
c.root-servers.net.	518400	IN	AAAA	2001:500:2::c
d.root-servers.net.	518400	IN	A	199.7.91.13
d.root-servers.net.	518400	IN	AAAA	2001:500:2d::d
e.root-servers.net.	518400	IN	A	192.203.230.10
f.root-servers.net.	518400	IN	A	192.5.5.241
f.root-servers.net.	518400	IN	AAAA	2001:500:2f::f
g.root-servers.net.	518400	IN	A	192.112.36.4
h.root-servers.net.	518400	IN	A	198.97.190.53
h.root-servers.net.	518400	IN	AAAA	2001:500:1::53
i.root-servers.net.	518400	IN	A	192.36.148.17
i.root-servers.net.	518400	IN	AAAA	2001:7fe::53
j.root-servers.net.	518400	IN	A	192.58.128.30
j.root-servers.net.	518400	IN	AAAA	2001:503:c27::2:30
k.root-servers.net.	518400	IN	A	193.0.14.129
k.root-servers.net.	518400	IN	AAAA	2001:7fd::1
l.root-servers.net.	518400	IN	A	199.7.83.42
l.root-servers.net.	518400	IN	AAAA	2001:500:3::42
m.root-servers.net.	518400	IN	A	202.12.27.33
m.root-servers.net.	518400	IN	AAAA	2001:dc3::35

This is a current list of the root name servers.

Cisco err-disable recovery

Did it also happen to you, that a port of a remote switch went to err-disable and you had to drive to that location to reset it?

Or you have users in meeting rooms, who plug in the same network cable in two different switch ports? Nothing happened, spanning-tree portfast bpduguard enable was set.  But the ports went down, and nobody realised it?

You can avoid this problem with the setting

errdisable recovery cause all
errdisable recovery interval 180

With this setting, the switch brings up the port after 180 seconds. If the problem still exists, the port goes into err-disable again. If it is fixed, the port comes up again.

Fortigate CLI Shortcuts

Fortigate offers some helpful features on the command line to position the cursor.

up arrow, CTRL-PPrevious command
 down arrow, CTRL+N Next command
CTRL-A Beginning of line
 CTRL-E End of line
 CTRL-B Back one word
 CTRL-F Forward one word
 CTRL-D Delete current Character
 CTRL-C Abort Command and exit Branch(be careful: CTRL-C is context sensitive. It moves you up to the previous command branch level. If you are already at the top, it logs you out
CTRL-L Clear screen
TABCompletes the current word or iterates through the folioing words
?Possible commands