Cisco IOS crypto isakmp key command subnet mask behavior
Short answer
C Authenticates the IKEv1 peers in the 172.16.0.0/16 range by using the key ciscXXXXXXXX
Question
Key Takeaways
This question tests the default behavior of the 'crypto isakmp key address' command regarding subnet masking and protocol version (IKEv1 vs IKEv2). The common trap is confusing the default /16 mask with a /32 host or assuming it applies to IKEv2.
The 'crypto isakmp key' command configures a pre-shared secret for IKEv1 authentication. When no subnet mask is explicitly specified, Cisco IOS defaults to a /16 network range.
Common mistake: Option A (IKEv2) is incorrect because this specific CLI syntax is deprecated/legacy for IKEv1; Option B (/32) is incorrect because the lack of a mask implies a network range, not a single host.
Expert Analysis
Why the Answer Is Correct
The command 'crypto isakmp key... address <ip>' is used to configure a pre-shared key for IKEv1 (ISAKMP) peer authentication. In Cisco IOS, if you do not specify a subnet mask after the IP address, the router assumes a default Class B mask of 255.255.0.0, which corresponds to a /16 prefix length. This allows the key to authenticate any peer within that 172.16.0.0/16 range.
Why the Other Options Are Wrong
Option A is incorrect because this legacy command syntax is associated with IKEv1, not IKEv2 (which uses different configuration structures like 'key ring'). Option B is incorrect because a /32 mask would require explicit specification (e.g., 'address 172.16.0.0 255.255.255.255'); without it, the system defaults to /16. Option D is incorrect because this command configures a pre-shared key, not certificate-based authentication.
Community Comment Notes
Community members verified this behavior through lab testing. As noted by user 'thefiresays', "It's weird that they used a network address, but this command authenticates a single VPN peer" (referring to the fact that while the command defines a range, it's often used for specific peers in smaller labs, but technically covers the range). User 'kwong328' confirmed: "because the command... did not specified the mask, the router will take is as /16". Multiple users (Ampersand, nospamls) validated that C is the correct answer based on the default /16 behavior.
Exam Strategy
Memorize that the 'crypto isakmp key' command is for IKEv1. Always check if a subnet mask is provided; if absent, assume the classful default mask (A: /8, B: /16, C: /24). Remember that modern exams may focus on IKEv2, so distinguish between legacy ISAKMP keys and modern Key Rings.
Frequently Asked Questions
Why is this command for IKEv1 and not IKEv2?
How do I specify a single host IP for the key?
Discussion 54 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 30 of 54
-
Ampersand 👍 18B is correct. When you use “address” it is referring to the remote peer you share the key with. If you want to add more than 1 ip add, you will have to use group key.
-
nospampls 👍 16C is correct did this ins GNS3 R1(config)#crypto isakmp key 123123 address 172.16.0.0 R1(config)#end R1#show crypto isakmp key Keyring Hostname/Address Preshared Key default 172.16.0.0 [255.255.0.0] 123123 same as Seawanderer did
-
thefiresays 👍 10It's weird that they used a network address, but this command authenticates a single VPN peer. Leaving B correct.
-
Seawanderer 👍 6ISP(config)#crypto isakmp key asdasd address 172.16.0.0 ISP#sh crypto isakmp key Keyring Hostname/Address Preshared Key default 172.16.0.0 [255.255.0.0] asdasd
-
angry 👍 6C is the correct answer!
Show 25 more comments
-
Dead_Adriano 👍 5Moreover, I reproduced this in the lab with routers having 172.16.1.1 and .2 addresses. Auth goes correctly, the tunnel is up and working.
-
JGW 👍 4 Answered CCommand reference is not decisive. Testing without a netmask shows that command interpretation has a preference for /16 and /24. CSR-1(config)#crypto isakmp key cisco123 address 172.16.0.0 CSR-1(config)#do show crypto isakmp key | i cisco default 172.16.0.0 [255.255.0.0] cisco123 CSR-1(config)#no crypto isakmp key cisco123 address 172.16.0.0 CSR-1(config)#crypto isakmp key cisco123 address 172.16.1.0 CSR-1(config)#do show crypto isakmp key | i cisco default 172.16.1.0 [255.255.255.0] cisco123 CSR-1(config)#no crypto isakmp key cisco123 address 172.16.1.0 CSR-1(config)#crypto isakmp key cisco123 address 172.16.1.128 CSR-1(config)#do show crypto isakmp key | i cisco default 172.16.1.128 cisco123 CSR-1(config)#
-
ARound 👍 4Selected Answer: C 7200 Software (C7200-ADVENTERPRISEK9-M), Version 15.3(3)XB12 command keyed in is, crypto isakmp key cisco address 172.16.0.0 Router#show crypto isakmp key Keyring Hostname/Address Preshared Key default 172.16.0.0 [255.255.0.0] cisco Router(config)#crypto isakmp key cisco ? address define shared key with IP address hostname define shared key with hostname if using ikev2, the command set should be, crypto ikev2 keyring keys peer hostname address 172.16.10.2 pre-shared-key local cisco pre-shared-key remote cisco
-
JGW 👍 4C is correct. It is not unusual in older Cisco commands to interpret IP addresses without mask as classfull CSR-1(config)#crypto isakmp key cisco123 address 172.16.0.0 CSR-1(config)#crypto isakmp key cisco123 address 172.16.0.0 255.255.0.0 A pre-shared key for address mask 172.16.0.0 255.255.0.0 already exists!
-
kwong328 👍 4You are correct, I have verified in IOU. because the command "crypto isakmp key ciscXXXXXXXX address 172.16.0.0" did not specified the mask, the router will take is as /16, unless you specify the mask as "crypto isakmp key ciscXXXXXXXX address 172.16.0.0 255.255.255.0", the router will take it as /24.
-
loiphin 👍 4This is not always a network address.... for example on this subnet 172.16.4.0/23, 172.16.5.0 is a valid IP address, and nothing to do with network address. It just looks weird because people tend to subnet on /24's mostly.
-
Jeeves69 👍 4For it to have been a /16 a mask of 255.255.0.0 would've had to have been provided after the address statement, so B is correct.
-
jaciro11 👍 4Man this is not true....
-
RafaelSTI 👍 3C is correct, o IOS assumes a /16 mask if you omit the mask, like when you put at the and 0.0.0.0 and the IOS assumes a /0 mask (any). I test in the lab: ... Router(config)# crypto isakmp key Mudar@123 address 172.16.0.0 Router(config)#do show crypto isakmp key Keyring Hostname/Address Preshared Key default 172.16.0.0 [255.255.0.0] Mudar@123 Router(config)#
-
Gabs20L 👍 3Correct answer ir B, not C. Here is the reference: https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/security/a1/sec-a1-cr-book/sec-cr-c4.html#wp6039879000
-
Seawanderer 👍 3So it’s C
-
jaciro11 👍 2When using IKE main mode, preshared keys are indexed by IP address only because the identity payload has not yet been received. This means that the hostname keyword in the identity statement is not used to look up a preshared key and will be used only when sending and processing the identity payloads later in the main mode exchange. The identity keyword can be used when preshared keys are used with IKE aggressive mode, and keys may be indexed by identity types other than IP address as the identity payload is received in the first IKE aggressive mode packet. B and C are correct but you need to check something crypto isakmp key ciscXXXXXXXX address 172.16.0.0 It talks about one host not /16 Note: If you specify mask, you must use a subnet address. (The subnet address 0.0.0.0 is not recommended because it encourages group preshared keys, which allow all peers to have the same group key, thereby reducing the security of your user authentication.) The answer is B
-
squirrel49 👍 2 Answered CThe command crypto isakmp key you provided is related to IKEv1, not IKEv2. IKEv1 (Internet Key Exchange version 1) is configured using crypto isakmp commands, whereas IKEv2 (Internet Key Exchange version 2) is configured using crypto ikev2 commands. If you want to configure a pre-shared key for IKEv1, the crypto isakmp key command is used as shown in your original question. If you want to configure a pre-shared key for IKEv2, you would use crypto ikev2 keyring and crypto ikev2 profile commands. The distinction is important because the two versions of IKE have different configurations and characteristics. So IMHO - C is the right answer!
-
Zoli6 👍 2Unlike IKEv1, the authentication method and SA lifetime are not negotiable in IKEv2, and they cannot be configured in the IKEv2 proposal. Though the crypto ikev2 proposal command looks similar to the IKEv1 crypto isakmp policycommand, the IKEv2 proposal configuration supports specifying multiple options for each transform type.
not just part of IKEv1 -
G33 👍 2C is correct Apart from reasons already given by other C campaigners ikev2 uses a different format for keys crypto ikev2 keyring IKEv2-KEYRING peer 1.2.3.4 address 1.2.3.4 pre-shared-key cisco123 apart from that whe you actually run the command in a lab it results in 172.16.0.0 [255.255.0.0] It assumes a subnet for anything that ends in .0
-
Anonymous983475 👍 2 Answered CThere should be a subnet mask at the end for it to take the /32 address This is the output from the IOS-XE router. IOU1(config)#crypto isakmp key cisco address 172.16.0.0 ? A.B.C.D Peer IP subnet mask no-xauth Bypasses XAuth for this peer
-
haiderzaid 👍 2i tested it on a real router and the output was Keyring Hostname/Address Preshared Key default 172.16.0.0 [255.255.0.0] cisco but if i use 172.0.0.1 Keyring Hostname/Address Preshared Key default 172.16.0.1 cisco weird thing , not B
-
deathfrom 👍 2I agree with C as isakmp is a part of IKEv1
-
Seawanderer 👍 2No, check my CLI input and output
-
saad_SEIU 👍 2 Answered BB with no doubt.
-
angry 👍 2B is correct!
-
Kris92 👍 2should be C
-
xziomal9 👍 2 Answered CAnswer C
-
Emlia1 👍 2B or C
-
ddev3737_111 👍 1B is incorrect, the command is used to authenticate the IKEv2 peers in the 172.16.0.0/16 range, not a single IP address. C is also incorrect, the command is used for IKEv2, not IKEv1. A The command "crypto isakmp key ciscXXXXXXXX address 172.16.0.0" is used to configure a preshared key for IKEv2 peers with IP addresses in the range of 172.16.0.0/16. The key "ciscXXXXXXXX" is used for authentication during the IKE Phase 1 negotiation. It's considered a secure method to authenticate the peers by using a shared secret key instead of using a public key infrastructure which could be vulnerable to Man-In-The-Middle attacks
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.