4

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?

Massimo
  • 70,200
  • 57
  • 200
  • 323

1 Answers1

5

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

James Sneeringer
  • 6,835
  • 24
  • 27