Static IP on TX2

Wanted the ip to be static so gave this forum accepted answer a go (with my own gateway settings);
https://devtalk.nvidia.com/default/topic/988803/jetson-tx1/how-to-set-tx1-to-use-static-ip-on-ethernet-port/1

Afterwards the ip was static, and remained to be, however it then wouldnt connect to the internet. I could connect via a local ssh but not to google etc which gave me a DNS server error.

I thought this was a router setting and so I set the ip address to be static through the router via the mac address, and the problem still persisted. Once I deleted the file changes, but kept the router settings, it then worked with outside connections, and provided a method for a static ip (although not preferable).

Anyone had similar experiences or is this actually a router/internet setting I have missed?

In file /etc/network/interfaces.d/eth0 you may try to add

dns-nameservers 8.8.8.8

Nope, same issue.

What is in “/etc/resolv.conf”? If you set up by DHCP, then this file is filled in by DHCP. If set up as static, then you must manually enter the DNS server information. The trick is whether what you put in that file is going to be deleted at reboot or not…you can manually edit this file.

In some cases the file content is for a local DNS mechanism which forwards requests to the gateway to use its DNS service, or else must be pointed directly at the DNS servers. On one of my R28.1 static IP systems I have this which works because my Linux PC it goes through is set up to allow DNS passthrough (my PC is a proxy for DNS and other traffic…firewall rules on the PC had to be opened to allow this, but I’m using two separate ethernet adapters so this is not difficult):

# Generated by NetworkManager
nameserver 127.0.1.1

As an experiment you could first try saving a backup of your existing “/etc/resolv.conf”, and then fill it with free DNS servers:

nameserver 192.95.54.1
nameserver 23.94.5.133
nameserver 45.76.27.27

My desktop PC Linux is serving as router and is set to forward DNS. The nature of whether your Jetson goes through a router appliance or to a Linux PC acting as bridge is important…would you please describe your wiring tree between Jetson, PC, and any routers?

Ok thats interesting and i will try giving that a go.

It is currently set up with the Jetsons plugged directly into the router via Ethernet, and any separate pcs connect by SSH, which are connected to the router via wireless.

Tried editing that file with those inputs, but as you say it deletes the content on startup and leaves only an empty file. The “generated” part isn’t even filled in.

Under DHCP your router should be providing DNS information for NetworkManager to use to fill in “/etc/resolv.conf”. If the router itself does not have that information, then I am unsure of how NetworkManager would fill in that file. I do suspect it would fall back to the 127.0.1.1 address, but I am only guessing. Even so something should be put into the file even if it is just a comment.

With wired ethernet and DHCP it is unlikely the file would fail to fill in something if only wired is used…my suspicion is that NetworkManager is trying to use WiFi, and that a lack of WiFi (when it wants to be WiFi) is why the file is not filled in. I really despise NetworkManager, but documents on the internet for Ubuntu administration will apply directly to this without the Jetson being any different from other Linux hardware, so researching this does not need to be limited to Jetson docs (unfortunately it may require researching NetworkManager).

If you run the GUI “nm-connection-editor” does WiFi show up? Or just wired? Is it correct that you are trying to enable only wired? If you temporarily edit the resolv.conf file does it work for that session (until reboot)?

With the changes to interfaces and the addition of eth0 to interfaces.d/ the /etc/resolv.conf file isnt being populated, not even the “# Generated by NetworkManager”. Tried including “dns-nameservers 8.8.8.8” within that file but didnt have an impact!

Running “nm-connection-editor” only showed the Ethernet available. And yes currently i am only using the wired connection. Possibly want to use wireless later on and that would be instead of using the wired connection, however this is not a priority.

Edit: re-tried editing the file after the reboot and it is now providing a connection. Next challenge is restoring this file after every reboot!

Adding interfaces probably won’t populate that file directly. Having an interface active and set to DHCP allows the DHCP response to fill in the file if DNS information is given (and probably requires a route over the interface selected as primary by NetworkManager or NetworkManager would ignore it).

There is a subtle issue here…not having WiFi showing up is not the same as having NetworkManager trying to use WiFi. In the past I’ve found that if NetworkManager wants to use WiFi it won’t try to use wired. Attempting to use WiFi can be enough to stop wired…success of WiFi is irrelevant at times. I keep thinking this is an issue of NetworkManager (which in turn is a standard Ubuntu issue…and many distributions have the same problem).

If you use “sudo nm-connection-editor”, select wired, IPv4 Settings, you’ll see a text entry line for “DNS servers”. You might try entering some addresses there from the list of those you’ve seen. If you have another working computer on the same router you might check the nameserver lines of its resolv.conf file and add that address there. Perhaps after that the address would be reserved on reboot (I don’t know for sure, but it’s worth trying).