Linux supports 100,000 IP addresses on one NIC

Today I wrote a quick little script (lots-of-ips.pl) to put a bunch of IP addresses on one network card. We started with 1000 IPs and Linux didn't even skip a beat. Next we tried 10,000 IP addrresses attached to eth0. It took about a minute and forty seconds to apply all those IPs. Next we wanted to really push the envelope and decided to try 100,000 IPs. We thought it wouldn't work after about an hour of 99.9% CPU usage, but linux never gave up. After one hour and forty minutes I got a bash prompt and was able to ping the 100,000th IP address just fine.

Why would one ever need even close to that many IP addresses on a single NIC? You probably never would, but it's cool to know that you can if you ever wanted to. I only did it to get the street cred.
Leave A Reply - 2 Replies
Replies
Chris 2005-03-30 04:17pm - No Email - Logged IP: 198.178.8.81

Is the NIC smoking or bursting into flames yet?

Stetson University 2005-05-05 06:15pm - No Email - Logged IP: 24.165.233.54

One legitimate purpose for a large number of IPs to one NIC would be to have a mega-web-server that hosted lots of different virtual sites/services. I am definitely a fan of terminal services, vnc, etc styled workstation layouts where many session instances are centralized to one physical host. Not only does it provide easier maintenance for admins, it also provides a greater level of security and peace of mind ;-). Keep up the hacking drive!

-Lorenzo

All content licensed under the Creative Commons License