3

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 192.168.123.2
ifconfig ep0 192.168.123.3 alias netmask 0xFFFFFFFF
ifconfig ep0 192.168.124.1 alias

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

6
  • The ip command in Linux eliminates the need for aliases since it natively support multiple addresses on a single interface. Commented Mar 27, 2015 at 13:59
  • @jordanm: Why not put that as an answer so I can give you rep for accepted answer once I verify it? Commented Mar 27, 2015 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. Commented Mar 27, 2015 at 14:15
  • I wasn't comfortable with that since your example appears to be a BSD variant and my comment is Linux-specific. Commented Mar 27, 2015 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. Commented Mar 27, 2015 at 21:19

1 Answer 1

1

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 documented pretty well here (I think) with an example that we show the same configuration when using ifconfig (because the address was assigned a label)

From Difference between virtual interfaces with ifconfig and iproute2

ip addr add 192.168.123.3/24 dev ep0 label ep0:0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.