Assigning Multiple Addresses to a Network Interface

ip Streamlines Advanced Networking

October 10, 2008

By
Carla Schroder

The ip command is part of the iproute2 suite of TCP/IP networking utilities. It keeps trying to replace the old familiar ifconfig and route commands, which do what they do splendidly but are a bit limited for today's network environments. One thing ip can do that ifconfig cannot is assign multiple addresses to a single network interface. ifconfig can assign multiple aliases, such as eth0:0, eth0:1, and so forth, but then you must give each alias a separate configuration as though they are separate physical interfaces. ip adds addresses to a single interface like this:

If you run ifconfig to check your addresses, it will see only the first one.

Unsure About an Acronym or Term?
Search the ServerWatch Glossary

This is a great way to get access to multiple subnets without having to create a herd of new configurations, or install multiple network interface cards. Another practical use for this is accessing a new server or router for the first time. Typically, these come with a default IP address. If it's on a different subnet, but on the same switch, you can quickly add a compatible address to your workstation and log in to the new device. When you're finished, remove the unwanted addresses like so: