BGP Default route

dspazman at epicup.com dspazman at epicup.com
Fri Mar 29 23:45:29 CET 2013


Yeah, I've tried similar to that.  I'm using multiple kernel tables and pipes though, so it is a little more complicated then that.

Let me give you my config for that bgp session.

define myas = 54XXX;
define linkc = 16XXX;
define gatewayc = X.X.X.X;

.
.
.

protocol static static_default_route {
    route 0.0.0.0/0 reject;
}

function net_linkc() {
## ip blocks they can export
  return net ~ [ X.X.X.X/22+ ];
}

dunction rt_import_linkc() {
  if net_linkc() then return true;
  return false;
}

function rt_export_linkc() {
  if proto = "static_default_route" then return true;
  if source != RTS_BGP then return false;
  if net_martian() then return false;
  if bgp_path.len > 64 then return false;
  return bgp_path.first ~ [ myas, linkc ];
}

protocol kernal k_c {
  table ispc;
  export all;

  kernal table 5;
  scan time 15;
}

filter bgp_in_uplink_c {
  if ! rt_import_linkc() then reject;
  accept;
}

filter bgp_out_uplink_c {
  if ! rt_export_linkc() then reject;
  accept;
}

protocol pipe p_c {
  table master
  peer table ispc;
  import filter bgp_in_uplink_c;
  export filter bgp_out_uplink_c;
}

protocol bgp bgp_c {
  table ispc;
  import all;
  export all;

  local as myas;
  neighbor gatewayc as linkc;
}

-----Original Message-----
From: "Wojciech Dec" <wojtek at systemx.com.pl>
Sent: Friday, March 29, 2013 3:25pm
To: bird-users at atrey.karlin.mff.cuni.cz
Subject: Re: BGP Default route

W dniu 2013-03-29 23:15, dspazman at epicup.com pisze:
> I'm having a problem with sending a default route.
>
> I have two providers I provide a full routing table to through BGP.  I'm trying to set up a 3rd BGP session on another interface to a downstream client, so I can take his announced prefixes and announce them to my upstream ISPs.  The main issue is they only want me to export the default route (0.0.0.0/0) to them, not the full table.
>
> Does anyone have a simple example of this, exporting just the default route to a downstream client, but accepting his prefix (X.X.X.X/24).
>
Hi,
Maybe this is not the best solution but it works :)

Make a new protocol

protocol static default_originate {
         route 0.0.0.0/0 reject;
}

add to a export filter

         if proto = "default_originate" then {
                 accept;
         }

regards






More information about the Bird-users mailing list