Setting for route re-distribution to BGP¶
Operation Confirmed version: vSRX Version15.1X49-D105.1, vSRX Version19.2R1.8, vSRX Version20.4R2
Setting for re-distributing a static route with BGP¶
Presumed case for sample setting
To re-distribute a set static route with BGP
Setting flow in a presumed case
Command to be entered with CLI
[vSRX-03]
user01@vSRX-03# set routing-options autonomous-system 65100
user01@vSRX-03# set protocols bgp group EBGP peer-as 65200
user01@vSRX-03# set protocols bgp group EBGP neighbor 10.0.40.2
[vSRX-04]
user01@vSRX-04# set routing-options static route 192.168.10.0/24 discard
user01@vSRX-04# set routing-options static route 192.168.20.0/24 discard
user01@vSRX-04# set routing-options static route 192.168.30.0/24 discard
user01@vSRX-04# set routing-options static route 192.168.40.0/24 discard
user01@vSRX-04# set policy-options policy-statement EXPORTSTATIC term 1 from protocol static
user01@vSRX-04# set policy-options policy-statement EXPORTSTATIC term 1 from route-filter 192.168.0.0/18 orlonger
user01@vSRX-04# set policy-options policy-statement EXPORTSTATIC term 1 then accept
user01@vSRX-04# set routing-options autonomous-system 65200
user01@vSRX-04# set protocols bgp group EBGP neighbor 10.0.40.1
user01@vSRX-04# set protocols bgp group EBGP peer-as 65100
user01@vSRX-04# set protocols bgp group EBGP export EXPORTSTATIC
The configuration after completion of appropriate settings is as follows.
[vSRX-03]
routing-options {
autonomous-system 65100;
}
protocols {
bgp {
group EBGP {
peer-as 65200;
neighbor 10.0.40.2;
}
}
}
[vSRX-04]
routing-options {
static {
route 192.168.10.0/24 discard;
route 192.168.20.0/24 discard;
route 192.168.30.0/24 discard;
route 192.168.40.0/24 discard;
}
autonomous-system 65200;
}
protocols {
bgp {
group EBGP {
export EXPORTSTATIC;
peer-as 65100;
neighbor 10.0.40.1;
}
}
}
policy-options {
policy-statement EXPORTSTATIC {
term 1 {
from {
protocol static;
route-filter 192.168.0.0/18 orlonger;
}
then accept;
}
}
}
Note
**Points to note for re-distribution of a static route
For re-distribution of a static route, a protocol can be specified as a condition at the time of policy-options policy-statement settings. However, if re-distribution settings to BGP are made with a condition specified only for a static route, also static routes managed by the ECL2.0 are subject to re-distribution. Regarding re-distribution of a static route, specify a network for actual distribution besides a protocol.
**Command for specifying routes including distribution target routes (192.168.10.0/24,192.168.20.0/24,192.168.30.0/24,192.168.40.0/24)
For BGP, there are many cases where settings are made for a great deal of route replacement (several tens thousands routes) and control of reception/distribution routes, due to the characteristics of the protocol. If having made detail route settings for route filtering, the number of rules for filtering can be excess. In the case presented this time, four route information items are controlled with BGP. However, purposely a test was made with a method by which the target range of networks is set with a single line rule.
user01@vSRX-04# set policy-options policy-statement EXPORTSTATIC term 1 from route-filter 192.168.0.0/18 orlonger
*192.168.0.0/18 orlonger designates IP networks in the range from 192.168.0.0 to 192.168.63.255.
Operation check result
The static route re-distributed to BGP with vSRX-04 was confirmed on the routing table of vSRX-03, and thus appropriate settings for re-distribution were confirmed.
Display result of a route received by BGP, with vSRX-03
user01@vSRX-03> show route protocol bgp
inet.0: 20 destinations, 20 routes (20 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
192.168.10.0/24 *[BGP/170] 00:15:12, localpref 100
AS path: 65200 I, validation-state: unverified
> to 10.0.40.2 via ge-0/0/2.0
192.168.20.0/24 *[BGP/170] 00:13:41, localpref 100
AS path: 65200 I, validation-state: unverified
> to 10.0.40.2 via ge-0/0/2.0
192.168.30.0/24 *[BGP/170] 00:10:37, localpref 100
AS path: 65200 I, validation-state: unverified
> to 10.0.40.2 via ge-0/0/2.0
192.168.40.0/24 *[BGP/170] 00:10:37, localpref 100
AS path: 65200 I, validation-state: unverified
> to 10.0.40.2 via ge-0/0/2.0
Setting for re-distributing an OSPF route with BGP¶
Presumed case for sample setting
To re-distribute a received OSPF route with BGP
Setting flow in a presumed case
Command to be entered with CLI
user01@vSRX-03# set policy-options policy-statement EXOSPF term 1 from protocol ospf
user01@vSRX-03# set policy-options policy-statement EXOSPF term 1 then accept
user01@vSRX-03# set protocols bgp group EBGP export EXOSPF
Note
Assume that on peripheral devices, needed settings have been made for route replacement between OSPF and BGP.
The configuration after completion of appropriate settings is as follows.
protocols {
bgp {
group EBGP {
type external;
export EXOSPF;
neighbor 10.0.40.2 {
peer-as 65200;
}
}
}
}
policy-options {
policy-statement EXOSPF {
term 1 {
from protocol ospf;
then accept;
}
}
}
Operation check result
Reception of the OSPF route of vSRX03 by BGP was confirmed on the routing table of vSRX04, and thus appropriate settings for re-distribution were confirmed.
user01@vSRX-04> show route
inet.0: 12 destinations, 11 routes (11 active, 0 holddown, 0 hidden)
+ = Active Route, - = Last Active, * = Both
10.1.1.1/32 *[BGP/170] 00:01:29, MED 1, localpref 100
AS path: 65100 I, validation-state: unverified
> to 10.0.40.1 via ge-0/0/0.0
10.2.2.2/32 *[BGP/170] 00:01:29, MED 1, localpref 100
AS path: 65100 I, validation-state: unverified
> to 10.0.40.1 via ge-0/0/0.0
10.0.0.0/24 *[Direct/0] 4d 12:07:34
> via fxp0.0
10.0.0.104/32 *[Local/0] 4d 12:07:34
Local via fxp0.0
10.0.10.0/24 *[BGP/170] 00:01:29, MED 2, localpref 100
AS path: 65100 I, validation-state: unverified
> to 10.0.40.1 via ge-0/0/0.0
10.0.40.0/30 *[Direct/0] 14:23:15
> via ge-0/0/0.0
10.0.40.2/32 *[Local/0] 4d 11:58:35
Local via ge-0/0/0.0
192.168.10.0/24 *[Static/5] 16:56:06
Discard
192.168.20.0/24 *[Static/5] 14:32:57
Discard
192.168.30.0/24 *[Static/5] 14:32:57
Discard
192.168.40.0/24 *[Static/5] 14:32:57
Discard