Linux ip Command Examples

‮sptth‬://www.lautturi.com
Linux ip Command Examples

The "ip" command is a utility for managing network interfaces and routes in Linux. It is part of the iproute2 suite of networking tools. Here are some examples of using the "ip" command:

  1. To display information about the network interfaces on the system, run the following command:
ip addr

This will display the name, status, and IP address of each network interface.

  1. To display information about the routing table, run the following command:
ip route

This will display the destination, gateway, and interface for each route in the routing table.

  1. To add a new route to the routing table, run the following command:
ip route add DESTINATION via GATEWAY dev INTERFACE

Replace "DESTINATION", "GATEWAY", and "INTERFACE" with the appropriate values for your network.

  1. To change the IP address of a network interface, run the following command:
ip addr add ADDRESS/PREFIX dev INTERFACE

Replace "ADDRESS/PREFIX" and "INTERFACE" with the appropriate values for your network.

  1. To delete an IP address from a network interface, run the following command:
ip addr del ADDRESS/PREFIX dev INTERFACE

Replace "ADDRESS/PREFIX" and "INTERFACE" with the appropriate values for your network.

Note: These are just a few examples of using the "ip" command. There are many other options and subcommands available with the "ip" command. To view the full list of options and subcommands, run the "ip -h" or "ip --help" command.

Created Time:2017-10-30 10:17:41  Author:lautturi