Question about limited primary addresses

Patrick Turley pturley at rocksteady.com
Tue Sep 21 20:51:01 CEST 2004


Jason Opperisano wrote:
 > On Sun, 2004-09-19 at 23:35, Patrick Turley wrote:
 >
 >>I am trying to configure a Linux box with all possible VLANs (4094 of
 >>them), and a subnet on each VLAN. Creating the VLANs isn't a problem.
 >>But, when I try to use "ip addr add ..." commands to assign an IP
 >>address to each VLAN interface, I get to do about 280 of them before all
 >>the interfaces on the box become unresponsive. I've also tried to assign
 >>the same IP addresses all to eth0, and I get the same result.
.
.
.
 > i'm not aware of any limit.  i believe 2.0/2.2 had an alias limit of 256
 > per interface, but i could be way off base...  there's probably
 > something going on with you particular machine (i.e. memory problem).
 >
 > my test to prove there's not a limit at 4096:
.
.
.
 > contents of "test" are:
 >
 > ----
 > i=1
 > function addIP() {
 >   j=0
 >   while [ $j -le 255 ]; do
 >     sudo ip addr add $1.$j.1.1/24 dev eth0
 >     let "j = $j + 1"
 >   done
 > }
 >
 > while [ $i -le 17 ]; do
 >    addIP $i
 >    let "i = $i + 1"
 > done
 > ----

First of all, thank you very much for the time you spent investigating 
this problem.

Your script works fine on my test computer. I was able to assign all 
4000+ addresses with no problem.

I captured the commands emitted by your script and the commands emitted 
by our software and began the process of making them look more and more 
like each other until the essential difference became clear. I finally 
got to the point where the *only* difference was the IP addresses.

The addresses assigned by your script are (as you said) 
[1-17].[1-255].1.1/24.

The addresses I was assigning were 10.[1-2].[1-255].1/24.

So, the major difference seems to be that all my addresses were confined 
to the 10/8 subnet. It may be important to note that some of the 
addresses generated by your script *did* lie in that range, but the 
majority did not.

I adjusted your script very slightly to put all the addresses in the 
10/8 subnet:


     i=1
     function addIP() {
       j=0
       while [ $j -le 255 ]; do
         sudo ip addr add 10.$1.$j.1/24 dev eth0
         let "j = $j + 1"
       done
     }

     while [ $i -le 2 ]; do
        addIP $i
        let "i = $i + 1"
     done


When I ran this version, I saw the very same failure I've been seeing 
all along.

Would it be possible for you to run the modified version of this script 
on your machine and see if you have any problem?

Thanks again for your time.




More information about the netfilter mailing list