Change 'Cloned MAC address' in 'Network Connections' from command line?? SOLVED

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
linx255
Level 5
Level 5
Posts: 668
Joined: Mon Mar 17, 2014 12:43 am

Change 'Cloned MAC address' in 'Network Connections' from command line?? SOLVED

Post by linx255 »

Linux Mint 18 Sarah, 4.15.0-34-generic

I've tried changing my MAC address using macchanger and ifconfig methods but neither of these will reflect changes on my eth0 connection in Network Connections.

Here are the exact commands I used which failed ( used actual addresses and not X's ), which I got from a link on another Mint forum post:

Code: Select all

sudo macchanger -m XX:XX:XX:XX:XX:XX eth0

Code: Select all

sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether XX:XX:XX:XX:XX:XX
sudo ifconfig eth0 up
What is the proper command line method for changing the 'Cloned MAC address' so that the Network Connections connection will reflect the changes?

Or if this is something I can read up on myself please point to a resource; I'm having trouble locating information pertaining to how the connections in Network Connections are stored and changed in the file system. Or if I'm in over my head and I don't know what I'm talking about what should be my starting point?

Thank you.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
- I'm running Mint 18 Mate 64-bit
- 4.15.0-34-generic x86_64
- All my bash scripts begin with #!/bin/bash
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: Change 'Cloned MAC address' in 'Network Connections' from command line??

Post by rene »

Connections are on Mint (by default) managed by NetworkManager; you can use its command line tool nmcli for your purpose. Identify your connection name (or UUID) from the output of nmcli connection show and use

Code: Select all

$ nmcli connection down "The connection name"
$ nmcli connection modify "The connection name" ethernet.cloned-mac-address XX:XX:XX:XX:XX:XX
$ nmcli connection up "The connection name"
C.f. man nm-settings together with man nmcli for information on what's available.
User avatar
linx255
Level 5
Level 5
Posts: 668
Joined: Mon Mar 17, 2014 12:43 am

Re: Change 'Cloned MAC address' in 'Network Connections' from command line??

Post by linx255 »

Thanks, exactly what I needed! :)
- I'm running Mint 18 Mate 64-bit
- 4.15.0-34-generic x86_64
- All my bash scripts begin with #!/bin/bash
Locked

Return to “Networking”