device# configure terminal
device(config)# interface ethernet 1/1
device(conf-if-eth-1/1)# ip ospf md5-authentication key-activation-wait-time 240
device(conf-if-eth-1/1)# ip ospf md5-authentication key-id 22 key myospfpassword
Note
MD5 passwords cannot have ASCII character 32 ('SPACE') as a part of the password string.The following example sets the time that OSPFv2 waits before activating a new MD5 key to 240 seconds on an Ethernet interface, and sets the MD5 key ID to 22 and a password “myospfpassword” on an Ethernet interface.
device# configure terminal device(config)# interface ethernet 1/1 device(conf-if-eth-1/1)# ip ospf md5-authentication key-activation-wait-time 240 device(conf-if-eth-1/1)# ip ospf md5-authentication key-id 22 key myospfpassword