Set IP Address on boot

Hoping someone can help me with this one. I have a Jetson Nano image that I need to replicate and distribute to multiple nanos. Unfortunately I also have to use a static IP address for these units.

I set the IP address for eth0 to the desired static IP on the original Nano, but when I boot the image on different nano it brings up eth1 with DHCP, I believe due to a different MAC address on the new hardware. Is there a way for me to configure either a startup script or first boot script to correctly identify and set the ip address on the new Nano?

What files do you see in “/etc/udev/rules.d/”? It is very likely the rule you created is bound to a MAC address, and each Jetson has a different MAC. If MAC is bound, then this is very likely to show up in a related udev rule. Write down the MAC address of the working unit, and see if it shows up in one of those files.

Thanks for the clue, but it doesn’t seem I have a udev rule setup for the device.

nano@nano:/etc/udev/rules.d$ ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet  netmask  broadcast
        inet6 fe80::564:21ed:c90b:eaed  prefixlen 64  scopeid 0x20<link>
        ether 00:04:4b:e7:60:54  txqueuelen 1000  (Ethernet)
        RX packets 991980  bytes 1445285893 (1.4 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 736  bytes 116244 (116.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 150  base 0xe000

nano@nano:/etc/udev/rules.d$ grep "00:04:4b:e7:60:54" ./*

Any other thoughts?

This is the incorrect grep due to representing MAC in more than one format. For example, the “:” might not be there, or might instead by some alternate character like a hyphen. You’ll need to look at the name of the files for the first clue to see if this is related to the topic. Then examine the content of the file (they are all human readable plain text).

sudo egrep -i "00.04.4b.e7.60.54" /etc/udev/*
(this is a case insensitive extended regular expression with the “.” being a wildcard for any character which can optionally be missing)