How to change ip address in orin

In my project, I need to set eth0 ip 192.168.1.*, when the orin connect with my lidars.
But if I find it connected to another device, the ip must set as Automatic(DHCP). (not reboot system)

How can I change static ip to automatic by cmd or program?

Hi @wangliyong


To keep it simple, I have used this to get auto (dhcp) configuration:

Bring interface down

ifconfig eth0 down


iface eth0 inet dhcp

To the file:


Then bring the interface up, it will be configured by the dhcp

ifconfig eth0 up


And to configure it static,

Bring the interface down,

ifconfig eth0 down

Remove the previous line from


Bring the interface up

ifconfig eth0 up

Configure the interface static, for example:

sudo ifconfig eth0 netmask
sudo route add default gw eth0

Hope this helps a little.

Roberto Gutierrez,
Embedded SW Engineer at RidgeRun
Contact us:
Developers wiki:


It works, it’s really help to me.

Thank you very much, Robertogs2.

There is an problem. after set static ip:
sudo ifconfig eth0 netmask
sudo route add default gw eth0

It works. but after several seconds(less than 1 min), the ip will lost.


And does it change it’s IP or it simply disappears?


This isn’t ideal, but you might try configuring that interface from nm-connection-editor (if you don’t have this, then “sudo apt-get install network-manager-gnome”).

It disappears.

I have to Change it by cmd, or by coding.
It has no screen/keyboard/mouse.

Network scripts are rather complicated these days (depends on if it is “managed” or “unmanaged”). Are you able to use the USB virtual wired networking (temporarily) from a host PC? If so, then you can use “ssh -Y”, and this will forward GUI requests and run the graphics on the host PC despite not having a monitor on the Jetson. I wouldn’t know what config files to edit on the Jetson if going directly to it (it was a lot less complicated before systemd came along).

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