LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-30-2010, 06:39 AM   #1
janneaa
LQ Newbie
 
Registered: Apr 2010
Posts: 4

Rep: Reputation: 0
Error: "SIOCSIFADDR: Cannot allocate memory" adding virtual IPv6 Addresses


I get errors trying to virtual IPv6 Addresses i a lab environment. It works fine up to 2033 (?) adrressses, but when I try to add more i get "Cannot allocate memory" error:

# ifconfig eth0 add 2001:1b70:8282:2021:18:0:20:1
SIOCSIFADDR: Cannot allocate memory

This is on Ubuntu Server 9.10 (64-bit).

Any ideas on why we run into this limitation?
Any kernel parameters that can be changed?

/Janne
 
Old 05-02-2010, 12:31 AM   #2
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 611

Rep: Reputation: 221Reputation: 221Reputation: 221
Well . . . If I understand correctly, and you have assigned 2033 addresses to a network interface, and the error message says that it can't allocate any more memory for yet another address, I think that I can guess what could be wrong . . .

After replicating this error, please post the output of . . .
Code:
vmstat -s
 
Old 05-03-2010, 11:20 AM   #3
janneaa
LQ Newbie
 
Registered: Apr 2010
Posts: 4

Original Poster
Rep: Reputation: 0
This is the output of "vmstat -s".

Code:
# vmstat -s
    49556192 K total memory
     1269392 K used memory
      163412 K active memory
      120756 K inactive memory
    48286800 K free memory
       99844 K buffer memory
      164896 K swap cache
     5849080 K total swap
           0 K used swap
     5849080 K free swap
     2059179 non-nice user cpu ticks
          34 nice user cpu ticks
     1649679 system cpu ticks
  1567045977 idle cpu ticks
        1455 IO-wait cpu ticks
      264423 IRQ cpu ticks
     1566541 softirq cpu ticks
           0 stolen cpu ticks
      203851 pages paged in
      715786 pages paged out
           0 pages swapped in
           0 pages swapped out
   916165536 interrupts
  1089210944 CPU context switches
  1271920924 boot time
     2184939 forks
 
Old 05-03-2010, 05:40 PM   #4
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 611

Rep: Reputation: 221Reputation: 221Reputation: 221
Well . . . plenty of memory there, isn't there?

It may be that you've found a maximum number of virtual interfaces that your kernel will support on one physical NIC. I cannot, however, find any mention of such a limit in any of the kernel documentation or on any kernel newsgroups or discussion boards.

I will continue to research this. I apologize for the delay.

It is possible that there is a line of preprocessor code in one of the kernel headers which defines this limit, or a limit on memory for the kernel routing table. If this is the case, then, in theory, you could change this line and compile a custom kernel with a higher limit, or, possibly, no limit.

Like I said, I'll keep looking.
 
Old 05-04-2010, 02:05 AM   #5
janneaa
LQ Newbie
 
Registered: Apr 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Yeah, the memory shouldn't be a problem

I agree that we have found some kind of limit, but note that
  • It's not per NIC, it's the total number of IPv6 addresses that can be added
  • it's IPv6, when adding IPv4 addresses, we have used up to 260.000 addresses
  • the limit not exactly 2033, on another machine (same config) we where abe to add 10 more...

Greatful for any idea's!
 
Old 05-06-2010, 10:59 PM   #6
foodown
Member
 
Registered: Jun 2009
Location: Texas
Distribution: Slackware
Posts: 611

Rep: Reputation: 221Reputation: 221Reputation: 221
This could be an unresolved bug in a driver.

https://lists.linux-foundation.org/p...ry/011740.html

Are you using any of the following?

3Com Corporation 3c905B 100BaseTX [Cyclone]
Intel Corp. 82557/8/9 [Ethernet Pro 100]
 
Old 05-07-2010, 01:33 AM   #7
janneaa
LQ Newbie
 
Registered: Apr 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Solved.

The solution was to increase the max size of the IPv6 routing table:
/proc/sys/net/ipv6/route/max_size, which by default is 4096.

I Increased this an where able to create as many addresses as needed...

/Janne

PS. I guess the error message from ifconfig could be improved?
 
Old 06-03-2013, 02:44 PM   #8
depeje
LQ Newbie
 
Registered: Jun 2013
Posts: 1

Rep: Reputation: Disabled
Just want to add this to the internet archives, because this still seems to be an issue today with opensuse 12.2.

The same problem has some other symptoms. The first one is that the box doesn't get an address via RA. Forcing a router solicitation also fails:

Code:
krusty:~ # rdisc6 -m eth0                                                                                                                                                               
Soliciting ff02::2 (ff02::2) on eth0...                                                                                                                                                 
Sending ICMPv6 packet: Network is unreachable
On another machine in the same LAN I couldn't receive a solicitation with wireshark. So either the multicast solicitation didn't reach my wireshark PC, or the solicitation is not sent. I believe in the last case, because rdisc6 seemed to give up really fast.

ps. I make the fix permanent by adding this line to /etc/sysctl.conf:
Code:
net.ipv6.route.max_size = 16384
And just to be complete:
Code:
krusty:~ # vmstat -s
      8193140 K total memory
      7982872 K used memory
      1616208 K active memory
      1765260 K inactive memory
       210268 K free memory
        59044 K buffer memory
      4265084 K swap cache
      5242876 K total swap
      1387644 K used swap
      3855232 K free swap
     34468312 non-nice user cpu ticks
    212006556 nice user cpu ticks
    116870346 system cpu ticks
   1641680882 idle cpu ticks
     33816422 IO-wait cpu ticks
         7695 IRQ cpu ticks
      2502007 softirq cpu ticks
            0 stolen cpu ticks
   3746535773 pages paged in
   5399121983 pages paged out
      1332372 pages swapped in
      1301506 pages swapped out
    475418137 interrupts
   1186859131 CPU context switches
   1359917323 boot time
     35437367 forks
I know this post is very old, but I lost a day because I seem to be the first person on the internet who has this problem with my specific symptoms.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot create an IPv6 virtual IP (alias interface) using ioctl(SIOCSIFADDR) the_rock Linux - Newbie 2 08-20-2010 04:14 PM
pthread_create Cannot allocate memory error code 12 goodman888 Programming 4 05-20-2008 07:19 PM
how to make virtual machine in xen allocate memory automatically? jimmyjiang Red Hat 0 03-13-2008 02:17 PM
Error inserting CIFS: Cannot allocate memory pazo Linux - General 0 12-18-2007 11:47 AM
Error: cannot allocate memory ion111 Linux - Software 7 07-04-2004 06:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration