Linux ip Command Examples

The ip command is a versatile tool for managing and querying network interfaces and IP addresses on a Linux system. Here are some common examples of using the ip command:

  1. Display information about all network interfaces:
    $ ip addr show
  2. Display information about a specific network interface:
    $ ip addr show eth0

    Replace eth0 with the name of the network interface you want to query.

  3. Display information about all IP addresses:
    $ ip address show
  4. Display the routing table:
    $ ip route show
  5. Add a new IP address to a network interface:
    $ ip addr add 192.168.1.100/24 dev eth0

    Replace 192.168.1.100/24 with the IP address and subnet mask, and eth0 with the name of the network interface.

  6. Delete an IP address from a network interface:
    $ ip addr del 192.168.1.100/24 dev eth0

    Replace 192.168.1.100/24 with the IP address and subnet mask, and eth0 with the name of the network interface.

  7. Display information about network connections:
    $ ip link show

These are just a few examples of how to use the ip command. For more information and advanced usage, refer to the ip command manual pages by executing man ip.

Leave a Comment