Discussion:
[j-nsp] Conditional advertising of default routes
Jee Kay
2006-01-26 08:28:25 UTC
Permalink
I've got a pair of Juniper M7is that handle our internet connectivity.
At the moment, they are generating default routes via static discard
configuration, and advertising them into OSPF. Obviously this is less
than ideal, as if one router's uplink disappears it will continue to
advertise the default and we'll get blackholed traffic at worst (at
best, iBGP plugs the gap, but right now that isn't in place).

With Cisco, in a similar situation, you can do a default-information
originate route-map blah, where route-map blah just matches a network
you expect always to be available (I use the RIPE F golden network).
In this way, if a border routers peering drops, it stops advertising
the default and traffic gets routed correctly internally.

I've been searching through the Juniper documentation, but have been
unable to figure out how to produce the same effect on them.

Any ideas?

Thanks in advance,
Ras
Thomas Salmen
2006-01-26 08:47:29 UTC
Permalink
You could ask your transit providers to send you a default route as well as
full routes?

/t
Post by Jee Kay
I've got a pair of Juniper M7is that handle our internet connectivity.
At the moment, they are generating default routes via static discard
configuration, and advertising them into OSPF. Obviously this is less
than ideal, as if one router's uplink disappears it will continue to
advertise the default and we'll get blackholed traffic at worst (at
best, iBGP plugs the gap, but right now that isn't in place).
With Cisco, in a similar situation, you can do a default-information
originate route-map blah, where route-map blah just matches a network
you expect always to be available (I use the RIPE F golden network).
In this way, if a border routers peering drops, it stops advertising
the default and traffic gets routed correctly internally.
I've been searching through the Juniper documentation, but have been
unable to figure out how to produce the same effect on them.
Any ideas?
Thanks in advance,
Ras
_______________________________________________
juniper-nsp mailing list juniper-nsp at puck.nether.net
http://puck.nether.net/mailman/listinfo/juniper-nsp
Pekka Savola
2006-01-26 09:07:55 UTC
Permalink
Post by Thomas Salmen
You could ask your transit providers to send you a default route as well as
full routes?
If they don't have a default route, they might not want to do so, if
that'd mean they'd have to put a default route in their boxes.

Actually, we have the same issue as Jee Kay. Using a default route
generates all sorts of (difficult-to-notice, and -debug) corner cases,
but we really don't want to push full 200K routes on all our routers
either..
--
Pekka Savola "You each name yourselves king, yet the
Netcore Oy kingdom bleeds."
Systems. Networks. Security. -- George R.R. Martin: A Clash of Kings
Daniel Roesen
2006-01-27 15:48:26 UTC
Permalink
Post by Pekka Savola
Post by Thomas Salmen
You could ask your transit providers to send you a default route as well as
full routes?
If they don't have a default route, they might not want to do so, if
that'd mean they'd have to put a default route in their boxes.
Actually, we have the same issue as Jee Kay. Using a default route
generates all sorts of (difficult-to-notice, and -debug) corner cases,
but we really don't want to push full 200K routes on all our routers
either..
Jep. Proper default routing is a difficult thing.

The ideal solution would be to have the real tier1s originate default
routes to their BGP downstreams, and those being able to selectively
make those default routes not being used for forwarding, but still
available for re-announcement to their customers who wish to receive
dependable default routes.

One can do this with JunOS by tagging a received BGP default route with
a community, and matching this community on RIB-to-FIB feeding to
discard the route. Still in BGP, but not used for forwarding.

No idea wether this trick can be done with Cisco gear - I cannot
remember them having a way to filter the RIB-to-FIB transfer.


Best regards,
Daniel
--
CLUE-RIPE -- Jabber: dr at cluenet.de -- dr at IRCnet -- PGP: 0xA85C8AA0
Julian Cowley
2006-02-04 00:37:49 UTC
Permalink
Post by Pekka Savola
Post by Thomas Salmen
You could ask your transit providers to send you a default route as well as
full routes?
If they don't have a default route, they might not want to do so, if
that'd mean they'd have to put a default route in their boxes.
Actually, we have the same issue as Jee Kay. Using a default route
generates all sorts of (difficult-to-notice, and -debug) corner cases,
but we really don't want to push full 200K routes on all our routers
either..
Can you expound on these corner cases?

When we took a look at this issue last year, we came to conclusion
to always originate a default route from both of our Junipers
simultaneously. This sounds exactly like Jee Kay's configuration now.
Even if its upstream link goes down, a router can still be used as
a gateway since it will just punt to the other router via OSPF or iBGP.

We've had more problems with using a default network (in Cisco
speak) where you look for a particular route from your upstream.
If that network disappears, the router will silently stop announcing
a default route.
--
"Seemed like to me would make them a step closer to achieving that
objective and we have an obligation in order to keep the peace to
work together to achieve the objective that we're trying to achieve
through the current diplomatic process." -- George W. Bush
radu.pavaloiu at dynamicnetworks.ro ()
2006-01-26 09:51:30 UTC
Permalink
I think you can use a generated default route with a contrib of uplink
prefix. When the uplink disappears the contrib route do the same and the
generated route disappears.

HTH,

Radu Pavaloiu
CCIE #14582, JNCIS M/T
Post by Jee Kay
I've got a pair of Juniper M7is that handle our internet connectivity.
At the moment, they are generating default routes via static discard
configuration, and advertising them into OSPF. Obviously this is less
than ideal, as if one router's uplink disappears it will continue to
advertise the default and we'll get blackholed traffic at worst (at
best, iBGP plugs the gap, but right now that isn't in place).
With Cisco, in a similar situation, you can do a default-information
originate route-map blah, where route-map blah just matches a network
you expect always to be available (I use the RIPE F golden network).
In this way, if a border routers peering drops, it stops advertising
the default and traffic gets routed correctly internally.
I've been searching through the Juniper documentation, but have been
unable to figure out how to produce the same effect on them.
Any ideas?
Thanks in advance,
Ras
_______________________________________________
juniper-nsp mailing list juniper-nsp at puck.nether.net
http://puck.nether.net/mailman/listinfo/juniper-nsp
---------------------------------------------------
This message and its contents have been scanned and certified for
transmission as being free from malicious code by <<eTrust Antivirus>>.
This
message may contain confidential, privileged or other legally protected
information. It is intended for the addressee(s) only. If you are not the
addressee, or someone the addressee authorized to receive this message,
you
are prohibited from copying, distributing or otherwise using it. Please
notify the sender and return it.Thank you.
---------------------------------------------------
This message and its contents have been scanned and certified for
transmission as being free from malicious code by <<eTrust Antivirus>>. This
message may contain confidential, privileged or other legally protected
information. It is intended for the addressee(s) only. If you are not the
addressee, or someone the addressee authorized to receive this message, you
are prohibited from copying, distributing or otherwise using it. Please
notify the sender and return it.Thank you.
Terje Krogdahl
2006-01-26 14:26:09 UTC
Permalink
Post by radu.pavaloiu at dynamicnetworks.ro ()
I think you can use a generated default route with a contrib of uplink
prefix. When the uplink disappears the contrib route do the same and the
generated route disappears.
I like doing something like this, it makes sure I use the routes
from the correct upstream, is pretty generic in which routes it
requires, and makes show route extensive tolerable:

routing-options {
generate {
route 0.0.0.0/0 {
policy gendefault;
}
}
}
policy-options {
policy-statement gendefault {
term upstreamroutes {
from {
as-path upstream;
route-filter 0.0.0.0/0 upto /16;
}
then accept;
}
term end {
then reject;
}
}
as-path upstream "^65000 ";
}
--
Terje Krogdahl

All roads lead to Rome
- A clearly confused router (R. Perlman)
Craig Pierantozzi
2006-01-26 17:06:31 UTC
Permalink
Use the 'generate' route with a combination of a policy to define
the contributor routes you would like:

http://www.juniper.net/techpubs/software/junos/junos74/swconfig74-routing/ht
ml/routing-tables-config50.html

http://www.juniper.net/techpubs/software/junos/junos74/swconfig74-routing/ht
ml/routing-tables-config49.html

regards
Post by Jee Kay
I've got a pair of Juniper M7is that handle our internet connectivity.
At the moment, they are generating default routes via static discard
configuration, and advertising them into OSPF. Obviously this is less
than ideal, as if one router's uplink disappears it will continue to
advertise the default and we'll get blackholed traffic at worst (at
best, iBGP plugs the gap, but right now that isn't in place).
With Cisco, in a similar situation, you can do a default-information
originate route-map blah, where route-map blah just matches a network
you expect always to be available (I use the RIPE F golden network).
In this way, if a border routers peering drops, it stops advertising
the default and traffic gets routed correctly internally.
I've been searching through the Juniper documentation, but have been
unable to figure out how to produce the same effect on them.
Any ideas?
Thanks in advance,
Ras
_______________________________________________
juniper-nsp mailing list juniper-nsp at puck.nether.net
http://puck.nether.net/mailman/listinfo/juniper-nsp
Chris Kawchuk
2006-02-04 02:55:12 UTC
Permalink
When we took a look at this issue last year, we came to conclusion to
always originate a default route from both of our Junipers
simultaneously. > This sounds exactly like Jee Kay's configuration now.
Even if its upstream link goes down, a router can still be used as a
gateway since it will just punt to the other router via OSPF or iBGP.

We've had luck in doing just that - but with a twist. We originate a
default route in both POP Junipers; with 1 slightly higher metric than
the other, so that "downstream" Cisco devices don't do the "one packet
goes left, one packet goes right" when dealing with meshed equal-cost
OSPF downlinks from the core.

We also do a "no install" flag against the default origination, so even
though the Juniper M-series core routers are advertising a "default"
route to the rest of the downstream network via OSPF, they don't
actually install the route into the local forwarding table. This has the
nice effect of non-BGP/OSPF-only-speaking equipment "gravitating" all
their non-IGP traffic towards one of the core/transit routers, yet, in
the case of a non-routable address (i.e. an address that does not appear
in the global BGP table - such as 1.1.1.1 for example), the Juniper's
report ye olde "ICMP Network Unreachable", rather than sending the
packet up to a transit, who, after a few hops, declare the destination
network unreachable for the same reasons.

Here's our config. Apologies to those who have seen this posted in these
forums before:

routing-options {
static {
route 10.0.0.0/8 {
next-hop 10.1.1.1;
no-readvertise;
}
route 192.168.0.0/16 {
next-hop 10.1.1.1;
no-readvertise;
}
route 172.16.0.0/12 {
next-hop 10.1.1.1;
no-readvertise;
}
route 0.0.0.0/0 {
next-hop something-reachable-that-is-directly-connected;
no-install;
readvertise;
metric 1;
}

(Note what I am also doing w/RFC 1918 space - out interface fxp0 for my
own internal management reasons. Again this gives ICMP Network
Unreachable Messages, as traffic is not allowed to pass from a transit
interface to fxp0 - I suggest doing this, rather than using egress
filters/martians lists to remove RFC1918 space. (kudos to team cymru)

The other Core M-series router is the same config, but with "metric 2".
They have a local gigabit link between each of them, so, yes, one will
"punt" the traffic to the other in the case of an eBGP "better route" on
the second router.

Note that the "next hop" against the 0.0.0.0/0 entry must be something
directly reachable (and not a loopback). If you want to use a "far away
address", then you'll need the "resolve" keyword, which means the static
route will have an "actual" next-hop which is in the "general direction"
of your specific/hard-coded next hop.

Hope this helps. I realize it doesn't solve the exact problem (i.e.
create a 0.0.0.0/0 entry based on the availability of some route being
advertised by a directly-connected eBGP peer; but this method has shown
to work well in our network. Caveat Emptor.

Chris Kawchuk
Director, Data Telecommunications
Distributel Communications Ltd.
Julian Cowley
2006-02-05 01:52:40 UTC
Permalink
Post by Chris Kawchuk
Post by Julian Cowley
When we took a look at this issue last year, we came to conclusion
to always originate a default route from both of our Junipers
simultaneously. This sounds exactly like Jee Kay's configuration
now. Even if its upstream link goes down, a router can still
be used as a gateway since it will just punt to the other router
via OSPF or iBGP.
We've had luck in doing just that - but with a twist. We originate a
default route in both POP Junipers; with 1 slightly higher metric than
the other, so that "downstream" Cisco devices don't do the "one packet
goes left, one packet goes right" when dealing with meshed equal-cost
OSPF downlinks from the core.
I just noticed that we're using lopsided metrics for the default route as
well (see below). This config has been fine tuned by many hands over the
years. :)

Looking more closely at our configuration, I also noticed that we're not
*always* generating a default route as I remembered, but only if we're
getting at least one route from the upstream based on the next hop. This
is similar to some of the other configs I saw posted.
Post by Chris Kawchuk
We also do a "no install" flag against the default origination, so even
though the Juniper M-series core routers are advertising a "default"
route to the rest of the downstream network via OSPF, they don't
actually install the route into the local forwarding table. This has the
nice effect of non-BGP/OSPF-only-speaking equipment "gravitating" all
their non-IGP traffic towards one of the core/transit routers, yet, in
the case of a non-routable address (i.e. an address that does not appear
in the global BGP table - such as 1.1.1.1 for example), the Juniper's
report ye olde "ICMP Network Unreachable", rather than sending the
packet up to a transit, who, after a few hops, declare the destination
network unreachable for the same reasons.
In the past we've found that a certain amount of sites are in fact
reachable from our upstreams but not from the routes advertised to us.
We haven't looked at this in quite a while but I seem to remember that
this "background noise" accounted for at least several hundred kb/s.
Therefore we always install the default route into the tables.
Post by Chris Kawchuk
Here's our config. Apologies to those who have seen this posted in these
(Note what I am also doing w/RFC 1918 space - out interface fxp0 for my
own internal management reasons. Again this gives ICMP Network
Unreachable Messages, as traffic is not allowed to pass from a transit
interface to fxp0 - I suggest doing this, rather than using egress
filters/martians lists to remove RFC1918 space. (kudos to team cymru)
The other Core M-series router is the same config, but with "metric 2".
They have a local gigabit link between each of them, so, yes, one will
"punt" the traffic to the other in the case of an eBGP "better route" on
the second router.
You can use "metric add" for this. We just add 1 to the computed
metric for the interface on one of the Junipers.
Post by Chris Kawchuk
Note that the "next hop" against the 0.0.0.0/0 entry must be something
directly reachable (and not a loopback). If you want to use a "far away
address", then you'll need the "resolve" keyword, which means the static
route will have an "actual" next-hop which is in the "general direction"
of your specific/hard-coded next hop.
We're using a generate statement for that instead of a static route.
Same thing, but it means you don't need to specify something for the
destination. The next hop of the default route is the next hop of the
"primary contributing route" in Juniper speak.

Since we're posting configs, here's ours:

generate {
route 0.0.0.0/0 policy if-upstream-routes-exist;
}

policy-statement if-upstream-routes-exist {
/* Each upstream is only one of the Junipers, but we keep the
same config on both, so only one of these terms will match.
Any route from the upstream will cause the default route to
be generated, with the next hop being the next hop of the
"primary contributing route". */
term upstream1-routes {
/* The IP address of the other link to the first upstream */
from next-hop xxx.1.1.1;
then accept;
}
term upstream2-routes {
/* The IP address of the other link to the second upstream */
from next-hop xxx.2.2.2;
then accept;
}
/* At this point, if no upstream routes are available, the default
route from the peer will take over. */
term all-other-routes {
then reject;
}
}

Here is part of the OSPF export policy:

term default-route {
from {
route-filter 0.0.0.0/0 exact;
}
then {
/* The metric change is only present on one of the routers. */
metric add 1;
external {
type 1;
}
}
}
Post by Chris Kawchuk
Hope this helps. I realize it doesn't solve the exact problem (i.e.
create a 0.0.0.0/0 entry based on the availability of some route being
advertised by a directly-connected eBGP peer; but this method has shown
to work well in our network. Caveat Emptor.
Concur. We actually tested our configuration during a maintenance
period by bringing down each upstream peer and watching the action.
No problems with it.
--
"Seemed like to me would make them a step closer to achieving that
objective and we have an obligation in order to keep the peace to
work together to achieve the objective that we're trying to achieve
through the current diplomatic process." -- George W. Bush
Loading...