SOLVED Running Cron Job with Dedicated IP Address

WMisiedjan

Registered
Mar 6, 2018
4
1
3
Netherlands
cPanel Access Level
Root Administrator
Dear CPanellers,

I have a VPS running WHM and cPanel with multiple accounts, I have bought a secondary IP address for a dedicated account. Let's call this account for this purpose account X.

On account X I want to run a PHP cronjob that runs twice daily FROM that specific IP address, I've been searching for hours and I haven't found a solution.

Anyone any tips or advice on how to achieve this?

Kind Regards,
Wendell Misiedjan
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello,

Can you elaborate on the specific action you are attempting to perform via a cron job? For instance, do you mean you want the outgoing IP address to show as the dedicated IP?

Thank you.
 

WMisiedjan

Registered
Mar 6, 2018
4
1
3
Netherlands
cPanel Access Level
Root Administrator
Hello,

Can you elaborate on the specific action you are attempting to perform via a cron job? For instance, do you mean you want the outgoing IP address to show as the dedicated IP?

Thank you.
Yes, so whatever the cron job is preforming should have an outgoing IP address of the dedicated IP address assigned to it, this doesn't seem to be the case right now.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello,

It's normal for outgoing connections to come from the default public IP address of the server. Assigning an account a dedicated IP address will not change this behavior. You may need to consult with a system administrator to see if any custom network configurations are possible for the behavior you are seeking, as I'm not aware of any easily configurable settings you could alter to make it work.

Thank you.
 

WMisiedjan

Registered
Mar 6, 2018
4
1
3
Netherlands
cPanel Access Level
Root Administrator
For the people finding this and wanting to do this for a PHP script that is using cURL, you can set your actually set the current option in cURL;

```CURLOPT_INTERFACE = xxx.xxx.xxx.xxx```

where xxx's are the IP adres you want to use.
 
  • Like
Reactions: cPanelMichael