How to check TCP/IP configuration with ifconfig on Linux Cloud Servers

2020-06-01 By Ryan 14276 Views linux ifconfig networking
35 reviews

Interface configuration (ifconfig) is used to configure, control, and query TCP/IP network interface parameters from a command-line interface (CLI) or in system configuration scripts in Unix-like operating systems.


  1. The ifconfig command without any argument is used to check the IP address assigned to the server and displays all the active interfaces details. Here eth0 is one of the network interfaces and lo is a loopback device.

    # ifconfig
    

    ipconfiglinux1

    Here it displays the IPv4 and IPv6 addresses, broadcast address and netmask:

    ipconfiglinux2

  2. In the below command the argument a is used to display the details of all active and inactive network interfaces.

    # ifconfig -a
    

    ipconfiglinux3

  3. Display the details of a specified network interface.

    # ifconfig <interface name>
    

    In the below image it displays the details about the eth0 network interface:

    ipconfiglinux4

  4. Enable a Network interface.

    # ifconfig <interface name> up
    
    OR
    
    # ifup <interface name>
    

    Here up or ifup flag with the network interface eth0 will activate the network interface if it is not in active state.

    ipconfiglinux5

  5. Disable a Network interface.

    # ifconfig <interface name> down
    
    OR
    
    # ifdown <interface name>
    

    Here down or ifdown flag with the network interface eth0 will deactivate the network interface if it is in active state.

ipconfiglinux6


IP Command


The IP command is used to assign an address for a network interface and configure the network interface on a Linux system. The below command shows all IP addresses of all network interfaces whether it is enabled or disabled.

# ip a

OR

# ip addr

ipconfiglinux7

ipconfiglinux8


Related Tutorials

What do you think about this article?

Rate this article
LayerStack Promotion
Need assistance?

Try this guide to receive free bundled services at signup on a new free account.

Sign Up

Your Feedback Is Important

We hope you’ll give the new products and updates a try. If you have an idea for improving our products or want to vote on other user ideas so they get prioritized, please submit your feedback on our Community platform. And if you have any questions, please feel free to ask in the Community or contact our Technical Support team.