Re: Command to Display Prefixes and Default router entries in Linux

Dheeraj Kandula <[email protected]> Fri, 24 Jun 2022 11:03:24 -0400
Newsgroups gmane.linux.debian.devel.ipv6
Message-ID <CA+qNgxQLUcvVm5Q73WtRgBDjDXZ9+B3DEXE97bT3+yWoYV0b4g@mail.gmail.com>
--000000000000dbd6b105e232df0e
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

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=C3=B8rn Mork <[email protected]> wrote:

> Dheeraj Kandula <[email protected]> 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->add=
r,
>                               /*router=3D*/ !!ifp->idev->cnf.forwarding,
>                               /*solicited=3D*/ false, /*override=3D*/ tru=
e,
>                               /*inc_opt=3D*/ true);
>         }
>
>
> Bj=C3=B8rn
>
>

--000000000000dbd6b105e232df0e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"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=3D"gmail_quote"><d=
iv dir=3D"ltr" class=3D"gmail_attr">On Fri, Jun 24, 2022 at 4:08 AM Bj=C3=
=B8rn Mork &lt;<a href=3D"mailto:[email protected]">[email protected]</a>&gt; wrote=
:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.=
8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dheeraj Kandul=
a &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">dkandula@gmai=
l.com</a>&gt; writes:<br>
<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>
<br>
Nope.=C2=A0 That&#39;s the &#39;router&#39; flag in the neigbour advertisme=
nt.=C2=A0 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>
<br>
&gt;From net/ipv6/addrconf.c:<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* send unsolicited NA if enabled */<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (send_na &amp;&amp;<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (ifp-&gt;idev-&gt;cnf.ndisc_notif=
y ||<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dev_net(dev)-&gt;ipv6.devco=
nf_all-&gt;ndisc_notify)) {<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ndisc_send_na(dev, =
&amp;in6addr_linklocal_allnodes, &amp;ifp-&gt;addr,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /*router=3D*/ !!ifp-&gt;idev-&gt;cnf.forwar=
ding,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /*solicited=3D*/ false, /*override=3D*/ tru=
e,<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 /*inc_opt=3D*/ true);<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
<br>
<br>
Bj=C3=B8rn<br>
<br>
</blockquote></div>

--000000000000dbd6b105e232df0e--