ipconfig Command in Linux

Learn via video courses
Topics Covered

Transform Your Career

Choose from our industry-leading programs designed for career success

NSDC Certified

Modern Software and AI Engineering Program

Master full-stack development with AI integration

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Modern Data Science and ML with specialisation in AI

Advanced data science techniques with AI specialization

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

Advanced AIML with Specialisation in Agentic AI

Deep dive into AIML with focus on Agentic systems

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

DevOps, Cloud & AI Platform Engineering

Build and manage AI-powered cloud infrastructure

12 MonthsDuration
AI-LedCurriculum
Career SupportSupport
GoogleAmazonPaytm+1000 more
Go to Program
NSDC Certified

AI Engineering Advanced Certification by IIT-Roorkee

Premier AI engineering certification from IIT-Roorkee

3 MonthsDuration
AI-LedCurriculum
Career SupportSupport
Program highlights
Go to Program

Overview

The 'ipconfig' command is a commonly used tool in Windows for network administration. However, in Linux, the equivalent tool for displaying IP configuration is 'ifconfig' or the newer 'ip' command. But for the purpose of this article and to avoid confusion, we will use 'ipconfig' to refer to 'ifconfig' or 'ip'. The ipconfig command in Linux provides network configuration details of the host machine, including the IP address, subnet mask, and default gateway.

Syntax of ipconfig Command in Linux

The basic syntax of the ipconfig command in Linux is as follows:

Where:

  • option: This is optional. The command provides a host of options that allow you to manipulate the output or configure network interfaces.
  • interface: This is also optional. The name of the network interface you wish to examine or configure. If omitted, ifconfig will display information for all active interfaces.
Free Courses by top Scaler instructors
Python Course for Beginners With Certification: Mastering the Essentials
Java Course - Mastering the Fundamentals
DBMS Course - Master the Fundamentals and Advanced Concepts
JavaScript Course With Certification: Unlocking the Power of JavaScript
C++ Course: Learn the Essentials
Python and SQL for Data Science Course
Python Course for Beginners With Certification: Mastering the Essentials
Java Course - Mastering the Fundamentals
DBMS Course - Master the Fundamentals and Advanced Concepts
JavaScript Course With Certification: Unlocking the Power of JavaScript
C++ Course: Learn the Essentials
Python and SQL for Data Science Course

Options in ipconfig Command in Linux

  1. -a: Displays information about all network interfaces, even those that are down.

    For example -

    Output:

    Displays information about all interfaces, not just the active ones.

  2. up: Activates an interface.

    For example -

    This command activates the eth0 interface, if it was down.

  3. down: Deactivates an interface.

    For example -

    This command deactivates the eth0 interface.

Scaler Placement Report and Statistics

₹23L
AVG CTC
SCALER PLACEMENT PROOF

Scaler learners achieved 2.5x salary growth with average post-Scaler CTC reaching ₹23L.

11,000+placements
650+companies
Verified data
Hiring Partners:
GoogleGoogleAmazonAmazonMicrosoftMicrosoftFlipkartFlipkartAdobeAdobe1200+ more

Example Usages

  • Display information of all active interfaces:

    Output:

    Explanation: The command gives information about all active network interfaces.

  • Assign an IP address to a network interface:

    Explanation: Assigns the IP address 192.168.1.10 to the eth0 interface.

Tips

  • Always run ifconfig as a root user or with sudo command for privileged tasks like changing IP addresses.

  • Use the 'man' command to access the manual and understand more about the 'ipconfig' command's capabilities.

Turn Learning into Career Growth

1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary
1200+Hiring Partners
89%Placement Rate
11,000+Placements
147%Avg Salary Increment
2.5XCareer Growth
₹23 LPAAvg Post-Scaler Salary

Advanced Use Cases of ipconfig Command in Linux

  • Change the MAC address of a network interface:

    Explanation: Changes the hardware (MAC) address of the eth0 interface to 00:11:22:33:44:55.

  • Add an alias network interface:

    Explanation: Adds a secondary IP address (alias) 192.168.1.11 to the eth0 interface.

  • Display statistics for a network interface:

    Output:

    Explanation: Displays detailed statistics for the eth0 interface.

Conclusion

  • The 'ipconfig' command in Linux, represented by 'ifconfig' or 'ip', is a versatile tool for network administration.

  • It provides information about the network interfaces and allows you to configure them.

  • For advanced tasks, you can even change MAC addresses, add alias IP addresses, or get detailed interface statistics.