Static MAC Address for AWS Cluster Nodes

amazon-web-servicesethernetlinux-networkingnetworking

There are some scientific computations to be run. They use a software module, which license is tied to a MAC address.

On AWS I created ENI (Elastic Network Interface). I tie it to EC2 instances of my cluster every time I start it. No matter how many times I restart the cluster with the tied ENI its eth0 MAC address changes but eth1 MAC address does not change.

What is the difference between those two? Do you reckon it should be enough for the licensing purpose? What am I missing out?

Best Answer

What exactly are you doing? How many cluster nodes and how many extra ENIs have you got? How do you start them? Through Auto-Scaling group?

I can't reproduce your behaviour with a single instance with an extra ENI - regardless of how many times I stop/start or reboot it it retains the same MAC on both interfaces. Even if I detach and re-attach the secondary ENI it keeps the same MAC. And it should.

Think of Elastic Network Interface (ENI) as of a network card that you can plug into any of your instances in the availability zone. Since it's effectively a network card it's got its MAC address, private IP address and optionally an Elastic IP address (= Public IP). You can detach it from one instance and re-attach it to another instance and it will keep its MAC address. Such an extra ENI is usually the secondary one, e.g. eth1.

Depending on how you create and manage the actual instances they may or may not keep the primary interface MAC. If the instances are created just before you run your computations, each gets the static ENI attached and when done they are terminated they will have a different MAC address and IP address on the primary interface every time.

If on the other hand you created the instances once and then start them, do the computations and them stop (i.e. not terminate) them they will retain the same MAC address forever.

Anyway, the secondary ENI should retain its MAC address even if the instance is terminated and the ENI is re-attached to another instance. You should be able to use this secondary ENI's MAC address for licensing.

Hope that helps :)