ip command

Change network configuration


Table of contents

Change IP

Here are the commands used to change the network settings by adding or removing IP addresses and turning on or off network interfaces.

They can be useful when you want to connect your computer to a different network or when you want to troubleshoot network connectivity issues.

ip addr del dev eno1
ip addr add dev eno1
ip link set up dev eno1
  1. Remove the IP address that is assigned to a network interface called eno1. The /24 part is a fancy way of saying that it is a small network (it is equivalent to the network mask).
  2. Add a new IP address to the same network interface called eno1. This is like giving your computer a new phone number that other devices can use to call it.
  3. Turn on the network interface eno1 so that it can start communicating with other devices on the network. It's like turning on the switch for a light bulb so that it can start working.

Set default gateway

ip route change default via dev eno1

It's like telling your computer to use a specific road to get to your friend's house, "go through the big park".

Rate this page