Prefix, mask, hosts
Usable hosts = 2host bits − 2: the network and broadcast addresses can't be assigned.
Private ranges
- 10.0.0.0/8
- 10.0.0.0 to 10.255.255.255
- 172.16.0.0/12
- 172.16.0.0 to 172.31.255.255
- 192.168.0.0/16
- 192.168.0.0 to 192.168.255.255
Not routed on the internet; reaching it needs NAT. Also special: 127.0.0.0/8 loopback, 169.254.0.0/16 link-local (APIPA).
Working one out
- Find the interesting octet: where the mask isn't 255 or 0.
- Block size = 256 − that mask octet.
- Network = the multiple of the block at or below the address.
- Broadcast = next network − 1. Usable = everything between.
172.16.1.140/26: block 64, so network .128, broadcast .191, usable .129 to .190.
VLSM, in order
- Sort the subnets largest first.
- Give each the smallest prefix that fits its hosts.
- Start each where the last one ended, on its own block boundary.
- Point-to-point links last: /30, or /31.
What IOS refuses
- The network or broadcast address: Bad mask /30 for address …
- An address that overlaps another interface: % … overlaps with …
- A /31 on Ethernet is allowed with a warning.
Commands
Address
interface gi0/1
ip address 172.16.1.1 255.255.255.128
no shutdown
Verify
show ip interface brief
show ip route connected
show interfaces gi0/1
show running-config interface gi0/1
ping 172.16.1.10
All of these work in the network's consoles. PCs are set in Inspect, like a network settings window.