Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 5 down vote accepted

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).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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