How to assign MACs to OVH failover IPs (script included)

Any failover IP in OVH requires to be assigned to the given MAC, before that, you need to generate the MAC on the OVH client control panel.

If you only have several IPs, it's fine to do it in the panel, but in case you have a /24 block....

There are API methods from OVH official documents, here I'm just sharing a small trick, you can always choose to use the API requests

Firstly, you need to login into the OVH client control panel, then copy the cookies from your browser.

Secondly, you will need to know the server name as well as the IP subnet prefixes.

Finally, swap the info into the script below (in "{}")and run in any Linux servers.

for ipid in {1..255}
curl '{Your-Server-Name}/virtualMac'
-H 'authority:'
-H 'accept: application/json, text/plain, */*'
-H 'content-type: application/json;charset=UTF-8'
-H 'origin:'
-H 'referer:'
-H 'cookie: {Your-Browser-Cookies}'
--data-raw '{"ipAddress":"{Your-IP-Subnet-Prefixes}.'"$ipid"'","type":"ovh","virtualMachineName":"{Your-IP-Subnet-Prefix}.'"$ipid"'"}'
--compressed ;
sleep 30

Top News