Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Ubuntu server with 128 ip's (static external ips 86.xx.xx.16), and I want to crawl pages thru different ip's. The gateway is, the main ip is, and the other 128 ip's are I tried this configuration in /etc/network/interfaces but I doesn't work. It work if I remove the gateway for the aliases eth0:0 and eth0:1. I think this is routing problem.

auto lo
iface lo inet loopback

auto eth0
auto eth0:0
auto eth0:1

iface eth0 inet static

iface eth0:0 inet static

iface eth0:1 inet static

Also, please tell me how to "reset" every changes that I made in networking and routing.

I removed the gateway and now it works. I can reach the website thru all 128 ip's.

But when I try to bind a socket connection in php to a specific ip I get no answer.

socket_bind($sock, "");
socket_connect($sock, '', 80);

I tryed to use a sniffer to see the packets, and I see the packet sent from binded ip to but the "connection" can't be established.

I don't know anything about "route" command, but I have a feeling that this is the solution.

share|improve this question

It doesn't work because it's only one interface and one gateway... unless you want to do some thraffic sharing/balancing/... there should be just ONE default gateway.

What you want is BINDING whatever program you use to "crawl the web" to the wanted ip address.

just keep the gateway on eth0 and remove it from eth0:X and you should be good...

share|improve this answer
Yep that is good. But how to bind a program to wanted ip? – Andrew Mar 19 '10 at 10:40

The problem is solved. My ISP rerouted the IPs and now works.

share|improve this answer

Just edit your question when you have a update, unless that update is actually an answer. You should delete this answer. I moved it to the question for you.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.