0

I have a USB network interface which I want to set the IP address and netwmask on manually. If I do that this way:

$ sudo ip addr add 10.1.1.1/24 dev eno1

I also run this:

$ nmcli dev set eno1 managed no  
$ nmcli dev
DEVICE           TYPE      STATE         CONNECTION             
eno1             ethernet  unmanaged     -- 

But then after a variable amount of time (usually less than a minute) the IP address will be lost. If I run nmcli dev again, I see that it has again become a managed interface:

$ nmcli dev
DEVICE           TYPE      STATE                                  CONNECTION         
eno1             ethernet  connecting (getting IP configuration)  Wired connection 2

I've read answers like Set static IP Ubuntu which require editing a file. I don't want to make this change permanent, so how can I set a static IP via command-line only, no file editing?

0 Answers0