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.


Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 3.135.198.49
To prevent spam please submit by clicking the kitten: