To test the example in this section, perform the following steps:
system {
scripts {
commit {
allow-transients;
file ex-bgp-global-import.xsl;
}
}
}
interfaces {
fe-0/0/0 {
unit 0 {
family inet {
address 192.168.16.2/24;
}
family inet6 {
address 2002:18a5:e996:beef::2/64;
}
}
}
}
routing-options {
autonomous-system 65400;
}
protocols {
bgp {
group fish {
neighbor 192.168.16.4 {
import [ blue green ];
peer-as 65401;
}
neighbor 192.168.16.6 {
peer-as 65402;
}
}
}
}
policy-options {
policy-statement blue {
from protocol bgp;
then accept;
}
policy-statement green {
then accept;
}
policy-statement bgp_global_import {
then accept;
}
}
- [edit]
- user@host# load merge terminal
- [Type ^D at a new line to end input]
- > Paste the contents of the clipboard here<
- [edit]
- user@host# commit
show protocols
When you issue the show protocols configuration mode command, the bgp_global_import import policy is not displayed because it is added as a transient change:
user@host# show protocols
bgp {
group fish {
neighbor 192.168.16.4 {
import [ blue green ];
peer-as 65401;
}
neighbor 192.168.16.6 {
peer-as 65402;
}
}
}
show protocols | display commit-scripts
The commit script adds the import bgp_global_import statement at the [edit protocols bgp] hierarchy level and prepends the bgp_global_import policy to the 192.168.16.4 neighbor policy chain:
user@host# show protocols | display commit-scripts
bgp {
import bgp_global_import;
group fish {
neighbor 192.168.16.4 {
import [ bgp_global_import blue green ];
peer-as 65401;
}
neighbor 192.168.16.6 {
peer-as 65402;
}
}
}
show protocols | display commit-scripts
After you add a policy to the 192.168.16.6 neighbor, which previously had no policies applied, the bgp_global_import policy is prepended:
user@host# set protocols bgp group fish neighbor 192.168.16.6 import green
user@host# show protocols | display commit-scripts
bgp {
import bgp_global_import;
group fish {
neighbor 192.168.16.4 {
import [ bgp_global_import blue green ];
peer-as 65401;
}
neighbor 192.168.16.6 {
import [ bgp_global_import green ];
peer-as 65402;
}
}
}