The article is aimed to learn the existence of a command by which to verify the MD5 hash IOS added to our system.
MD5 hash
MD5 is an algorithm used to create a 128-bit hash function, the usefulness of this test is to perform an integrity check on the file, so that we can be sure that the file has been corrupted by errors during the transfer, or that has been specially modified with malicious code.
Hands-on
When we download IOS, we go for the MD5 hash calculation on the local, let’s say that the IOS is “soho97-k9oy1-mz.123-7.T3.bin” The resulting hash is “e1588a2bda3583feb9188933d265ba11.
After copying the IOS on the router give the command
verify / md5 (type-mem): (name)-IOS
The output of the router will be the following:
Router # verify / md5 flash: soho97-k9oy1-mz.123-7.T3.bin
.................................................. ........................................ Done!
verify / md5 (flash: soho97-k9oy1-mz.123-7.T3.bin) = e1588a2bda3583feb9188933d265ba11
We can also add the hash that we think should return the file, so the router will tell if it is verified or if there are errors:
Router # verify / md5 flash: soho97-k9oy1-mz.123-7.T3.bin e1588a2bda3583feb9188933d265ba11
.................................................. ........................................ Done!
verified / md5 (flash: soho97-k9oy1-mz.123-7.T3.bin) = e1588a2bda3583feb9188933d265ba11
Router # verify / md5 flash: soho97-k9oy1-mz.123-7.T3.bin e1ddkjdskj
.................................................. ........................................ Done!
% Error Verifying flash: soho97-k9oy1-mz.123-7.T3.bin
Computed signature = e1588a2bda3583feb9188933d265ba11
Submitted signature = e1ddkjdskj