🎤 WhaTap x 토크아이티 무료 웨비나 | 2월 24일 오후 2시
Top
Contact
Tech
2018-11-09

11 Essential ifconfig Commands for Linux Network Configuration and IP Management

11 Essential ifconfig Commands for Linux Network Configuration and IP Management

When Developers Should Start Using ifconfig

History tends to repeat itself. In the early days of the internet, developers built services while directly configuring and monitoring server networks themselves. As the industry evolved and became more specialized, server network configuration gradually became the domain of dedicated system and network engineers.

Today, however, the cloud has brought many aspects of system engineering back into the developer’s scope. Developers are now expected to understand the logical fundamentals of system engineering, and DevOps practices require both system engineers and developers to share a baseline level of infrastructure knowledge.

For this reason, it’s worth revisiting ifconfig, a fundamental network command developers can use to monitor and manage services.

What is ifconfig?

ifconfig, short for interface configuration, is a Linux utility used to configure and manage network interfaces. Among Linux command-line tools, ifconfig is one of the most widely used commands alongside tools like top.

The ifconfig command can:

  • Display current network configuration information
  • Assign IP addresses, netmasks, and broadcast addresses
  • Create interface aliases
  • Set hardware (MAC) addresses
  • Enable or disable network interfaces

Because of its versatility, ifconfig remains a foundational tool for Linux network management.

11 Essential ifconfig Commands for Linux Network Management

1. Check network interface configuration <ifconfig>  

Running ifconfig without arguments displays detailed information about active interfaces. However, it does not show inactive interfaces.

네트워크 인터페이스 구성 확인하기 <ifconfig>  

Key fields include:

  • [enp0s3]: Network interface name
  • [flags]: Status of the network interface
  • [mtu]: Maximum Transmission Unit
  • [inet]: Assigned IPv4 address
  • [netmask]: Netmask
  • [broadcast]: Broadcast address
  • [inet6]: Assigned IPv6 address
  • [prefixlen]: Subnet prefix length
  • [scopeid]: IPv6 scope (LOOPBACK, LINKLOCAL, GLOBAL, etc.)
  • [ether]: MAC address
  • [RX packets]: Received packets
  • [TX packets]: Transmitted packets
  • [collision]: Packet collisions
  • [Interrupt]: Interrupt number used by the interface

2. View all interfaces (including inactive ones) <ifconfig – a>  

The -a option shows both active and inactive network interfaces. If there are no inactive interfaces, the output will look the same as the default command.

모든 네트워크 인터페이스 구성 확인하기. <ifconfig – a>  

3. View a specific interface <ifconfig [interface]>  

Displays information for a selected interface only—useful when many interfaces are present.

해당 인터페이스 정보만 보기 <ifconfig [interface]>  

4. Disable a network interface <ifconfig [interface] down>  

Disables the specified interface. You can confirm the change by checking the flags value afterward.

flags=4098 <BROADCAST,MULTICAST>

해당 인터페이스 비활성화 하기 <ifconfig [interface] down>

5. Enable a network interface <UP,BROADCAST,RUNNING,MULTICAST>  

Activates the specified interface and updates its status flags.

flags=4163 <BROADCAST,MULTICAST>

해당 인터페이스 활성화하기 <UP,BROADCAST,RUNNING,MULTICAST>  

6. Assign or change an IP address <ifconfig [interface] [IP]>  

Updates the IP address assigned to a network interface.

해당 인터페이스에 IP 변경하기 <ifconfig [interface] [IP]>

7. Change the netmask <ifconfig [interface] netmask [IP]>  

Updates the subnet mask for the interface.

해당 인터페이스에 넷마스크 변경하기 <ifconfig [interface] netmask [IP]>

8. Change the broadcast address <ifconfig [interface] broadcast [IP]>

Sets a new broadcast address for the interface.

해당 인터페이스에 브로드캐스트 주소 변경하기 <ifconfig [interface] broadcast [IP]>

9. Configure IP, netmask, and broadcast together <ifconfig [interface] [ip] netmask [ip] broadcast [IP]>  

Allows multiple network settings to be configured in a single command.

해당 인터페이스에 IP / 넷마스크 / 브로드캐스트 주소 한꺼번에 변경하기 <ifconfig [interface] [ip] netmask [ip] broadcast [IP]>  

10. Assign a MAC address <ifconfig [interface] hw ether [mac address]>  

Changes the hardware (MAC) address of the interface.

해당 인터페이스에 맥 어드레스 할당하기 <ifconfig [interface] hw ether [mac address]>

11. Create a virtual interface using an alias <ifconfig [interface]:0 [ip]>  

Adds an alias to create a virtual interface and assign multiple IP addresses to one physical interface.

인터페이스에 별칭 추가해서 가상 인터페이스 만들기 <ifconfig [interface]:0 [ip]>  

Conclusion

There are many command-line tools available for network interface management and monitoring, but ifconfig remains one of the most fundamental.

In many organizations today, dedicated system engineers may not always be available, meaning developers often need to check network I/O or adjust network settings themselves using basic commands. As monitoring needs grow, it’s also worth adopting specialized monitoring tools such as Cacti, Zabbix, or Munin.

For teams looking for a DevOps tool with multi-tenant capabilities that allows both developers and operators to monitor systems anytime and anywhere, you can start with WhaTap for free.

Experience Monitoring with WhaTap!