Cisco IOS Subnet Calculator

Oct 24 2011

Cisco IOS Subnet Calculator

Quick one this morning. IOS has loads of pretty much undocumented features (e.g. using the “do” command in config mode) that make life so much easier. We’ve come across another one – the “terminal ip netmask-format” command. This allows you to display the netmask on an interface is one of three formats – bit-count (slash notation), decimal and hex. Avoids the constant use of all of those subnet calculators!

Router#terminal ip netmask-format bit
Router#show int f0/0.1
FastEthernet0/0.1 is up, line protocol is up
Hardware is Gt96k FE, address is 001b.d58f.76de (bia 001b.d58f.76de)
Internet address is 10.1.200.254/24
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation 802.1Q Virtual LAN, Vlan ID 1.
Keepalive set (10 sec)
ARP type: ARPA, ARP Timeout 04:00:00
Last clearing of “show interface” counters never
Router#terminal ip netmask-format decimal
Router#show int f0/0.1
FastEthernet0/0.1 is up, line protocol is up
Hardware is Gt96k FE, address is 001b.d58f.76de (bia 001b.d58f.76de)
Internet address is 10.1.200.254 255.255.255.0
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation 802.1Q Virtual LAN, Vlan ID 1.
Keepalive set (10 sec)
ARP type: ARPA, ARP Timeout 04:00:00
Last clearing of “show interface” counters never
Router#terminal ip netmask-format hex
Router#show int f0/1.1
FastEthernet0/0.1 is up, line protocol is up
Hardware is Gt96k FE, address is 001b.d58f.76de (bia 001b.d58f.76de)
Internet address is 10.1.200.254 0xFFFFFF00
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation 802.1Q Virtual LAN, Vlan ID 1.
Keepalive set (10 sec)
ARP type: ARPA, ARP Timeout 04:00:00
Last clearing of “show interface” counters never

Barry Hesk

Leave a Reply