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
    }
}
  • 3
    Because it's a different prefix-lists – Andrey Prokhorov Sep 23 '19 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 '19 at 19:14
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.

| improve this answer | |

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.