All of lore.kernel.org
 help / color / mirror / Atom feed
* IPv6 routes too much
@ 2013-02-08 10:48 Prashant Batra
  2013-02-08 15:34 ` Jan Engelhardt
  0 siblings, 1 reply; 4+ messages in thread
From: Prashant Batra @ 2013-02-08 10:48 UTC (permalink / raw)
  To: linux-newbie, netfilter

Hi,

I have a case wherein I have a route to a network connected to my
linux machine via an interface, which I added like-

route add -inet6 9aa::/16 gw 2001:db8:0:242::2 dev eth0

Now, when I send packets to ipv6 addresses in this network, from my
linux server, I see kernel adding routes for each of these addresses.
Is this behaviour correct. How can it be avoided?

My problem starts when I have millions of addresses in this network
that I am trying to reach.

A look of my routing table shows-
9aa:0:0:250::/128                           2001:db8:0:242::2
             UGC   0      23       0 eth0
9aa:0:0:251::/128                           2001:db8:0:242::2
             UGC   0      23       0 eth0
9aa:0:0:252::/128                           2001:db8:0:242::2
             UGC   0      23       0 eth0
9aa:0:0:253::/128                           2001:db8:0:242::2
             UGC   0      23       0 eth0
9aa:0:0:254::/128                           2001:db8:0:242::2
             UGC   0      23       0 eth0
9aa:0:0:255::/128                           2001:db8:0:242::2
             UGC   0      23       0 eth0
9aa:0:0:256::/128                           2001:db8:0:242::2
             UGC   0      23       0 eth0
9aa:0:0:257::/128                           2001:db8:0:242::2
             UGC   0      23       0 eth0
9aa:0:0:258::/128                           2001:db8:0:242::2
             UGC   0      23       0 eth0
9aa:0:0:259::/128                           2001:db8:0:242::2
             UGC   0      23       0 eth0
9aa:0:0:25a::/128                           2001:db8:0:242::2
             UGC   0      23       0 eth0
9aa:0:0:25b::/128                           2001:db8:0:242::2
             UGC   0      23       0 eth0
9aa:0:0:25c::/128                           2001:db8:0:242::2
             UGC   0      23       0 eth0

like this I get 10k routes
#cat /proc/net/ipv6_route | wc -l
10015


Any help is highly appreciated.

thanks,
Prashant
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: IPv6 routes too much
  2013-02-08 10:48 IPv6 routes too much Prashant Batra
@ 2013-02-08 15:34 ` Jan Engelhardt
  2013-02-08 17:38   ` Prashant Batra
       [not found]   ` <CAG+XuE5g9jJTP4uu5ymQfzvx-O6U9SfK85XGoK+H7yqtVA6A0A@mail.gmail.com>
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Engelhardt @ 2013-02-08 15:34 UTC (permalink / raw)
  To: Prashant Batra; +Cc: linux-newbie, netfilter

On Friday 2013-02-08 11:48, Prashant Batra wrote:

>I have a case wherein I have a route to a network connected to my
>linux machine via an interface, which I added like-
>
>route add -inet6 9aa::/16 gw 2001:db8:0:242::2 dev eth0

Forget net-tools already. It is not maintained.
There is no issue with iproute.

>like this I get 10k routes
>#cat /proc/net/ipv6_route | wc -l
>10015

It is correct - it dumps routes (for some definition of "route"), in 
particular all FIB entries. You will find the same for IPv4 in 
/proc/net/rt_cache on kernels where the cache has not already been 
removed. That said /proc/net only shows table 254, so the whole procfs 
business is pretty useless.

Just use iproute2, really.
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: IPv6 routes too much
  2013-02-08 15:34 ` Jan Engelhardt
@ 2013-02-08 17:38   ` Prashant Batra
       [not found]   ` <CAG+XuE5g9jJTP4uu5ymQfzvx-O6U9SfK85XGoK+H7yqtVA6A0A@mail.gmail.com>
  1 sibling, 0 replies; 4+ messages in thread
From: Prashant Batra @ 2013-02-08 17:38 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: linux-newbie

On Fri, Feb 8, 2013 at 9:04 PM, Jan Engelhardt <jengelh@inai.de> wrote:
> On Friday 2013-02-08 11:48, Prashant Batra wrote:
>
>>I have a case wherein I have a route to a network connected to my
>>linux machine via an interface, which I added like-
>>
>>route add -inet6 9aa::/16 gw 2001:db8:0:242::2 dev eth0
>
> Forget net-tools already. It is not maintained.
> There is no issue with iproute.
>
>>like this I get 10k routes
>>#cat /proc/net/ipv6_route | wc -l
>>10015
>
> It is correct - it dumps routes (for some definition of "route"), in
> particular all FIB entries. You will find the same for IPv4 in
> /proc/net/rt_cache on kernels where the cache has not already been
> removed. That said /proc/net only shows table 254, so the whole procfs
> business is pretty useless.
>
So, if I understand correctly, the /proc/net/rt_cache and
/proc/net/ipv6_route display the routing cache for v4 and v6
respectively, which the kernel maintains.
And, in case my server is trying to send packets to millions of
addresses, kernel will cache the routes for them, until
"/proc/sys/net/ipv6/route/max_size" is reached after which it will
flush some old entries to make room for new ones.
So, any advice onto how the kernel configs specially under
/proc/sys/net/ipv6/route/* should be controlled to get best
performance.
> Just use iproute2, really.



--
Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: IPv6 routes too much
       [not found]   ` <CAG+XuE5g9jJTP4uu5ymQfzvx-O6U9SfK85XGoK+H7yqtVA6A0A@mail.gmail.com>
@ 2013-02-09  3:31     ` Jan Engelhardt
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Engelhardt @ 2013-02-09  3:31 UTC (permalink / raw)
  To: Prashant Batra; +Cc: linux-newbie, netfilter


On Friday 2013-02-08 18:33, Prashant Batra wrote:
>
>So, any advice onto how the kernel configs specially under
>/proc/sys/net/ipv6/route/* should be controlled to get best performance.

The defaults should be good enough.

If they are not: Measure it.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-02-09  3:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-08 10:48 IPv6 routes too much Prashant Batra
2013-02-08 15:34 ` Jan Engelhardt
2013-02-08 17:38   ` Prashant Batra
     [not found]   ` <CAG+XuE5g9jJTP4uu5ymQfzvx-O6U9SfK85XGoK+H7yqtVA6A0A@mail.gmail.com>
2013-02-09  3:31     ` Jan Engelhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.