Author: Ruwantha Nissanka

What is ip command in linux

The ip command is a useful tool for assigning an address to a network interface and/or configure network interface parameters on Linux operating systems.  It is used to bring interfaces up or down, assign and remove addresses and routes, manage ARP cache, and much more. This command replaces old good and now deprecated ifconfig command on modern Linux distributions. In this article, we will discover the practical use cases of this command Display network interfaces information You can use the following command to display all ip addresses associated on all network interfaces: #ip a Display information about a single interface It is also possible to specify and list particular interface details. #ip addr show dev <interface> Assign IP address to an interface Use the following command to assign an IP address to an interface #ip addr add <ip_address>/<netmask> dev <interface> Add a broadcast address to an interface We have to set the broadcast address manually as the ip command does not set any broadcast address by default. #ip addr add brd <ip_address> dev <interface> Delete an IP address from an interface To delete a previously set ip address, use the following command: #ip a del <ip_address> dev <interface> Display IP routing table You can view the IP routing table by using the following command #ip route list View routing for a distinct network Run this command to view routing for a...

Read More

8 examples of using ifconfig command

ifconfig is a network management tool in Linux that we can use to check the IP addresses of Linux systems as well as configure network interfaces. It allows users to to configure, manage and query network interface parameters via command line interface or in a system configuration scripts. In this guide, we will see how to use this tool to make our network management tasks easier. View network settings The ifconfig command without any arguments displays the status of all the network interfaces associated with the Linux system. #ifconfig To display the above output in short format, use the -s option. #ifconfig -s List all network interfaces The following command will display information of all active or inactive network interfaces on your system. #ifconfig -a View Network settings of an interface The following command will display details of specific network interface. #ifconfig <interface> Enable/Disable Network interfaces Use the following command to enable an interface: #ifconfig <interface> up Use the following command to disable an interface: #ifconfig <interface>down Assign an ip address to an interface Use the following command with an interface name (eth0) and ip address that you want to set: #ifconfig <interface> <ip_address> Assign a Netmask to the interface Using the “ifconfig” command with “netmask” argument and interface name as (eth0) allows you to define an netmask to an given interface. # ifconfig <interface> netmask <netmask> Enable/Disable Promiscuous mode Promiscuous...

Read More

How to use Ethtool in linux

Ethtool is a useful linux utility that we can use to view and modify the ethernet device settings. By following this article, you will learn how to change the speed in your network card, modify auto-negotiation settings and changing duplex modes in your network card. Installing ethtool #apt install ethtool Once it is installed, use the following command to check the installed version. #ethtool –version Display Network Interface card version #ip link show As you can see, I have only two network interfaces connected to my linux virtual machine. To display more information about a specific interface, use the following command: #ethtool <interface_name> Display driver settings This option displays driver version, firmware version and bus details as shown below #ethtool -i <interface_name> Display Auto-negotiation settings You can view the auto-negotiation details about the specific ethernet device by using the following command: #ethtool -a <interface_name> Change Auto-negotiation settings #ethtool -s <interface_name> autoneg off Display statistics of interface This command will show the bytes transfered, received, errors, etc, as shown below. #ethtool -S <interface_name> Change the Speed of Ethernet Device #ethtool -s <interface_name> speed 100 autoneg off Set duplex mode # ethtool -s <interface_name> speed 100 duplex <full/half> Save the changes If you’ve changed any ethernet device parameters using the ethtool, it will all disappear after the next reboot, unless you do the following. On ubuntu, you have to modify /etc/network/interfaces...

Read More

Over 16,000 readers, Get fresh content from “The Linux juggernaut”

Email Subscribe

ABOUT ME..!

My photo
My name is Surendra Kumar Anne. I hail from Vijayawada which is cultural capital of south Indian state of Andhra Pradesh. I am a Linux evangelist who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. At present I work at Bank of America as Sr. Analyst Systems and Administration. You can contact me at surendra (@) linuxnix dot com.