Where are the network configuration files?

Somehow an incorrect gateway got into my settings, and I can’t change it permanently. Attaching a monitor is difficult so I run the nano headless and need to know the files that I can access via the command line.

I know that the gateway is wrong through

ip route show

I can change the default gateway through

ip route add default xxxx

which works fine until I reboot, but then it is overwritten. I’ve read the Ubuntu documentation, but

/etc/network/interfaces is empty
/etc/netplan does not exist

So there is another file somewhere that takes priority.

Can someone tell me where this file is?

Hi, xtz465

Could you try the followed way:

Add this line in the end of file /etc/network/interfaces

up route add -net xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx gw xxx.xxx.xxx.xxx eth0

As noted above, the interfaces file is empty, so there is nothing to add to.

I finally broke down and temporarily attached a keyboard, mouse and monitor to the nano, used the Network interface app and corrected the faulty gateway. It all works fine now.

So there is clearly a file that the Network interface app writes to that does not get overwritten, and it is neither of the standard Ubuntu methods: /etc/network/interfaces or the netplan folder. There is no documentation for this.

That’s odd. Mine sources interfaces.d, which I’m pretty certain is the default. From what I’ve been able to tell the modifications to stock Ubuntu are pretty minimal.

manpage:
http://manpages.ubuntu.com/manpages/trusty/man5/interfaces.5.html

walkthrough for gui and /etc/network/interfaces

Those should help you with manually specifying a gateway.

I checked, and the interfaces.d directory is empty as well.

As noted above, I fixed the problem by using the gnome interface with a monitor connected temporarily, but that doesn’t answer the question as to where the information is actually stored. I’m hoping I won’t need it.

Whenever I see a “standard” configuration file on a Linux system that’s actually empty, that tells me that the system as set up is using something else as the source for configuration data.

All of the Ubuntu documentation I’ve consulted (including the links above) point to files and directories that have no content on my Jetson nano as imaged. Only the GUI works, and it must use some other files.

Can you send a screenshot of the utility you used? Have you checked it’s documentation?

I haven’t used the utility you used. Usually I just put something in /etc/network/interfaces.d and it works. You say there is no /etc/network/interfaces. That is odd. I just checked the stock rootfs and it’s there, and on my live Tegra.

This may work for you to recreate those files and override your gateway:

first do this:

 $ cd /etc/network/interfaces.d/
 $ sudo touch eth0

(and then using your favorite text editor, whether gedit, nano, vi, emacs, etc,
using “sudo your_text_editor eth0”), type this in and save it:

auto eth0
iface eth0 inet dhcp
	up route del default eth0
	up route add default gw (your gateway ip address) eth0

edit: fix to above

You might also take a look at your dhcp server to see what’s causing that. It sounds like you have a configuration issue or a second dhcp server

As long as there is an /etc/network/interfaces file and it sources /etc/network/interfaces.d it should work. /etc/network/interfaces should look like this:

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

by default.

You may have to create it (sudo touch /etc/network/interfaces) and edit it (sudo your_text_editor /etc/network/interfaces) so it sources /etc/network/interfaces.d since it appears this has been modified on your system somehow

1 Like

I don’t know how to attach a screenshot in this forum, but it’s the gnome utility:

Under the Systems Settings icon, click Network, then the iPv4 settings tab. It’s much easier to set it this way, IF you have a monitor attached, and the settings are stored in some as-yet-unknown place where the OS looks at boot time.

It should look like this, with a slightly different theme:

That’s actually a frontend for NetworkManager (manpage). (settings found in /etc/NetworkManager)

Per the manual “NetworkManager does not manage any interface defined in /etc/network/interfaces by default”

I have checked both my Ubuntu machine and my L4t machine and the files are both there. Settings should be saved, but I’ve noticed it has some bugs, such as this one I just had where settings won’t apply. It should be saving settings. If it isn’t, that sounds like a bug in either NetworkManager or gnome-control-center.

Again, I would recommend just managing /etc/network/interfaces as these things tend not to happen as often. It could be the complete lack of any /etc/network/interfaces is part of the problem. If those files are missing, other things in /etc/ might be as well. I will reflash my nano with a stock image later and test. In the mean time you could try “nmtui” or “nmcli” (alternative NetworkManager frontends) to see if they work. If they don’t, then the problem is very like NetworkManager related. If they do, it’s more likely the gnome-control-center network panel.

Thanks for your careful investigations I will keep these for reference. In the meantime, the settings I made in the gnome interface have survived several reboots (and whether II have a GUI session or just ssh in), so they are safely stored somewhere, just not in the usual Ubuntu places!

Is there anything in /etc/NetworkManager/system-connections for you?

“Is there anything in /etc/NetworkManager/system-connections for you?”

I checked, and yes, that’s where the information is stored!

I’m happy to close this out.

1 Like

Glad you found the files. FYI, They are not meant to be edited directly. There are various NetworkManager frontends for that, some mentioned above.

1 Like

In case anyone else comes across this thread looking for answers, there is one other place where Jetson Nanos store networking config. The l4tbr0 configuration, used for the USB network interface, comes from scripts under /opt/nvidia/l4t-usb-device-mode (which it does mention in the readme file) and that includes a default gateway setting net_ipv4_defroute_router=192.168.55.100 in the l4t-usb-device-mode-config.sh file.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.