Mailing List Archive

Natural mask in bgpd
Got report from user that bgpd doesn't show masks for some routes in
"show ip bgp". Looked at code and discovered this in
route_vty_out_route (bgp_route.c:3703) function:

if ((IN_CLASSC (destination) && p->prefixlen == 24)
|| (IN_CLASSB (destination) && p->prefixlen == 16)
|| (IN_CLASSA (destination) && p->prefixlen == 8)
|| p->u.prefix4.s_addr == 0)
{
/* When mask is natural, mask is not displayed. */
}
else
len += vty_out (vty, "/%d", p->prefixlen);

I thought that we already live in classless world.


--
Hasso Tepper
Elion Enterprises Ltd.
WAN administrator
Re: Natural mask in bgpd [ In reply to ]
>I thought that we already live in classless world.
>
>
I agree it can be removed ;-)

Vincent
Re: Natural mask in bgpd [ In reply to ]
On Fri, Feb 13, 2004 at 08:09:43PM +0200,
Hasso Tepper <hasso@estpak.ee> wrote
a message of 25 lines which said:

> Got report from user that bgpd doesn't show masks for some routes in
> "show ip bgp".

I agree with you, it is a problem (borrowed from Zebra which in turn
borrowed it from IOS: it is difficult to change it without breaking
some scripts).

I suggest to implement the IOS option (which I cannot find currently)
that allows Cisco routers to always display the prefix length.

> if ((IN_CLASSC (destination) && p->prefixlen == 24)
> || (IN_CLASSB (destination) && p->prefixlen == 16)
> || (IN_CLASSA (destination) && p->prefixlen == 8)
> || p->u.prefix4.s_addr == 0)
> {
> /* When mask is natural, mask is not displayed. */
> }
> else
> len += vty_out (vty, "/%d", p->prefixlen);
Re: Natural mask in bgpd [ In reply to ]
Stephane Bortzmeyer wrote:
> I agree with you, it is a problem (borrowed from Zebra which in turn
> borrowed it from IOS: it is difficult to change it without breaking
> some scripts).

I don't think so. Most of routes have masks anyway and I can't think
of situation where appearing mask would break scripts.

> I suggest to implement the IOS option (which I cannot find
> currently) that allows Cisco routers to always display the prefix
> length.

"ip classless"? Which is default anyway for years already. I have only
one router to check from at the moment and it shows regardless
this option. IOS is 12.2-18.S3.

--
Hasso Tepper
Elion Enterprises Ltd.
WAN administrator
Re: Natural mask in bgpd [ In reply to ]
--On Monday, February 16, 2004 11:43 am +0200 Hasso Tepper
<hasso@estpak.ee> wrote:

> I don't think so. Most of routes have masks anyway and I can't think
> of situation where appearing mask would break scripts.

I don't think you can predict what people's regexps are matching on.

> "ip classless"? Which is default anyway for years already. I have only
> one router to check from at the moment and it shows regardless
> this option. IOS is 12.2-18.S3.

No, 'ip classless' does not do this. Did you check this?

c7200-1#show run | inc classless
ip classless
c7200-1#show ip bgp
BGP table version is 2473995, local router ID is 81.2.65.156
Status codes: s suppressed, d damped, h history, * valid, > best, i -
internal,
S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
*> 3.0.0.0 81.2.65.130 100 0 5519 5413 2914
1239 80 i
...

Rick
Re: Natural mask in bgpd [ In reply to ]
Rick Payne wrote:
> <hasso@estpak.ee> wrote:
> > I don't think so. Most of routes have masks anyway and I can't
> > think of situation where appearing mask would break scripts.
>
> I don't think you can predict what people's regexps are matching
> on.

Yes, people do weird things :).

> > "ip classless"? Which is default anyway for years already. I have
> > only one router to check from at the moment and it shows
> > regardless this option. IOS is 12.2-18.S3.
>
> No, 'ip classless' does not do this. Did you check this?

No, as I said I had only one cisco router to check from. at the moment
I haven't even this one.

--
Hasso Tepper
Elion Enterprises Ltd.
WAN administrator