How to set TX1 to use static IP on ethernet port

My TX1 is responding to DHCP and gets an address. I want it to have static IP 192.168.150 but I cannot figure how to do it. There is no eth0 device. The /etc/network/interfaces is essentially blank and points to a director that is empty. I have tried to put the usual eth0 commands in the /etc/networks/interfaces fiel and reboot. But it ignores everything and continues to boot up using DHCP.

This cannot that difficult to figure out !

When you say it works as DHCP client, what is the interface used, if not eth0 ?

If

ifconfig

shows a eth0 interface configured with your dhcp address, then note the netmask and gateway.
Then you can try the following :
Assuming you want address 192.168.0.150 for your board, edit file /etc/network/interfaces and add :

auto eth0
iface eth0 inet static
        address 192.168.0.150
        netmask 255.255.255.0 
        gateway 192.168.0.1
        dns-nameservers 8.8.8.8

where netmask and gateway would probably be the same as what you’ve noted.
Save file, and then reboot and check with ifconfig if it matches your expectations.

1 Like

When I run ifconfig on my tx1 I see the following.

enx00044b65c9ec Link encap:Ethernet HWaddr 00:04:4b:65:c9:ec

This had originally been a reply on the duplicate of this thread, I’m reposting it here
use whatever the ifconfig reports for the name of the ethernet device if eth0 is not correct


This is on a JTK1, but results should be the same. Beware I may have done other configuration (this was a while back) related to telling NetworkManager to not interfere, but I don’t remember what it was if I actually did that (my config has been saved and transferred over to new flash images for about 4 years now). Somewhere I probably did something to tell DHCP to not happen.

In “/etc/network/” the naming of file “interfaces” would lead you to believe that it automatically works with files in “/etc/network/interfaces.d/”, but it doesn’t. So I manually told it to source the relevant file. Try manually editing “/etc/network/interfaces” to become this with one extra line:

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

# This line is a custom edit.
source interfaces.d/eth0

Then inside of “/etc/network/interfaces.d/” add file “eth0”. Content something like this (I’m assuming your router is the gateway and that the gateway has address “192.168.1.2”
note that the address you gave of “192.168.150” is missing a digit, I’m assuming it is “192.168.1.150”):

auto eth0
iface eth0 inet static
address 192.168.1.150
netmask 255.255.255.0
gateway 192.168.1.2

If that file is read the content says to automatically bring the interface up using static protocols, so it may be this is enough to stop DHCP (it depends on other software and there is a mix of NetworkManager and older style files that don’t always play together nicely).

The original ifconfig was something like:

enx00044b580e65 Link encap:Ethernet HWaddr 00:04:4b:58:0e:65
inet addr:192.168.1.138 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::204:4bff:fe58:e65/64 Scope:Link



no eth0

I tried some the fixes provide. Now I have managed to wreck the whole thing. No DHCP - Nothing. Flashing lights on the Ethernet port but can’t ping anything. Shit !

I managed to get the serial console cable to UART0 and use minicom. I can see the TX1 boot up and I see two erors:

[FAILED] Failed to start Set console keymap.

[FAILED] Failed to start Raise network interfaces.
See ‘systemctl status networking.service’ for details.

Strangely enough cannot send anything to the TX1 from minicom. Why ? Cable seems to be connected correctly.

I really don’t want to reflash the TX1. It took forever and I will have put ROS on again. Luckily all my source files are backed on the laptop.

Any ideas appreciated. Now we need first get communication then worry about static IP

The console keymap is probably related to minicom not talking to the Jetson
but perhaps it is just a case of incorrect serial port settings. Check that it is 115200 8N1. If your serial cable uses only 3 wires use software flow control; if your cable uses more than 3 wires set flow control to CTS/RTS.

If it is not a serial console setting for why the console keymap failure shows, then something else is going on. If serial console settings are correct, then try skimming through dmesg to see if anything unusual sticks out.

Yes. minicom doing something stupid. I found a Windows machine and connected to serial console via Putty.

Now at least I can talk to the TX1

If I do ifconfig here is what I get - no inet4 address -no eth0

enx00044b65c8de Link encap:Ethernet HWaddr 00:04:4b:65:c8:de
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:422 errors:0 dropped:0 overruns:0 frame:0
TX packets:105 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:27600 (27.6 KB) TX bytes:17976 (17.9 KB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:1604 errors:0 dropped:0 overruns:0 frame:0
TX packets:1604 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:118640 (118.6 KB) TX bytes:118640 (118.6 KB)

wlan0 Link encap:Ethernet HWaddr 00:04:4b:65:c8:dc
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

@Linuxdev: Thanks for sharing the new method for configuring network interfaces. I was supposing something like this, but however such config was ok on TK1, so provided as first workaround.

@DrWino: After you got control again through serial console, main thing for configuration is your network topology. Are you administrator of a home box, or in a network with an admin ? In latter case, ask your admin for the exact static IP to use, network mask and gateway.

If it is your home box, then you have to login as admin mode into your box to check the available range of addresses for dhcp addresses, range for static addresses (and pick one IP among these for your board), check the netmask and gateway are correct for what you’re trying.

Another question, especially if your board was flashed from another jetson image, what is the content of file

/etc/udev/rules.d/70-persistent-net.rules

?
Does it mentions eth0 matching your MAC address 00:04:4b:65:c8:de ?
(You mentionned 3 different MAC addresses
00:04:4b:65:c9:ec, 00:04:4b:58:0e:65, 00:04:4b:65:c8:de, just for ethernet)

I used the standard lastest Jetpack to flash the TX1.
The only files in /etc/udev/rules.d are :
90-

and 99- 


no 70-persistent-net.rules

I do not see any eth0 device. ifconfig does not show any.
I see only 2 MAC addresses on ifconfig. I have to assume these are correct since the there are no stickers or documentation on specific MAC addresses for this unit.

I am puzzled that a basic lan configuration is uncertain. What are we supposed to just bumble around and find a solution ? I really appreciate all the help from the people on the forum but this is basic documumentation that Nvidia should provide.

Alright anybody know how to configure the wlan for static ? I’ll try that.

@linuxdev

I made the changes to /etc/network/interfaces and the eth0 file placed in interfaces.d.

My typo was fixed. It was only in the forum. the IP of the TX1 is to set to 192.168.1.50 as address 100 to 254 are available for DHCP assigned by the router. address 1 to 99 are set aside for static IP devices.

I sudo reboot. In the bootup console log I see “no ethernet found” 
 and of course the ifconfig is the same as before with no eth0.

I fear I may have to run Jetpack again and reinstall everything !!!

Curiouser and curouser. The wireless lan works. The wlan0 gets IP by DHCP I am kinda scared to change it to static. Maybe after eth0 works. Open to any ideas.

It may be you need to do some magic with NetworkManager. I avoid wireless
it just gives me all kinds of grief and I keep it disabled. WiFi is considered hotplug, and whenever it comes up or goes down it may automatically change another interface unless it is told not to. A typical scenario is that someone uses WiFi if up, and then it only enables wired when WiFi is down
the average person does not have two networks. In reality you want wired to always be on as a private subnet, and to have WiFi never touch the status of wired
I think you need to edit settings or it won’t behave as you want because of WiFi. Somewhere there is probably an Ubuntu admin manual talking about WiFi, wlan0, and configuration.

One test would be to purposely shut down WiFi, and disable it. Then reboot. See if you have control over wired when WiFi is taken out of the picture.

FYI, wlan0 tends to be a loopback device to handle what traffic goes for regardless of whether WiFi or wired are up or down
applications using the internet won’t need to know details of what is up or down. You may in fact need to disable wlan0 as well before you work on wired
once wired is up you could then see how to enable WiFi configuration to not interfere with wired.

Thanks. But my linux skills are not up to figuring why the system suddenly does not recognize the ethernet port. I do need the wired port to talk to the LIDAR. Which is why I want to make it static IP. I was not going to use the wireless but just use an ethernet switch to also use the wired port for programming.

Now, I am kind of cooked. I don’t want to get rid of the wireless port because that is all I have and I have no clue how to restore the wired port without a Jetpack reflash.

The ubuntu graphical login I think has a chance to disable WiFi
try to disable that, and if needed, even run ifdown on wlan0. Then try configuring wired. You can always enable it again in the same menu that disables it, then reboot.

The symptoms you are describing make me wonder:

Which L4T version are you running ?

head -1 /etc/nv_tegra_release

Did you install from JetPack ? Wich version ?

Did the setup process complete without ANY error ?

Are you behind a firewall or proxy ?

Have you deliberatly installed a custom bootloader, kernel or distribution ?

If not, I would suggest to save any work from your board and try to reflash it with lastest JetPack (from a PC running Ubuntu14.04, avoiding Vmware), carefully checking for any error that would prevent the setup from completing as expected.

I have edited my first post and added line:

dns-nameservers 8.8.8.8

Without this, DNS is not working. It can explain some problems you’ve had, but it looks your installation is not standard or incomplete.

Thanks for the input but >>>
My TX1 setup is completely standard. I got the new machine last week. It had ubuntu preinstalled.
Next I flashed the latest Jetpack - all default options
Next I loaded ROS and some python programs

And since then I program with ROS. It works fine. I know too little about linux to do any strange.

I did a apt-get update && apt-get upgrade and maybe this cause some grief. Don’t know.

The wired ethernet works fine with DHCP. I get an address and can SSH etc. eth0 does not exist. Instead I have the odd ethernet device I posted earlier. The wireless has a DHCP assigned address in wlan0 but I cannot SSH to this address. Now if I boot up with the DHCP server not connected to the wired port I still get DHCP on the wireless and I can SSH to it.

So, I understand your comments but there is nothing non standard unless the Jetpack is doing weird things to allow DHCP access. It is still odd why there is no eth0

See if the upgrade overwrote anything important:

sha1sum -c /etc/nv_tegra_release

I forget what it’s called, but something like devfs renames some device special files based on rules
networking has something similar which sometimes renames network interfaces (the old “eth0” style naming can be changed because of this). Even if the interface has a different name it should work the same. “ifconfig” should show what is there (or “ifconfig -a” to show even disabled devices). For example, on my Fedora, I have enp4s6 and enp5s0, but no eth0.

Well, I cannot tell much more. The udev 70-persistent-net-rules file used to be created in Ubuntu 14.04.
I cannot check now with Ubuntu 16.04, but it may have changed, sorry for the confusion.

You can try:

/sbin/udevadm trigger --type=devices --action=add

I may tell you more in 2 days with a TX1 running, if this doesn’t solve your problem.