Like a lot of users, I learned ifconfig, although I don't recall whether it's because the ip command didn't exist at the time or whether it just hadn't gained traction. It took a while to get used to ip, but when I understood how much ip encompassed, I switched over to it as soon as I could find a good cheat sheet for it. I think of ip as a suite.

[Cheat sheet: Old Linux commands and their modern replacements ]

If you're using ifconfig as just a query for an IP address, then ip addr show may seem superfluous. But when you're setting network routes and adding interfaces and IP addresses, the ip command suite brings your tasks together into a unified interface. For instance, instead of using ifconfig and route, each with different syntax, you can just use ip.

For instance, here's ifconfig:

$ sudo ifconfig eth0 add 192.168.12.20
$ sudo route add default gw 192.168.12.0 eth0

Those are valid commands, but they're not very consistent from the user's perspective. The device definition is front-loaded with ifconfig and trailing with route.

Here's the same process using ip:

$ sudo ip addr add 192.168.12.20 dev eth0
$ sudo ip route add 192.168.12.0/24 dev eth0 proto static

From a user interface perspective, the ip commands have a kind of symmetry. They're practically identical, so once you train yourself to understand the syntax of one ip subcommand, you know it for all ip subcommands.

And there's a lot you can do with ip. Each subcommand has its own manual entry, so you can focus on parsing each command's options without sorting through options that don't apply.

$ man ip-route
$ man ip-address
$ man ip-link

There's nothing wrong with ifconfig, and if it's the command you know and it's the command that's working for you, then keep on using it. But if you're just now learning networking basics on Linux, focus on material that uses the ip command, and I believe you'll have an easier time comprehending the different components. Just as importantly, you'll find it easier to remember how to view and modify your network settings with one simple two-letter command: ip.

[ Download now: A system administrator's guide to IT automation. ]


저자 소개

Seth Kenlon is a Linux geek, open source enthusiast, free culture advocate, and tabletop gamer. Between gigs in the film industry and the tech industry (not necessarily exclusive of one another), he likes to design games and hack on code (also not necessarily exclusive of one another).

UI_Icon-Red_Hat-Close-A-Black-RGB

채널별 검색

automation icon

오토메이션

기술, 팀, 인프라를 위한 IT 자동화 최신 동향

AI icon

인공지능

고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트

open hybrid cloud icon

오픈 하이브리드 클라우드

하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요

security icon

보안

환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보

edge icon

엣지 컴퓨팅

엣지에서의 운영을 단순화하는 플랫폼 업데이트

Infrastructure icon

인프라

세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보

application development icon

애플리케이션

복잡한 애플리케이션에 대한 솔루션 더 보기

Virtualization icon

가상화

온프레미스와 클라우드 환경에서 워크로드를 유연하게 운영하기 위한 엔터프라이즈 가상화의 미래