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 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
1  
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
add comment

1 Answer 1

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
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.