IP Netmask-Format

OK, so maybe I’m the only one with my head still stuck in the Summer of Love… but that’s OK. Juan’s “Ping from the Trenches” was a popular post, and we’re trying to hit the Top Ten list with this one as well.

Most of you were around this summer when we tried to make the ip netmask-format command work and failed utterly. The funny part is that we did get it working, we just didn’t know where to look for the expected output.

The result of this command doesn’t show in the show running-config output. That’s more like a direct dump from a file to the screen. There’s no querying the router for information and sending results to the screen. This is more like a filter on formatted output rather than raw text. The ip netmask-format modifies the output conditions for show commands such as show ip interface, show ip eigrp topology, show ip route, etc.

In the default netmask-format, you’re going to see the following output for the show ip interface command:

R1# show ip interface
Serial0/0/0 is up, line protocol is up
Internet address is 172.16.12.1/24
Broadcast address is 255.255.255.255
Address determined by non-volatile memory
MTU is 1500 bytes
...

Now, let’s mess with the netmask format:

R1# terminal ip netmask-format decimal
R1#
show ip interface
Serial0/0/0 is up, line protocol is up
Internet address is 172.16.12.1 255.255.255.0
Broadcast address is 255.255.255.255
Address determined by non-volatile memory
MTU is 1500 bytes
...
R1# terminal ip netmask-format hexadecimal
R1#
show ip interface
Serial0/0/0 is up, line protocol is up
Internet address is 172.16.12.1 0xFFFFFF00
Broadcast address is 255.255.255.255
Address determined by non-volatile memory
MTU is 1500 bytes
...

What about the output of other show commands?

R1# show ip eigrp topology
IP-EIGRP Topology Table for AS(1)/ID(192.168.70.1)
Codes: P - Passive, A - Active, U - Update, Q - Query, R - Reply,
r - reply Status, s - sia Status

P 192.168.70.0 0xFFFFFF00, 1 successors, FD is 128256
via Connected, Loopback70
P 192.168.40.0 0xFFFFFF00, 1 successors, FD is 40537600
via 172.16.12.2 (40537600/40025600), Serial0/0/0
P 192.168.35.0 0xFFFFFF00, 1 successors, FD is 40537600
via 172.16.12.2 (40537600/40025600), Serial0/0/0
P 192.168.48.0 0xFFFFFE00, 1 successors, FD is 128256
via Summary (128256/0), Null0
...

Or, back to dotted decimal notation:

R1# terminal ip netmask-format decimal
R1#
show ip route 192.168.35.0
Routing entry for 192.168.35.0 255.255.255.0
Known via "eigrp 1", distance 170, metric 40537600, type external
Redistributing via eigrp 1
Last update from 172.16.12.2 on Serial0/0/0, 01:13:19 ago
Routing Descriptor Blocks:
* 172.16.12.2, from 172.16.12.2, 01:13:19 ago, via Serial0/0/0
Route metric is 40537600, traffic share count is 1
Total delay is 21000 microseconds, minimum bandwidth is 64 Kbit
Reliability 255/255, minimum MTU 1500 bytes
Loading 1/255, Hops 1

The parameters you specify in privileged-exec mode with the terminal command affect only your current EXEC session. You probably want to configure such a command permanently (at least until you change your mind later!).

You may configure this as the default for all EXEC sessions on an incoming line (con, aux, vty, async) as follows:

R1# configure terminal
R1(config)# line con 0
R1(config-line)# ip netmask-format { bit-count | decimal | hexadecimal }

Advertisements
Explore posts in the same categories: Documentation, Technologies

4 Comments on “IP Netmask-Format”

  1. Juan David Says:

    This is great, I always thought that this command had to do whit the way you write netmasks when configuring ip addresses; anyway helps a lot when you eant the output to be certain way, I see myself using this to get every ip addresses on a router with a show command and a netmask easier to remove for the ping of the trenches. Nice


  2. […] Cisco IOS IP Command Reference, Volume 1 of 4: Addressing and Services, Release 12.3 IP Netmask-Format […]


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s


%d bloggers like this: