1

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?

dhuyvetter
  • 113
  • 5

1 Answers1

3

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
Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • Thank you @michael-hampton ! I couldn't find anywhere what the equivalent of that ifconfig command was using ip. – dhuyvetter May 22 '18 at 12:24