-1

I have few computers each with same ethernet MAC address. I want to change ethernet MAC address on each computer as soon as network card is detected so I do not have any conflicts in the network. My system is using nonstandard linux with systemd. Is it possible to configure MAC address using systemd and standard linux commands?

  • 1
    Configure a static IP of your own in /etc/network/interface! – Thushi Jun 6 '17 at 9:33
  • @Thushi I was talking about mac address. IP address is taken from dhcp. – Trismegistos Jun 6 '17 at 9:56
  • @Trismegistos, probably easiest to tie it to the distro's interface configuration scripts, and there might already be a system for doing that. Unless you really definitely want to do it manually, of course. – ilkkachu Jun 6 '17 at 11:20
  • @Trismegistos: Ok, If that's the case please do mention it clearly in your question, one will think of IP address when you just mention ethernet address. Check adding udev rules. – Thushi Jun 6 '17 at 13:01
  • @Thushi ethernet address is MAC it never been IP. IP protocol is hardware agnostic. Those are different OSI layers. – Trismegistos Jun 6 '17 at 14:46
0

Use the config line HWADDR=AA:BB:CC:DD:EE:FF in the machine's /etc/sysconfig/network-scripts/ifcfg-eth0 config file, as such:

DEVICE=eth0
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
NM_CONTROLLED=no
HWADDR=AA:BB:CC:DD:EE:FF
IPADDR=10.2.3.4
NETMASK=255.255.255.0
GATEWAY=10.2.3.254
DNS1=8.8.8.8
DNS2=4.4.4.4
USERCTL=no
  • I meant MAC address not IP address. IP address is taken from DHCP and for that I need unique MAC address. Moreover there is not /etc/sysconfig on my computer. Linux distribution device runs is not standard one. I wanted to use systemd for that because it configures devices. – Trismegistos Jun 6 '17 at 9:57
  • This is for RHEL. Which Linux distro are you using? – dr01 Jun 6 '17 at 10:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.