OS: CentOS 5.5 i386 Live CD (for testing purposes). Uses kernel 2.6.18-194.
I'm attempting to generate a boat-ton of connections (at least 100k) to a remote server. I wrote a script to do so (in erlang), it works fine. However, I run out of ephemeral ports and start getting address-in-use errors. I set my local port range to 1024-65535 (by echoing into /proc/sys/net/ipv4/ip_local_port_range), but that still maxes out at about 60k connections. From what I understand, opening up a new interface and giving it an ip address should work.
My problem is that I can't do so. Whenever I try I lose internet. Here's what usually happens:
Code:
[root@livecd ~]# curl --interface eth0 google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
[root@livecd ~]# /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:21:85:E5:0F:B6
inet addr:172.16.202.132 Bcast:172.16.202.255 Mask:255.255.255.0
inet6 addr: fe80::221:85ff:fee5:fb6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:434562 errors:0 dropped:0 overruns:0 frame:0
TX packets:916856 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:87592629 (83.5 MiB) TX bytes:65593430 (62.5 MiB)
Interrupt:90 Base address:0x4000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1556 errors:0 dropped:0 overruns:0 frame:0
TX packets:1556 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:128016 (125.0 KiB) TX bytes:128016 (125.0 KiB)
[root@livecd ~]# /sbin/ifconfig eth0:1 172.16.202.135
[root@livecd ~]# /sbin/ifconfig
eth0 Link encap:Ethernet HWaddr 00:21:85:E5:0F:B6
inet addr:172.16.202.132 Bcast:172.16.202.255 Mask:255.255.255.0
inet6 addr: fe80::221:85ff:fee5:fb6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:434623 errors:0 dropped:0 overruns:0 frame:0
TX packets:916900 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:87612074 (83.5 MiB) TX bytes:65596722 (62.5 MiB)
Interrupt:90 Base address:0x4000
eth0:1 Link encap:Ethernet HWaddr 00:21:85:E5:0F:B6
inet addr:172.16.202.135 Bcast:172.16.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:90 Base address:0x4000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1556 errors:0 dropped:0 overruns:0 frame:0
TX packets:1556 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:128016 (125.0 KiB) TX bytes:128016 (125.0 KiB)
[root@livecd ~]# curl --interface eth0 google.com
[root@livecd ~]# curl --interface eth0:1 google.com
[root@livecd ~]#
The first two commands show that I have internet and what my setup is. The third sets up a new interface (I think), and the last ones show the results (the two curl commands timeout).
Am I not setting up the connection correctly? I've tried doing it with the /etc/sysconfig/network-scripts files as well, but still no luck.