Linux 101 : Simple commands for the network interfaces - The "ip" command -



Bringing up an interface:

To bring up a network interface, we use:


We could also use the below command to bring up and interface:


Bringing down an interface:

And likewise for "turning off" an interface, we use:


Showing the interface details:


Assigning an address to an interface:


Assigns the IP:192.168.0.1 to the interface "eno1" with a netmask value of "24".

Assigning a static IP to an interface:

We use the file "/etc/network/interfaces" to assign a static IP address to an interface:


For the changes to take effect, we could use the below command to
restart the networking:


Changing the hostname:

To change the hostname, we use the below command:


To check, we use the command "hostname".

Your machine's neigbhors:

The below command replaces the "arp" command:

  • STALE : the entry is correct but not 100% accurate.
  • REACHABLE : the entry is valid as long as the timeout (reachability timeout) has not expired.

Comments

Leave as a comment:

Archive