jetson nano cloning and deployment of the image to other devices

my main problem is, the router identifies both of them as the same device, which creates weirdness, they get the same IP and so on…

I tried using either macchanger or manually changing it in /etc/network/interfaces
but whenever I reboot the device, it resets to the old mac.

How do I make this change persistent through reboots?

Now that is some wierdness I will try to replicate when I get home. Can you describe steps, beginning to end to do so?

you might be misunderstanding me. I did not change them to the same MAC.
I have two jetsons which tell me they have the same NIC mac address.
I’m trying to circumvent that to get them different MAC addresses, but they keep reverting to the same one on reboot.

I understood. You shouldn’t have to circumvent. I will investigate when I get home in an hour or so.

Can you describe your process, beginning with your initial flags to the clone. Everything you did to the image?

Contents of /etc/network/interfaces and anything in the interfaces.d folder?

Output of systemctl list-unit-files | grep enabled?

I will try to see if I can replicate with what I have when I get home

The process was the following:

  • set up nano A with SD Card A
  • check mac address on nano A (using “ifconfig | grep ether” or “macchanger --show eth0”)
  • take sd card A and read to .img using Win32DiskImager [READ] button
  • write .img to SD card B using [WRITE] button
  • boot nano B using SD card B
  • Change username and hostname on nano B to avoid conflicts
  • re-generate ssh host keys on nano B
  • check mac address on nano B (using “ifconfig | grep ether” or “macchanger --show eth0”)
  • Both MACs are the same
  • Weirdness ensues when both of them have been connected to the router (even if only one at once)

Weirdness includes:

  • Router says only A is connected when both are connected

  • Router says A is connected when only B is connected

  • Router says A is connected when nothing is connected

  • SSH using either the ip or hostname of either A or B results in hitting one of them at random, or nothing at all. Disconnects also happen frequently.

  • try to set mac to hardware address using “macchanger -p eth0” → They’re the same.

  • try to set mac to different address using “macchanger -a -e eth0”

  • Router says A and B are both connected to LAN Port 1 (physically impossible)

  • Reboot B → Both have the same MAC again.

  • More Weirdness

/etc/network/interfaces is empty except for the loading of /etc/network/interfaces.d which is also empty.

heimdall@bifrost:~$ systemctl list-unit-files | grep enabled
apport-autoreport.path                     enabled
resolvconf-pull-resolved.path              enabled
accounts-daemon.service                    enabled
anacron.service                            enabled
apparmor.service                           enabled
autovt@.service                            enabled
avahi-daemon.service                       enabled
bluetooth.service                          enabled
console-setup.service                      enabled
cron.service                               enabled
dbus-fi.w1.wpa_supplicant1.service         enabled
dbus-org.bluez.service                     enabled
dbus-org.freedesktop.Avahi.service         enabled
dbus-org.freedesktop.ModemManager1.service enabled
dbus-org.freedesktop.nm-dispatcher.service enabled
dbus-org.freedesktop.resolve1.service      enabled
dns-clean.service                          enabled
getty@.service                             enabled
haveged.service                            enabled
kerneloops.service                         enabled
keyboard-setup.service                     enabled
ModemManager.service                       enabled
network-manager.service                    enabled
networkd-dispatcher.service                enabled
networking.service                         enabled
NetworkManager-dispatcher.service          enabled
NetworkManager.service                     enabled
nv-l4t-usb-device-mode.service             enabled
nv.service                                 enabled
nvargus-daemon.service                     enabled
nvfb-early.service                         enabled
nvfb.service                               enabled
nvphs.service                              enabled
nvpmodel.service                           enabled
nvs-service.service                        enabled
portmap.service                            enabled
pppd-dns.service                           enabled
resolvconf.service                         enabled
rpcbind.service                            enabled
rsyslog.service                            enabled
setvtrgb.service                           enabled
snapd.autoimport.service                   enabled
snapd.core-fixup.service                   enabled
snapd.seeded.service                       enabled
snapd.service                              enabled
snapd.system-shutdown.service              enabled
spice-vdagent.service                      enabled
spice-vdagentd.service                     enabled
ssh.service                                enabled
sshd.service                               enabled
syslog.service                             enabled
systemd-fsck-root.service                  enabled-runtime
systemd-resolved.service                   enabled
systemd-timesyncd.service                  enabled
udisks2.service                            enabled
unattended-upgrades.service                enabled
whoopsie.service                           enabled
wpa_supplicant.service                     enabled
apport-forward.socket                      enabled
avahi-daemon.socket                        enabled
gpsd.socket                                enabled
rpcbind.socket                             enabled
snapd.socket                               enabled
nfs-client.target                          enabled
remote-fs.target                           enabled
anacron.timer                              enabled
apt-daily-upgrade.timer                    enabled
apt-daily.timer                            enabled
fstrim.timer                               enabled
motd-news.timer                            enabled
snapd.snap-repair.timer                    enabled

/etc/network/interfaces and the .d is empty on my nano.

differences in our services

$ diff myservices pyrestoneservices

1,52c1,51
< apport-autoreport.path                     enabled        
< resolvconf-pull-resolved.path              enabled        
< accounts-daemon.service                    enabled        
< anacron.service                            enabled        
< apparmor.service                           enabled        
< autovt@.service                            enabled        
< avahi-daemon.service                       enabled        
< bluetooth.service                          enabled        
< console-setup.service                      enabled        
< containerd.service                         enabled        
< cron.service                               enabled        
< dbus-fi.w1.wpa_supplicant1.service         enabled        
< dbus-org.bluez.service                     enabled        
< dbus-org.freedesktop.Avahi.service         enabled        
< dbus-org.freedesktop.ModemManager1.service enabled        
< dbus-org.freedesktop.nm-dispatcher.service enabled        
< dbus-org.freedesktop.resolve1.service      enabled        
< dns-clean.service                          enabled        
< getty@.service                             enabled        
< haveged.service                            enabled        
< kerneloops.service                         enabled        
< keyboard-setup.service                     enabled        
< ModemManager.service                       enabled        
< network-manager.service                    enabled        
< networkd-dispatcher.service                enabled        
< networking.service                         enabled        
< NetworkManager-dispatcher.service          enabled        
< NetworkManager.service                     enabled        
< nv-l4t-usb-device-mode.service             enabled        
< nv.service                                 enabled        
< nvargus-daemon.service                     enabled        
< nvfb-early.service                         enabled        
< nvfb.service                               enabled        
< nvphs.service                              enabled        
< nvpmodel.service                           enabled        
< nvs-service.service                        enabled        
< portmap.service                            enabled        
< pppd-dns.service                           enabled        
< resolvconf.service                         enabled        
< rpcbind.service                            enabled        
< rsyslog.service                            enabled        
< setvtrgb.service                           enabled        
< snapd.autoimport.service                   enabled        
< snapd.core-fixup.service                   enabled        
< snapd.seeded.service                       enabled        
< snapd.service                              enabled        
< snapd.system-shutdown.service              enabled        
< spice-vdagent.service                      enabled        
< spice-vdagentd.service                     enabled        
< ssh.service                                enabled        
< sshd.service                               enabled        
< syslog.service                             enabled        
---
> apport-autoreport.path                     enabled
> resolvconf-pull-resolved.path              enabled
> accounts-daemon.service                    enabled
> anacron.service                            enabled
> apparmor.service                           enabled
> autovt@.service                            enabled
> avahi-daemon.service                       enabled
> bluetooth.service                          enabled
> console-setup.service                      enabled
> cron.service                               enabled
> dbus-fi.w1.wpa_supplicant1.service         enabled
> dbus-org.bluez.service                     enabled
> dbus-org.freedesktop.Avahi.service         enabled
> dbus-org.freedesktop.ModemManager1.service enabled
> dbus-org.freedesktop.nm-dispatcher.service enabled
> dbus-org.freedesktop.resolve1.service      enabled
> dns-clean.service                          enabled
> getty@.service                             enabled
> haveged.service                            enabled
> kerneloops.service                         enabled
> keyboard-setup.service                     enabled
> ModemManager.service                       enabled
> network-manager.service                    enabled
> networkd-dispatcher.service                enabled
> networking.service                         enabled
> NetworkManager-dispatcher.service          enabled
> NetworkManager.service                     enabled
> nv-l4t-usb-device-mode.service             enabled
> nv.service                                 enabled
> nvargus-daemon.service                     enabled
> nvfb-early.service                         enabled
> nvfb.service                               enabled
> nvphs.service                              enabled
> nvpmodel.service                           enabled
> nvs-service.service                        enabled
> portmap.service                            enabled
> pppd-dns.service                           enabled
> resolvconf.service                         enabled
> rpcbind.service                            enabled
> rsyslog.service                            enabled
> setvtrgb.service                           enabled
> snapd.autoimport.service                   enabled
> snapd.core-fixup.service                   enabled
> snapd.seeded.service                       enabled
> snapd.service                              enabled
> snapd.system-shutdown.service              enabled
> spice-vdagent.service                      enabled
> spice-vdagentd.service                     enabled
> ssh.service                                enabled
> sshd.service                               enabled
> syslog.service                             enabled
54,74c53,71
< systemd-resolved.service                   enabled        
< systemd-timesyncd.service                  enabled        
< ubuntu-fan.service                         enabled        
< udisks2.service                            enabled        
< unattended-upgrades.service                enabled        
< whoopsie.service                           enabled        
< wpa_supplicant.service                     enabled        
< apport-forward.socket                      enabled        
< avahi-daemon.socket                        enabled        
< docker.socket                              enabled        
< gpsd.socket                                enabled        
< rpcbind.socket                             enabled        
< snapd.socket                               enabled        
< nfs-client.target                          enabled        
< remote-fs.target                           enabled        
< anacron.timer                              enabled        
< apt-daily-upgrade.timer                    enabled        
< apt-daily.timer                            enabled        
< fstrim.timer                               enabled        
< motd-news.timer                            enabled        
< snapd.snap-repair.timer                    enabled      
---
> systemd-resolved.service                   enabled
> systemd-timesyncd.service                  enabled
> udisks2.service                            enabled
> unattended-upgrades.service                enabled
> whoopsie.service                           enabled
> wpa_supplicant.service                     enabled
> apport-forward.socket                      enabled
> avahi-daemon.socket                        enabled
> gpsd.socket                                enabled
> rpcbind.socket                             enabled
> snapd.socket                               enabled
> nfs-client.target                          enabled
> remote-fs.target                           enabled
> anacron.timer                              enabled
> apt-daily-upgrade.timer                    enabled
> apt-daily.timer                            enabled
> fstrim.timer                               enabled
> motd-news.timer                            enabled
> snapd.snap-repair.timer                    enabled

Mind you this is an image I built using create-jetson-nano-sd-card-image.sh and the services might not be the same. Creating an image that way, with a customized rootfs, kernel, etc, worked perfectly. It calls flash.sh with the proper parameters to create a customized image you can flash onto any sized sd card that will run all the proper first boot scripts. I was able to get the firewall fully functional. If you search the forum for ‘broken firewall on nano’ you should be able to find it the procedures I followed in detail.

If you want to customize things, that’s the documented (in l4t docs), recommended, way to do it. As I mentioned earlier in the thread, cloning a system like this is destined to have problems like this because once you boot a system the first time, all sorts of things you really can’t predict happen, and that’s only compounded by Nvidia’s modifications to the system and the board being brand new. Cloning a rootfs with all those modificaitons will likely have unpredictable side effects with all these modifications baked in.

Unfortunately I have no second nano to test with, but somebody with two (eg, Nvidia) might be able to follow your instrucitons and replicate. It appears, based on what you are describing, the mac address is being stored somewhere on the sd card and that really shouldn’t happen. Probably your easiest mitigation from here is to try to get macchangeer working and set a new mac on every boot (but you were already trying that). If you googel ‘change mac address linux bridge’ you should be able to find instructions on how to do it manually if that fails somehow.

Macchanger sucesssfully can change on my nano.

someuser@somenano:/etc/network/interfaces.d$ macchanger --show eth0
Current MAC:   00:18:7e:e3:f7:e9 (RGB Spectrum)
Permanent MAC: [redacted] (REALTEK SEMICONDUCTOR CORP.)

… but it doesn’t stick on a reboot. Something may be broken or you may have to set up a unit file to do the task on every boot before networking comes up. I’m not familiar enough with macchanger to say which. On installation it did seem to specify that it would activate on every interface up and it’s not doing that.

The mac address may be set by bootloader from EEPROM being fused at prod time, AFAIK for TX1/TX2.

Someone from NVIDIA may tell where to find the nano’s EEPROM layout, how to check its contents and how to adjust it in case it cannot be read and set correctly.

Do I need to flash the new sdcard or just dd previous image on new sd card and plug it in?

Just dd /dev/oldcard to /dev/newcard, making sure not to accidentally mix up the order (and to read/write to the root of the block device, eg. /dev/sda rather than /dev/sda1). Gnome-disks probably makes this safer, but I think you have to write to an intermediary .img. You don’t need to do anything to a target card like format it. Writing the image will overwrite anything on a target device.

Okay, I’ve gone and re-installed a brand new image on my second Nano.

They still have the same MAC address.
I’m thinking this might be an actual hardware isssue, where both of the NICs have the same MAC.

I don’t want to RMA one of them because of this nonsense, but I don’t know how to fix such a low-level flaw.

the short term solution
is to open nm-connections-editor and manually adjust the MAC address value.
the long term solution, in my opinion, is to makesparse && flash.sh -r , or you could reinstall OS with sdk manager

I didn’t know you could do that with network manager, but here are some nore details on that suggestion here (for wifi at least):

That seems a really nice solution. Maybe the Jetson really is the same as the Tx1/tx2 ant they all have the same mac address out the factory before you flash.

https://devtalk.nvidia.com/default/topic/1052070/jetson-nano/jetson-nano-cloning-and-deployment-of-the-image-to-other-devices/post/5348639/#5348639

Now where to find the documentation to change the Mac address for nano. I am betting it’s well hidden given no Nvidia rep has posted it yet.

It would certainly be funny if all the Mac addresses are the same and it was an accident. I will post the last two digits of mine when I’m back at my nano.

It’s apparently a lot easier than I remember to change the Mac address. Please see “surviving a reboot” option here, under Ubuntu:

https://en.wikibooks.org/wiki/Changing_Your_MAC_Address/Linux

But network manager is even easier than that and does the same thing.

I tried both network manager and /etc/network/interfaces before, but neither of them worked for me.

You can try bridging one real interface to a virtual one and changing the Mac of the virtual interface. The issue is I don’t know if it will work in cases of actual Mac address conflicts. You can try. I will dig up instructions when I get home. I’m on mobile atm.

I ssh’ed into my Nano.

Does your permanant MAC of eth0 end with d5?

I started a new thread asking about the mac addresses, and whether they are all the same or not. According to moderator WayneWWW (in another thread on the TX1 forum), TX1 at least should have a unique MAC.

So I just tested it on nano. It works for me. My /etc/network/interfaces is now:

# interfaces(5) file used by ifup(8) and ifdown(8)
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto eth0
allow-hotplug eth0
iface eth0 inet dhcp
        hwaddress ether 02:01:02:03:04:08

You can put the eth0 stuff in a separate file called eth0 in /etc/network/interfaces.d if you wish as well.

So it works, survives a reboot, etc. I think you may have had an error in your configuration. I’d still like to know why your hardware addresses are conflicting in the first place.