This question already has an answer here:

While reading the O'Reilley book on Apache Web Server, they gave an example on using ifconfig to set ip aliases on an interface:

ifconfig ep0
ifconfig ep0 alias netmask 0xFFFFFFFF
ifconfig ep0 alias

I became curious: how would you do the same thing using the iproute utils on Linux?

marked as duplicate by Christopher, Sergiy Kolodyazhnyy, Kusalananda Oct 8 at 7:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • The ip command in Linux eliminates the need for aliases since it natively support multiple addresses on a single interface. – jordanm Mar 27 '15 at 13:59
  • @jordanm: Why not put that as an answer so I can give you rep for accepted answer once I verify it? – labyrinth Mar 27 '15 at 14:09
  • @jordanm: Also, maybe I'm slow, but I don't see how the interface magically has specific values set just because ip utils exist on the system. Or to put it another way, since you don't need aliases, are you saying that to accomplish the same thing, you just add the other addresses directly? Again, write it up as a question so I can give you rep. – labyrinth Mar 27 '15 at 14:15
  • I wasn't comfortable with that since your example appears to be a BSD variant and my comment is Linux-specific. – jordanm Mar 27 '15 at 14:31
  • I see. The example was pasted in from the book (where they were using BSD). But the iproute2 utils are Linux only, right? I'll clarify in the question. – labyrinth Mar 27 '15 at 21:19

Strange that commenter jordanm didn't answer after all that.

As you're probably long aware of now, when using Linux iproute2 tools, you don't have to create an interface alias any longer, you just add the IP address to the existing interface. This is well documented here with an example that we show the same configuration when using ifconfig (because the address was assigned a label)

Difference between virtual interfaces with ifconfig and iproute2

Not the answer you're looking for? Browse other questions tagged or ask your own question.