• Command to Display Prefixes and Default router entries in Linux

    From Dheeraj Kandula@21:1/5 to All on Thu Jun 23 17:10:01 2022
    Hi All,
    In FreeBSD we have the "ndp -p" and "ndp -r" to display the Prefixes
    and the default router entries learned from Router Advertisements.

    Is there an equivalent command in Linux?

    I tried "ip neighbor" but that doesn't display the entries related to RA.

    Dheeraj

    <div dir="ltr"><div>Hi All,</div><div>     In FreeBSD we have the &quot;ndp -p&quot; and &quot;ndp -r&quot; to display the Prefixes and the default router entries learned from Router Advertisements. <br></div><div><br></div><div>Is there an
    equivalent command in Linux?</div><div><br></div><div>I tried &quot;ip neighbor&quot; but that doesn&#39;t display the entries related to RA.<br></div><div><br></div><div>Dheeraj<br></div></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Povl Ole Haarlev Olsen@21:1/5 to Dheeraj Kandula on Thu Jun 23 20:30:01 2022
    On Thu, 23 Jun 2022, Dheeraj Kandula wrote:
    In FreeBSD we have the "ndp -p" and "ndp -r" to display the Prefixes
    and the default router entries learned from Router Advertisements.

    Is there an equivalent command in Linux?

    I tried "ip neighbor" but that doesn't display the entries related to RA.

    Maybe "ip -6 route" has (some of) what you're looking for?

    --
    Povl Ole

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dheeraj Kandula@21:1/5 to All on Thu Jun 23 21:20:01 2022
    Thanks Povl.

    In the "ip neighbor" output, I see entries listed with "router". Maybe it
    is a RA Default router learnt entry.

    Dheeraj

    On Thu, Jun 23, 2022 at 1:25 PM Povl Ole Haarlev Olsen <poho@stderr.dk>
    wrote:

    On Thu, 23 Jun 2022, Dheeraj Kandula wrote:
    In FreeBSD we have the "ndp -p" and "ndp -r" to display the Prefixes and the default router entries learned from Router Advertisements.

    Is there an equivalent command in Linux?

    I tried "ip neighbor" but that doesn't display the entries related to RA.

    Maybe "ip -6 route" has (some of) what you're looking for?

    --
    Povl Ole


    <div dir="ltr"><div>Thanks Povl. <br></div><div><br></div><div>In the &quot;ip neighbor&quot; output, I see entries listed with &quot;router&quot;. Maybe it is a RA Default router learnt entry.</div><div><br></div><div>Dheeraj<br></div></div><br><div
    class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 23, 2022 at 1:25 PM Povl Ole Haarlev Olsen &lt;<a href="mailto:poho@stderr.dk">poho@stderr.dk</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-
    left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, 23 Jun 2022, Dheeraj Kandula wrote:<br>
    &gt;     In FreeBSD we have the &quot;ndp -p&quot; and &quot;ndp -r&quot; to display the Prefixes<br>
    &gt; and the default router entries learned from Router Advertisements.<br> &gt;<br>
    &gt; Is there an equivalent command in Linux?<br>
    &gt;<br>
    &gt; I tried &quot;ip neighbor&quot; but that doesn&#39;t display the entries related to RA.<br>

    Maybe &quot;ip -6 route&quot; has (some of) what you&#39;re looking for?<br>

    -- <br>
    Povl Ole<br>
    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?utf-8?Q?Bj=C3=B8rn_Mork?=@21:1/5 to Dheeraj Kandula on Fri Jun 24 10:10:01 2022
    Dheeraj Kandula <dkandula@gmail.com> writes:

    Thanks Povl.

    In the "ip neighbor" output, I see entries listed with "router". Maybe it
    is a RA Default router learnt entry.

    Nope. That's the 'router' flag in the neigbour advertisment. Lots of
    systems will set this flag without sending RAs. Linux will set it if
    forwarding is enable on the interface where the NA is going out.

    From net/ipv6/addrconf.c:

    /* send unsolicited NA if enabled */
    if (send_na &&
    (ifp->idev->cnf.ndisc_notify ||
    dev_net(dev)->ipv6.devconf_all->ndisc_notify)) {
    ndisc_send_na(dev, &in6addr_linklocal_allnodes, &ifp->addr,
    /*router=*/ !!ifp->idev->cnf.forwarding,
    /*solicited=*/ false, /*override=*/ true,
    /*inc_opt=*/ true);
    }


    Bjørn

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dheeraj Kandula@21:1/5 to bjorn@mork.no on Fri Jun 24 17:10:02 2022
    Thanks, Bjorn for the response.

    The R flag is set in the NA as the sender is a router.

    Dheeraj

    On Fri, Jun 24, 2022 at 4:08 AM Bjørn Mork <bjorn@mork.no> wrote:

    Dheeraj Kandula <dkandula@gmail.com> writes:

    Thanks Povl.

    In the "ip neighbor" output, I see entries listed with "router". Maybe it is a RA Default router learnt entry.

    Nope. That's the 'router' flag in the neigbour advertisment. Lots of systems will set this flag without sending RAs. Linux will set it if forwarding is enable on the interface where the NA is going out.

    From net/ipv6/addrconf.c:

    /* send unsolicited NA if enabled */
    if (send_na &&
    (ifp->idev->cnf.ndisc_notify ||
    dev_net(dev)->ipv6.devconf_all->ndisc_notify)) {
    ndisc_send_na(dev, &in6addr_linklocal_allnodes, &ifp->addr,
    /*router=*/ !!ifp->idev->cnf.forwarding,
    /*solicited=*/ false, /*override=*/ true,
    /*inc_opt=*/ true);
    }


    Bjørn



    <div dir="ltr"><div>Thanks, Bjorn for the response. <br></div><div><br></div><div>The R flag is set in the NA as the sender is a router. <br></div><div><br></div><div>Dheeraj<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">
    On Fri, Jun 24, 2022 at 4:08 AM Bjørn Mork &lt;<a href="mailto:bjorn@mork.no">bjorn@mork.no</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dheeraj Kandula &
    lt;<a href="mailto:dkandula@gmail.com" target="_blank">dkandula@gmail.com</a>&gt; writes:<br>

    &gt; Thanks Povl.<br>
    &gt;<br>
    &gt; In the &quot;ip neighbor&quot; output, I see entries listed with &quot;router&quot;. Maybe it<br>
    &gt; is a RA Default router learnt entry.<br>

    Nope.  That&#39;s the &#39;router&#39; flag in the neigbour advertisment.  Lots of<br>
    systems will set this flag without sending RAs. Linux will set it if<br> forwarding is enable on the interface where the NA is going out.<br>

    &gt;From net/ipv6/addrconf.c:<br>

            /* send unsolicited NA if enabled */<br>
            if (send_na &amp;&amp;<br>
                (ifp-&gt;idev-&gt;cnf.ndisc_notify ||<br>
                 dev_net(dev)-&gt;ipv6.devconf_all-&gt;ndisc_notify)) {<br>                 ndisc_send_na(dev, &amp;in6addr_linklocal_allnodes, &amp;ifp-&gt;addr,<br>
                                  /*router=*/ !!ifp-&gt;idev-&gt;cnf.forwarding,<br>
                                  /*solicited=*/ false, /*override=*/ true,<br>
                                  /*inc_opt=*/ true);<br>
            }<br>


    Bjørn<br>

    </blockquote></div>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)