Changing Interface State Using IP Command
Example 1: Bringing an Interface Up
To bring an interface up (activate it), you can use the `ip link`
command with the `set`
action. For example:
sudo ip link set eth0 up
This command brings the `eth0`
interface up, enabling it to send and receive network traffic.
Example 2: Changing MTU (Maximum Transmission Unit)
To change the MTU (maximum transmission unit) of a network interface, you can use the `ip
link`
command with the `set`
action and the `mtu`
parameter. For instance:
sudo ip link set eth0 mtu 1500
This command sets the MTU of the `eth0`
interface to `1500`
bytes.
ip Command in Linux with Examples
The ip
command in Linux is a powerful utility for network configuration and management. It allows users to interact with various networking components such as network interfaces, routing tables, addresses, and more. In this guide, we will delve into the ip
command, covering each aspect with examples, code, and detailed explanations.