I'm configuring a Cisco IOS (version 15) router, and I need to use the same values in multiple places; in this case, I need to configure the router's name servers (ip name-server <address>) and also reference them in an ACL, as per this question (permit udp <address> [...]). However, now I have the same IP address in two different places, and this could lead to confusion later, should f.e. the DNS servers change.

Is there any way to use some sort of variable for this? Does IOS even allow the use of variables?


Unfortunately, no, IOS does not support anything like this. The closest feature would be object-groups for ACLs, which were added in 12.4(20)T. They allow you to define an object-group containing the IP address(es) (or TCP/UDP ports or other things) you want to filter on. You would then reference the object-group instead of a static address in your configuration. However, at present they're only useful in ACLs, and there are restrictions where they can be used (e.g. they won't work in IPsec crypto map ACLs).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.