Messages in this thread | | | Date | Sat, 21 Sep 1996 12:37:15 -0400 (EDT) | From | Jacques Gelinas <> | Subject | Re: IP Alias Limit |
| |
I have tried to find the limit for this. There is a define in /usr/include/linux/net_alias.h. It is set to 256. I have then looked in the source to see where it was used. I only found a single reference in /usr/src/linux/net/core/net_alias.c. I have looked in headers, assembly file and C source file of the kernel.
The test is simply to avoid any alias number (eth0:num) >= 256. I have then looked around to see where was the real limitation. In the "alias" structure, the slot number is an unsigned, so this is not the limitation. All alias all dynamicly allocated and put in different link list of a hash table.
So I never found the real limitation. What I did next, was too remove that test from net/core/net_alias.c
#if 0 if (slot >= NET_ALIAS_MAX_SLOT) return NULL; #endif
I created a script and defined around 2500 alias (using multiple class C) like this
#!/bin/sh ali=1 for net in 1 2 3 4 5 6 7 8 9 10 do node=1 while [ $node -lt 255 ] do echo ifconfig eth0:$ali 222.111.$net.$node /sbin/ifconfig eth0:$ali 222.111.$net.$node /sbin/route add -host 222.111.$net.$node eth0:$ali node=`expr $node + 1` ali=`expr $ali + 1` done done
It tooks several minutes to setup all those alias on my super-dooper dx/2 with 16 megs ram, running X and all kind of goodies. I am now writing this email with this configuration. It does not seems to change much in my life though.
I have done different test either from this machine or from another one (adding proper routes for sure) and it looks like all the aliases were reachable.
There is maybe a limitation with the ARP system (shooting in the dark). btw, my eth0 main IP number is not on one of those phony class C.
Maybe I have been lucky and there is effectivly a limitation.
This makes me wonder. The current scheme of doing alias is neat to handle a couple of alias. People who need more are generally dedicating complete class C network (or a complete subnet) to aliases. Would it be possible to create a dummy device like we have but which accept every packet fitting in its network mask as itself. With such a device, I would have created the complete 2500 aliases with 10 dummies and 10 routes. I guess this would be more efficient in the long run. Any comments!
-------------------------------------------------------- Jacques Gelinas (jacques@solucorp.qc.ca) Linuxconf: The ultimate administration system for Linux. see http://www.solucorp.qc.ca:/linuxconf
| |