Cron Jobs with different IPs linked to the user


enp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000

link/ether xx:xx:xx:xx:xx:17 brd ff:ff:ff:ff:ff:ff

inet brd scope global noprefixroute enp4s0

inet brd scope global secondary enp4s0

I have 2 white external IPs, 2 websites, two virtual servers are already working with different external IPs

enp4s0 - - external –

enp4s0:0 - - external –

I run Cron Jobs from any user, for example:

exec( ‘curl; echo’ );

I get the same external ip with different users

Is it possible to have different external IPs when running Cron Jobs from a virtual server user?

That’s not a Virtualmin question. That’s a routing question, and one I don’t have a simple answer for; it’s very unusual to route based on user.

The network layer doesn’t have the information you’d need to route based on user; packets in IP don’t have a “user” field. But, you may be able to do it with namespaces? sockets - How to use Linux Network Namespaces for per processes routing? - Stack Overflow

But, I think you probably want to solve your problem (whatever problem it is you’re trying to solve with these cronjobs) via some other method.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.