Datamation content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.
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:
# ip addr add 192.168.1.10/24 brd + dev eth0
# ip addr add 192.168.2.10/24 brd + dev eth0
|
brd + means “automatically set the broadcast address.” View the results with this command:
$ ip addr show eth0
2: eth0: mtu 1500 qdisc noop qlen 1000
link/ether 00:03:6d:00:83:cf brd ff:ff:ff:ff:ff:ff
inet 192.168.2.10/24 brd 192.168.2.255 scope global eth0
inet 192.168.3.10/24 brd 192.168.3.255 scope global eth0
|
If you run ifconfig to check your addresses, it will see only the first one.
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:
# ip addr del 192.168.3.10/24 dev eth0
|
man ip is the best and most complete reference.
This article was first published on ServerWatch.com.
RELATED NEWS AND ANALYSIS
-
Huawei’s AI Update: Things Are Moving Faster Than We Think
FEATURE | By Rob Enderle,
December 04, 2020
-
Keeping Machine Learning Algorithms Honest in the ‘Ethics-First’ Era
ARTIFICIAL INTELLIGENCE | By Guest Author,
November 18, 2020
-
Key Trends in Chatbots and RPA
FEATURE | By Guest Author,
November 10, 2020
-
Top 10 AIOps Companies
FEATURE | By Samuel Greengard,
November 05, 2020
-
What is Text Analysis?
ARTIFICIAL INTELLIGENCE | By Guest Author,
November 02, 2020
-
How Intel’s Work With Autonomous Cars Could Redefine General Purpose AI
ARTIFICIAL INTELLIGENCE | By Rob Enderle,
October 29, 2020
-
Dell Technologies World: Weaving Together Human And Machine Interaction For AI And Robotics
ARTIFICIAL INTELLIGENCE | By Rob Enderle,
October 23, 2020
-
The Super Moderator, or How IBM Project Debater Could Save Social Media
FEATURE | By Rob Enderle,
October 16, 2020
-
Top 10 Chatbot Platforms
FEATURE | By Cynthia Harvey,
October 07, 2020
-
Finding a Career Path in AI
ARTIFICIAL INTELLIGENCE | By Guest Author,
October 05, 2020
-
CIOs Discuss the Promise of AI and Data Science
FEATURE | By Guest Author,
September 25, 2020
-
Microsoft Is Building An AI Product That Could Predict The Future
FEATURE | By Rob Enderle,
September 25, 2020
-
Top 10 Machine Learning Companies 2020
FEATURE | By Cynthia Harvey,
September 22, 2020
-
NVIDIA and ARM: Massively Changing The AI Landscape
ARTIFICIAL INTELLIGENCE | By Rob Enderle,
September 18, 2020
-
Continuous Intelligence: Expert Discussion [Video and Podcast]
ARTIFICIAL INTELLIGENCE | By James Maguire,
September 14, 2020
-
Artificial Intelligence: Governance and Ethics [Video]
ARTIFICIAL INTELLIGENCE | By James Maguire,
September 13, 2020
-
IBM Watson At The US Open: Showcasing The Power Of A Mature Enterprise-Class AI
FEATURE | By Rob Enderle,
September 11, 2020
-
Artificial Intelligence: Perception vs. Reality
FEATURE | By James Maguire,
September 09, 2020
-
Anticipating The Coming Wave Of AI Enhanced PCs
FEATURE | By Rob Enderle,
September 05, 2020
-
The Critical Nature Of IBM’s NLP (Natural Language Processing) Effort
ARTIFICIAL INTELLIGENCE | By Rob Enderle,
August 14, 2020