Skip to content
Advertisement

Change maximum number of Virtual interfaces in Kernel

I am running Ubuntu server 14.04.3.

I have smcroute installed – Version 0.95, Build 130523. When I attempt to start the daemon I get the error message: ERRO: addVIF, out of VIF space;, this happens after it attempts to add the 33rd network interface of my machine.

Looking in mroute.h in /usr/include/linux/ folder, I saw a MAXVIFS defined as 32, so I upped it to 100 and saved the file.

After a reboot I can still see the 32 limit being imposed, but the file still states 100. How can I force the OS to read from this file?

Advertisement

Answer

First, you need to understand why that number is 32. And that comes from the line below where MAXVIFS is defined:

typedef unsigned long vifbitmap_t;      /* User mode code depends on this lot */

On a 32bit machine (which is where this ancient crap started), that would a 32bit register. When you want a bitmap bigger than a register, things get messy. (see also: the FD_SET() macros) 64 is safe on a 64bit machine.

To increase the number of interfaces, you need to change both the userspace define (the file you changed) AND the define in the kernel (include/linux/mroute.h within the kernel source.) Then, rebuild your kernel and every userspace application that messes with multicast.

** Changing that define alters an ioctl data structure. **

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement