1

Why the policy-options prefix-list do not shows hierarchy?

In a Juniper Router,

I show policy-options, there shows:

prefix-list snmp-permit {
    1.1.1.0/24;
}

prefix-list icmp-permit {
    2.2.2.0/24
}

But why it do not show like this:

prefix-list {
    snmp-permit {
        1.1.1.0/24;
    }
    icmp-permit {
        2.2.2.0/24
    }
}
2
  • 3
    Because it's a different prefix-lists Sep 23, 2019 at 12:05
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Dec 15, 2019 at 19:14

1 Answer 1

1

It's just the way the Juniper config is built. Underneath it's all XML and there you have multiple prefix-lists on one level which each have their name as <name> tag on the level below (a child element in XML). Your lists would be:

<prefix-list>
  <name>snmp-permit</name>
  <prefix-list-item>
    <name>1.1.1.0/24</name>
  <prefix-list-item>
</prefix-list>
<prefix-list>
  <name>icmp-permit</name>
  <prefix-list-item>
    <name>2.2.2.0/24</name>
  <prefix-list-item>
</prefix-list>

The CLI then displays this as text so you have multiple prefix-list <name> entries. It's just the way the XML to text parser is written.

You can see this on the CLI by adding | display xml to a command, like show configuration policy-options | display xml.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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