topic Static route through BGP in Routinghttps://forums.juniper.net/t5/Routing/Static-route-through-BGP/m-p/467815#M20182
<P>Hello all,</P>
<P>&nbsp;</P>
<P>Couple of questions. We currently have a /26 with our ISP that connects to them via BGP with the ISP's provided ASN. We received a /24 from the same ISP with our own ASN and we will eventually remove the /26. For now the /26 needs to remain in service.</P>
<P>&nbsp;</P>
<P>I know you cannot advertise both the /24 and /26 via BGP to the same ISP peer using different AS numbers. What the ISP told us is that we can advertise the /24 via BGP and statically route the /26 through them.&nbsp; Do I only need to define the static /26 through policy-options, export it through BGP and define it on an interface?</P>
<P>&nbsp;</P>
<P>Also, do I need the term 1 statement? Our current edge router was programmed before I arrived and has always had that line (when it was only the /26).</P>
<P>&nbsp;</P>
<PRE>policy-options {
policy-statement bgp-export {
term 1 {
from {
protocol direct;
route-filter 2.2.2.0/24 exact;
}
then accept;
}
term 2 {
from {
protocol static;
route-filter 3.3.3.64/26 exact;
}
then accept;
}
}
}
protocols {
bgp {
group isp {
type external;
local-address 4.4.4.246;
export bgp-export;
peer-as 8888;
local-as 99999;
neighbor 4.4.4.245;
}
}
}
interfaces {
reth0 {
per-unit-scheduler;
mtu 1514;
redundant-ether-options {
redundancy-group 1;
}
unit 0 {
family inet {
address 4.4.4.246/30;
}
}
}
reth1 {
redundant-ether-options {
redundancy-group 1;
}
unit 0 {
family inet {
address 2.2.2.1/24 {
primary;
}
address 3.3.3.65/26;
}
}
}
}</PRE>Mon, 09 Sep 2019 16:38:04 GMTknightmese2019-09-09T16:38:04ZStatic route through BGPhttps://forums.juniper.net/t5/Routing/Static-route-through-BGP/m-p/467815#M20182
<P>Hello all,</P>
<P>&nbsp;</P>
<P>Couple of questions. We currently have a /26 with our ISP that connects to them via BGP with the ISP's provided ASN. We received a /24 from the same ISP with our own ASN and we will eventually remove the /26. For now the /26 needs to remain in service.</P>
<P>&nbsp;</P>
<P>I know you cannot advertise both the /24 and /26 via BGP to the same ISP peer using different AS numbers. What the ISP told us is that we can advertise the /24 via BGP and statically route the /26 through them.&nbsp; Do I only need to define the static /26 through policy-options, export it through BGP and define it on an interface?</P>
<P>&nbsp;</P>
<P>Also, do I need the term 1 statement? Our current edge router was programmed before I arrived and has always had that line (when it was only the /26).</P>
<P>&nbsp;</P>
<PRE>policy-options {
policy-statement bgp-export {
term 1 {
from {
protocol direct;
route-filter 2.2.2.0/24 exact;
}
then accept;
}
term 2 {
from {
protocol static;
route-filter 3.3.3.64/26 exact;
}
then accept;
}
}
}
protocols {
bgp {
group isp {
type external;
local-address 4.4.4.246;
export bgp-export;
peer-as 8888;
local-as 99999;
neighbor 4.4.4.245;
}
}
}
interfaces {
reth0 {
per-unit-scheduler;
mtu 1514;
redundant-ether-options {
redundancy-group 1;
}
unit 0 {
family inet {
address 4.4.4.246/30;
}
}
}
reth1 {
redundant-ether-options {
redundancy-group 1;
}
unit 0 {
family inet {
address 2.2.2.1/24 {
primary;
}
address 3.3.3.65/26;
}
}
}
}</PRE>Mon, 09 Sep 2019 16:38:04 GMThttps://forums.juniper.net/t5/Routing/Static-route-through-BGP/m-p/467815#M20182knightmese2019-09-09T16:38:04ZRe: Static route through BGPhttps://forums.juniper.net/t5/Routing/Static-route-through-BGP/m-p/467851#M20183
<P>Hello</P>
<P>Do you have the 2.2.2.0/24 route as a direct route on the local router("show route 2.2.2.0" displays [Direct])? If so, it makes sense to configure term 1.&nbsp;</P>
<P><EM>"Do I only need to define the static /26 through policy-options, export it through BGP and define it on an interface"</EM></P>
<P><SPAN>I did not understand the static and define on interface requirement. Is this /26 route already present in show route output?&nbsp;</SPAN></P>
<P>The static route configuration is as follows</P>
<P><SPAN><A href="https://www.juniper.net/documentation/en_US/junos/topics/topic-map/policy-static-routing.html" target="_blank">https://www.juniper.net/documentation/en_US/junos/topics/topic-map/policy-static-routing.html</A></SPAN></P>
<P>But this is needed only if the route is not present already in the local router.&nbsp;</P>
<P>&nbsp;</P>Tue, 10 Sep 2019 00:56:27 GMThttps://forums.juniper.net/t5/Routing/Static-route-through-BGP/m-p/467851#M20183shijot2019-09-10T00:56:27ZRe: Static route through BGPhttps://forums.juniper.net/t5/Routing/Static-route-through-BGP/m-p/467862#M20184
<P>Hello,</P>
<P>&nbsp;</P>
<BLOCKQUOTE style="background-color: powderblue;"><HR /><LI-USER login="knightmese" uid="116634"></LI-USER>&nbsp;wrote:<BR />
<P>What the ISP told us is that we can advertise the /24 via BGP and statically route the /26 through them.&nbsp;</P>
</BLOCKQUOTE>
<P>&nbsp;</P>
<P>What Your ISP likely means is that ISP needs to define a static /26 route to point to Your border router' interface IP.</P>
<P>You don't point the route for an IP block You own to the upstream/ISP.</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<BLOCKQUOTE style="background-color: powderblue;"><HR /><LI-USER login="knightmese" uid="116634"></LI-USER>&nbsp;wrote:<BR />
<P>only need to define the static /26 through policy-options, export it through BGP and define it on an interface?</P>
</BLOCKQUOTE>
<P>if Your ISP uses a static /26 route to send traffic back to You, You don't need to do anything at all.</P>
<P>&nbsp;</P>
<P>HTH</P>
<P>Thx<BR />Alex</P>
<P>&nbsp;</P>Tue, 10 Sep 2019 08:43:52 GMThttps://forums.juniper.net/t5/Routing/Static-route-through-BGP/m-p/467862#M20184aarseniev2019-09-10T08:43:52ZRe: Static route through BGPhttps://forums.juniper.net/t5/Routing/Static-route-through-BGP/m-p/467895#M20185
<BLOCKQUOTE><HR /><LI-USER login="aarseniev" uid="7377"></LI-USER>&nbsp;wrote:<BR />
<P>&nbsp;</P>
<P>What Your ISP likely means is that ISP needs to define a static /26 route to point to Your border router' interface IP.</P>
<P>You don't point the route for an IP block You own to the upstream/ISP.</P>
<P>&nbsp;</P>
<HR /></BLOCKQUOTE>
<P><BR />Hi Alex,</P>
<P>&nbsp;</P>
<P>I didn't word that very well.&nbsp; I'm wondering how the /26 knows to route through to the ISP.&nbsp; If it was just the /26 and no BGP, I would add a static route saying 0.0.0.0 then go to 4.4.4.245.&nbsp; I'm new to BGP so if I add it as a secondary IP on the interface, does it just know to inject it into the route table?</P>
<P>&nbsp;</P>
<P>This is not something I have in production at the moment so I'm not able to check a live routing table.</P>Tue, 10 Sep 2019 16:26:13 GMThttps://forums.juniper.net/t5/Routing/Static-route-through-BGP/m-p/467895#M20185knightmese2019-09-10T16:26:13ZRe: Static route through BGPhttps://forums.juniper.net/t5/Routing/Static-route-through-BGP/m-p/467900#M20186
<P>You will have to export to BGP if it is a non-BGP route. If you dont have the specific route but contributing routes, you can think of aggregating the route as in the example below</P>
<P><A href="https://www.juniper.net/documentation/en_US/junos/topics/example/policy-aggregate-routes.html" target="_blank">https://www.juniper.net/documentation/en_US/junos/topics/example/policy-aggregate-routes.html</A></P>
<P>Btw, configured IP on the interface will be a direct route; so you will have to modify policy with that.</P>
<DIV class="statement" data-v-538f25e0=""><KBD class="user-typing" data-v-538f25e0="">set policy-options policy-statement send-direct term 1 from protocol direct</KBD></DIV>
<DIV class="statement" data-v-538f25e0=""><KBD class="user-typing" data-v-538f25e0="">set policy-options policy-statement send-direct term 1 from route-filter x.x.x.x/XX exact</KBD></DIV>
<DIV class="statement" data-v-538f25e0=""><KBD class="user-typing" data-v-538f25e0="">set policy-options policy-statement send-direct term 1 then accept</KBD></DIV>Tue, 10 Sep 2019 17:36:59 GMThttps://forums.juniper.net/t5/Routing/Static-route-through-BGP/m-p/467900#M20186shijot2019-09-10T17:36:59ZRe: Static route through BGPhttps://forums.juniper.net/t5/Routing/Static-route-through-BGP/m-p/467907#M20187
<P>Thank you Alex and Shijot!</P>Tue, 10 Sep 2019 18:52:18 GMThttps://forums.juniper.net/t5/Routing/Static-route-through-BGP/m-p/467907#M20187knightmese2019-09-10T18:52:18Z