Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am running an Ubuntu server having 255 IP addresses. I want to write down a PHP script that uses each IP to do a curl request. Is this possible ?

share|improve this question
    
late but why do you have a /24 on 1 Server??? –  Jacob Feb 13 '11 at 23:12
add comment

1 Answer

up vote 4 down vote accepted

Depends on the nature of the networking as far as your server is concerned, and what it would be connecting to.

In most cases, you'll lose two addresses out of a full 256 octet - one for the network address (192.168.21.0) and one for the broadcast address (192.168.21.255). Remember that you'll also need a router in the same local subnet (192.168.21.1), so you're down to 253. (Assuming this is a CIDR/24 network).

Curl has a --interface option - you can use this to specify which IP your request is coming from; you may want to consider writing in this in perl or something not web-oriented - might make it a bit easier.

Here's hoping you're not stuffing ballot boxes.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.