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 requirement where I have to run several cron jobs with specific IP in an EC2 instance. That specific IP is used by another EC2 instance. I have access to that EC2 instance.

Is there any possibility that I can make cron job to use that IP instead of the IP assigned to this instance?

share|improve this question
Why are you not running the cron job on the box with the IP address that is a requirement of the cron job? – Ladadadada Mar 22 '13 at 12:35
we can't because it will modify certain live data. – martin solomon Mar 23 '13 at 5:08
what are you using to connect to the other machine? – Mike Mar 28 '13 at 9:16

Outgoing connections from the instance will always use the address of the "main" interface, almost always eth0. To make your cron jobs connect from a different IP address the program you run from cron must have an option to specify the source address. There's no way for cron itself to do this so if the program does not have this functionality you're SOL..

share|improve this answer

Your Answer


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.