IP Configuration

Configure network settings

Price range: €11.74 through €18.45

Command:

bash
sudo ip addr add {desired_ip_address}/{subnet_mask} dev {interface_name}

Explanation:

  • sudo: Runs the command with superuser privileges, which is typically required to modify network settings.
  • ip addr add: The command used to add an IP address to an interface.
  • {desired_ip_address}: The IP address you want to assign to the interface (e.g., 192.168.1.100).
  • /{subnet_mask}: The subnet mask in CIDR notation (e.g., /24 for a 255.255.255.0 subnet mask).
  • dev {interface_name}: The network interface to which the IP address will be assigned (e.g., eth0ens33, or wlan0).

Example:

To assign the IP address 192.168.1.100 with a subnet mask of 255.255.255.0 to the interface eth0, you would use the following command:

bash
sudo ip addr add 192.168.1.100/24 dev eth0

Result:

This command will configure the network interface eth0 with the IP address 192.168.1.100 and the subnet mask 255.255.255.0 (CIDR /24). The change is applied immediately, but it may not persist after a reboot unless configured in the network settings configuration files.


Additional Notes:

  • To verify the new IP address, you can use the command:
    bash
    ip addr show {interface_name}

    For example:

    bash
    ip addr show eth0
  • To remove the IP address from the interface, use:
    bash
    sudo ip addr del {desired_ip_address}/{subnet_mask} dev {interface_name}
Select options This product has multiple variants. The options may be chosen on the product page