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
    }
}
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, privacy policy and cookie policy

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