[Xorp-users] BGP network statements

Tim Durack tdurack@gmail.com
Sat, 25 Feb 2006 10:58:22 -0500


------=_Part_4655_26100577.1140883102233
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On 2/25/06, Calum <caluml@gmail.com> wrote:
>
> Hello again,
>
> Since I removed that vif statement, my BGP routes have appeared in my
> kernel routing table  - which is good news :)


Makes sense - sounds like the route for the next hop was never installed,
which is why the BGP routes did not show up.

I have been running a tunnel setup, using gre tunnels to simulate direct
connections between virtual XORP routers.

The tunnels are created by a linux script outside of XORP. The tunnel
interface is then configured in XORP simply to give it an ip. It then looks
like a real interface in the config.

Running BGP in this scenario works fine.

However, I can't work out from the docs how to add a network
> 10.20.30.0/24 route to be advertised.
>
> I would expect it to be something like create protocols bgp network
> 10.20.30.0/24, or perhaps peer-specific?
> Can anyone tell me where this option lives?


I believe for 1.2rc you should create a static route, and export static int=
o
BGP using policy:

protocols {
    static {
=09route4 10.20.30.0/24 {
=09    next-hop: 10.20.30.1
        }
    }
}

policy {
    policy-statement static-routes {
        term export {
            from {
                protocol: "static"
            }
        }
    }
}

protocols {
    bgp {
        bgp-id: 10.0.1.1
        local-as: 65014

        peer 192.168.0.2 {
            local-ip: 192.168.0.1
            as: 65004
            next-hop: 192.168.0.1
        }

        export: "static-routes"

    }
}

This was adapted from advice Atanu gave on redistributing connected routes,
but the same concept should apply to static.

Tim:>

------=_Part_4655_26100577.1140883102233
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

<br><br><div><span class=3D"gmail_quote">On 2/25/06, <b class=3D"gmail_send=
ername">Calum</b> &lt;<a href=3D"mailto:caluml@gmail.com" target=3D"_blank"=
 onclick=3D"return top.js.OpenExtLink(window,event,this)">caluml@gmail.com<=
/a>&gt; wrote:
</span><blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rg=
b(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello again,<br><br>Since I removed that vif statement, my BGP routes have =
appeared in my<br>kernel routing table&nbsp;&nbsp;- which is good news :)</=
blockquote><div><br>Makes sense - sounds like the route for the next hop wa=
s never installed, which is why the BGP routes did not show up.
<br><br>I have been running a tunnel setup, using gre tunnels to simulate d=
irect connections between virtual XORP routers.<br><br>The tunnels are crea=
ted by a linux script outside of XORP. The tunnel interface is then configu=
red in XORP simply to give it an ip. It then looks like a real interface in=
 the config.
<br><br>Running BGP in this scenario works fine.<br></div><br><blockquote c=
lass=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); ma=
rgin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">However, I can't work out from=
 the docs how to add a network
<br><a href=3D"http://10.20.30.0/24" target=3D"_blank" onclick=3D"return to=
p.js.OpenExtLink(window,event,this)">10.20.30.0/24</a> route to be advertis=
ed.<br><br>I would expect it to be something like create protocols bgp netw=
ork
<br><a href=3D"http://10.20.30.0/24" target=3D"_blank" onclick=3D"return to=
p.js.OpenExtLink(window,event,this)">10.20.30.0/24</a>, or perhaps peer-spe=
cific?
<br>Can anyone tell me where this option lives?</blockquote><div><br>I beli=
eve for 1.2rc you should create a static route, and export static into BGP =
using policy:<br><pre>protocols {<br>    static {<br>=09route4 <a href=3D"h=
ttp://10.20.30.0/24" target=3D"_blank" onclick=3D"return top.js.OpenExtLink=
(window,event,this)">
10.20.30.0/24</a> {<br>=09    next-hop: <a href=3D"http://10.20.30.1" targe=
t=3D"_blank" onclick=3D"return top.js.OpenExtLink(window,event,this)">10.20=
.30.1</a><br>        }<br>    }<br>}<br><br>policy {<br> &nbsp; &nbsp;polic=
y-statement static-routes {
<br> &nbsp; &nbsp; &nbsp; &nbsp;term export {<br> &nbsp; &nbsp; &nbsp; &nbs=
p; &nbsp; &nbsp;from {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;=
 &nbsp;protocol: &quot;static&quot;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;}<br> &nbsp; &nbsp; &nbsp; &nbsp;}<br> &nbsp; &nbsp;}<br>}<br><br>pro=
tocols {<br> &nbsp; &nbsp;bgp {<br> &nbsp; &nbsp; &nbsp; &nbsp;bgp-id: <a o=
nclick=3D"return top.js.OpenExtLink(window,event,this)" href=3D"http://10.0=
.1.1/" target=3D"_blank">
10.0.1.1</a><br> &nbsp; &nbsp; &nbsp; &nbsp;local-as: 65014<br><br> &nbsp; =
&nbsp; &nbsp; &nbsp;peer <a onclick=3D"return top.js.OpenExtLink(window,eve=
nt,this)" href=3D"http://192.168.0.2/" target=3D"_blank">192.168.0.2</a> {<=
br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;local-ip: <a onclick=3D"return=
 top.js.OpenExtLink(window,event,this)" href=3D"http://192.168.0.1/" target=
=3D"_blank">
192.168.0.1</a><br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;as: 65004<br> =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;next-hop: <a onclick=3D"return top=
.js.OpenExtLink(window,event,this)" href=3D"http://192.168.0.1/" target=3D"=
_blank">192.168.0.1</a><br> &nbsp; &nbsp; &nbsp; &nbsp;}<br>        <br>   =
     export: &quot;
<span id=3D"st" name=3D"st" class=3D"st0"></span>static-routes&quot;<br><br=
> &nbsp;  }<br>}<br></pre>This was adapted from advice Atanu gave on redist=
ributing connected routes, but the same concept should apply to static.<br>=
<br>Tim:&gt;
<br></div></div><br>


------=_Part_4655_26100577.1140883102233--