ip command error: ither "dev" is duplicate, or "x.x.x.x" is a garbage

dhuyvetter asked:

I am trying to set bind loopback to an IP address with ip link set lo 10.254.254.254 up but keep getting the error Error: either "dev" is duplicate, or "10.254.254.254" is a garbage.

I googled the error, but there isn’t any consistency in the answers and nothing that I have tried has helped.

Before I was using ifconfig, which is now deprecated and used the command ifconfig lo 10.254.254.254 up. Am I correct that above lo command should do the same thing?

My answer:


It’s all a garbage. It doesn’t make sense to use ip link to add IP addresses. It’s used to manage lower layer characteristics of the interface, such as name, MAC address, etc.

To set an IP address, you will use ip address instead.

ip address add <address>/<prefix> dev <interface>

For example:

ip a add 10.254.254.254/32 dev lo

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.