This project contains three scripts that enable you to easily and programmatically generate vMAC (virtualMac) addresses for all IP addresses in a certain range with OVH.
- Node.js >= 4.0.0
- Obtain Node.js 4.0.0 or above and NPM
- Clone this repo
cd
to the ovh-mac-generator directorynpm install
- Create an OVH application In the US / In Europe - other options available here
cp config.js.example config.js
- Put the
APP_KEY
andAPP_SECRET
in the appropriate spots in config.js. Possible endpoints can be found here - the service name is the name of your server available in the OVH control panel. node authorize.js
. You will see something like this:
Success!
Please do the following:
1. Take the consumerKey and add it to config.js
2. Visit the validationUrl and authorize this application
3. Run node IP_RANGE=$YOURNETWORKRANGE generator.js
{ validationUrl: 'https://ca.api.ovh.com/auth/?credentialToken=sloth',
consumerKey: 'turtle',
state: 'pendingValidation' }
IP_RANGE=1.1.1.1/24 node generator.js
- substitute your IP range using CIDR notation. This will take a while to run, once it stops proceed on to the last step.node listgen.js <ovh-ca|ovh-eu> <ns1234.ip-1-2-3.net> <1.2.3.4/5>
- This will take a minute or so depending on how many IPs you have total, once it is done you will get a list of IP addresses and vMACs.- You should be done. If you are Virtkick user you can copy and paste the list right into the OVH mapping box to set up your new range in the Virtkick panel.