After flashing my Jetson Orin Nano Developerkit with a minimal root filesystem, I couldn’t establish a network connection or access SSH through Ethernet. To resolve this, I added a DHCP client service to the rootfs before flashing, which worked initially, and I was able to access SSH.
However, after a couple of days, I lose SSH access again, even though the Ethernet cable is still connected. Restarting the device restores the connection.
Here’s the function I used to set up the DHCP service during the flashing and this function is included in the flashing script:
# Function to setup DHCP service
setup_dhcp_service() {
# Create systemd directory if it doesn't exist
mkdir -p Linux_for_Tegra/rootfs/etc/systemd/system/
# Create the service file
cat > Linux_for_Tegra/rootfs/etc/systemd/system/dhclient-eth0.service << 'EOF'
[Unit]
Description=Obtain IP address for eth0
After=network.target
[Service]
ExecStart=/sbin/dhclient eth0
[Install]
WantedBy=multi-user.target
EOF
# Set proper permissions
chmod 644 Linux_for_Tegra/rootfs/etc/systemd/system/dhclient-eth0.service
# Create directory for symlinks if it doesn't exist
mkdir -p Linux_for_Tegra/rootfs/etc/systemd/system/multi-user.target.wants/
# Create symlink to enable the service
ln -sf /etc/systemd/system/dhclient-eth0.service \
Linux_for_Tegra/rootfs/etc/systemd/system/multi-user.target.wants/dhclient-eth0.service
}
Why does SSH access drop after a few days, and why does restarting the device restore the connection? Could there be an issue with the DHCP setup or other configuration?