Table of Contents
In this article, we will go through 48 Useful ifconfig command examples for Linux Network Administration. ifconfig is also known as Interface Configuration. It is a free and open source utility to configure a network interface. It is also used by many Linux professionals to troubleshoot and debug networking related issues. ifconfig command can be obtained by installing net-tools package in your System. More on ifconfig command Man page. We will see some real world examples of ifconfig command in below section.
Synopsis
ifconfig [-v] [-a] [-s] [interface]
ifconfig [-v] interface [aftype] options | address ...
ifconfig command examples for Linux Network Administration
Also Read: Solved "-bash: ifconfig: command not found" error in CentOS/Redhat 7/8
Example 1: How to Check ifconfig command version
If you want to check ifconfig command version then you need to use ifconfig --version
command.
[root@localhost ~]# ifconfig --version
net-tools 2.10-alpha
Example 2: How to Check Network Interface Address
If you want to check all active network interfaces then you need to use ifconfig
command without any arguments as shown below. In my system, I can see two active network interfaces - enp0s3
and lo
. Similarly, you can check in your System. This list might be different for you.
[root@localhost ~]# ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.29.75 netmask 255.255.255.0 broadcast 192.168.29.255
ether 08:00:27:0b:3e:c5 txqueuelen 1000 (Ethernet)
RX packets 675 bytes 60287 (58.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 95 bytes 12119 (11.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Below are some of the important field from above ifconfig command output:-
- inet addr is IPv4 address assigned to the interface.
- inet6 addr is IPv6 address assigned to the interface.
- UP shows that interface is activated and running fine.
- BROADCAST packets are used to obtain IP address via DHCP.
- RUNNING shows that interface is ready to accept data.
- MULTICAST shows that interface supports multicasting.
- MTU is maximum transmission unit of the network interface.
- RX packets is a total number of packets received.
- RX errors shows a total number of packets received with error.
- RX dropped is a number of dropped packets due to unintended VLAN tags.
- RX overruns is a number of received packets that experienced fifo overruns.
- RX frame is the total number of misaligned frames.
- TX packets is total number of packets transmitted.
- TX errors is the total number of packets transmitted with error.
- TX dropped is a number of dropped packets due to unintended VLAN tags.
- TX overruns is the number of transmitted packets that experienced fifo overruns.
- TX carriers is the number of packets that experienced loss of carriers.
- TX collisions is the number of transmitted packets that experienced Ethernet collisions.
- TX txqueuelen is the length of the transmission queue.
- RX bytes is a total number of bytes received over interface.
- TX bytes is a total number of bytes transmitted over interface.
Example 3: How to Check all Network Interfaces
If you want to check every single network interface present in your System including the ones which are currently down then you need to use ifconfig -a
command as shown below. If you notice, in my case ifconfig
and ifconfig -a
command output are same as all the interfaces are up.
[root@localhost ~]# ifconfig -a
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.29.75 netmask 255.255.255.0 broadcast 192.168.29.255
ether 08:00:27:0b:3e:c5 txqueuelen 1000 (Ethernet)
RX packets 78 bytes 9431 (9.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 65 bytes 8735 (8.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Example 4: How to Display Short List of Network Interfaces
If you don't want the detailed information about your network interfaces then you also have the option to display the short list using ifconfig -s
command as shown below.
[root@localhost ~]# ifconfig -s
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
enp0s3 1500 786 0 0 0 154 0 0 0 BMRU
lo 65536 0 0 0 0 0 0 0 0 LRU
Example 5: How to Check Detailed List of Network Interfaces
If you are looking to check the detailed information about your network interfaces then might want to use -v
option with ifconfig command. This option is more helpful when you are troubleshooting any networking issues and you want to check the complete information.
[root@localhost ~]# ifconfig -v
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.29.75 netmask 255.255.255.0 broadcast 192.168.29.255
ether 08:00:27:0b:3e:c5 txqueuelen 1000 (Ethernet)
RX packets 132 bytes 13381 (13.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 68 bytes 8883 (8.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Example 6: How to Check a Specific Network Interface
Instead of checking all the network interfaces, you can also check a specific network interface by using ifconfig <network_interface>
syntax. In this example, we are checking enp0s3
network interface using ifconfig enp0s3
command as shown below.
[root@localhost ~]# ifconfig enp0s3
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.29.75 netmask 255.255.255.0 broadcast 192.168.29.255
ether 08:00:27:0b:3e:c5 txqueuelen 1000 (Ethernet)
RX packets 185 bytes 17735 (17.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 87 bytes 11868 (11.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Example 7: How to Activate a Network Interface
If you are looking to activate a network interface then you need to use ifconfig <interface> up
syntax. In this example we are activating enp0s3
interface using ifconfig enp0s3 up
command as shown below.
[root@localhost ~]# ifconfig enp0s3 up
Example 8: How to Shutdown a Network Interface
If you are looking to shutdown a network interface then you need to use ifconfig <interface> down
syntax. In this example, we are bringing down the network interface enp0s3 using ifconfig enp0s3 down command as you can see below.
[root@localhost ~]# ifconfig enp0s3 down
Example 9: How to Assign an IPv4 Address to a Network Interface
If you want to assign an IPv4 address to a network interface then you need to use ifconfig <interface> <ipv4_address>
command. In this example, we are assigning 192.168.29.75
IPv4 address to enp0s3
network interface using ifconfig enp0s3 192.168.29.75
command as you can see below.
[root@localhost ~]# ifconfig enp0s3 192.168.29.75
Example 10: How to Check the MTU of a Network Interface
MTU is known as Maximum Transmission Unit. It is the largest packet size that can be transmitted through an interface. If you want to check the MTU of a network interface then you need to filter the mtu
keyword from ifconfig enp0s3
command output as shown below. As you can see interface enp0s3 has an mtu set to 1500
.
[root@localhost ~]# ifconfig enp0s3 | grep mtu enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
Example 11: How to Change the MTU of a Network Interface
If you want to change the MTU value of a network interface then you need to use ifconfig <interface> mtu <value>
syntax. In this example we are setting the MTU of network interface enp0s3 to 1000 using ifconfig enp0s3 mtu 1000
command as you can see below.
[root@localhost ~]# ifconfig enp0s3 mtu 1000
Example 12: How to Check the Broadcast IP of a Network Interface
If you only want to check the broadcast IP of a network interface then you need to filter the broadcast
keyword from ifconfig enp0s3
output as shown below. As you can see broadcast IP is currently set to 192.168.29.255
.
[root@localhost ~]# ifconfig enp0s3 | grep broadcast inet 192.168.29.75 netmask 255.255.255.0 broadcast 192.168.29.255
Example 13: How to Assign the Broadcast IP to a Network Interface
If you want to assign broadcast IP to a network interface then you need to use ifconfig <interface> broadcast <broadcast_ip>
syntax. In this example, we are setting broadcast IP 192.168.29.255
to interface enp0s3
using ifconfig enp0s3 broadcast 192.168.29.255
command.
[root@localhost ~]# ifconfig enp0s3 broadcast 192.168.29.255
Example 14: How to Check the netmask of a Network Interface
If you only want to check the netmask of a network interface then you need to filter netmask
keyword from ifconfig enp0s3
command output as shown below. As you can see netmask value is currently set to 255.255.255.0
.
[root@localhost ~]# ifconfig enp0s3 | grep netmask inet 192.168.29.75 netmask 255.255.255.0 broadcast 192.168.29.255
Example 15: How to Assign netmask to a Network Interface
If you want to assign a netmask to a network interface then you need to use ifconfig <interface> netmask <mask>
syntax. In this example, we are assigning netmask 255.255.255.0
to interface enp0s3
using ifconfig enp0s3 netmask 255.255.255.0
command as shown below.
[root@localhost ~]# ifconfig enp0s3 netmask 255.255.255.0
Example 16: How to Check Promisc flag on a Network Interface
In general not all of the packets will be intercepted by the network interface but in case you want it to intercept all the network packets then you can enable promiscuous mode. If you want to check promisc
flag enabled on a network interface then you need to filter PROMISC
keyword from ifconfig enp0s3
command output as shown below. Here you can see promiscuous mode is currently enabled on enp0s3
network interface.
[root@localhost ~]# ifconfig enp0s3 | grep PROMISC enp0s3: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST> mtu 1500
Example 17: How to Enable Promiscuous Mode for a Network Interface
If you want to enable promiscuous mode for a network interface then you need to use ifconfig <interface> promisc
syntax. In this example, we are setting promisc
mode for interface enp0s3
using ifconfig enp0s3 promisc
command as shown below.
[root@localhost ~]# ifconfig enp0s3 promisc
Example 18: How to Disable Promiscuous Mode
If you want to disable the Promiscuous mode then you need to add hyphen(-)
with promisc
option as shown below. In this example, we are disabling promiscuous mode from network interface enp0s3
using ifconfig enp0s3 -promisc
command as shown below.
[root@localhost ~]# ifconfig enp0s3 -promisc
Example 19: How to Check Multicast Flag on a Network Interface
If you want to check Multicast flag set on a network interface or not then you need to filter the MULTICAST
keyword from ifconfig enp0s3
command output as shown below.
[root@localhost ~]# ifconfig enp0s3 | grep MULTICAST enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
Example 20: How to Check the IPv4 Address of a Network Interface
If you only want to check the IPv4 address assigned to a network interface then you need to filter inet
keyword from ifconfig enp0s3
command output as shown below. As you can see IPv4 address is currently set to 192.168.29.75
.
[root@localhost ~]# ifconfig enp0s3 | grep inet inet 192.168.29.75 netmask 255.255.255.0 broadcast 192.168.29.255
Example 21: How to Set IPv4 Address, Netmask and Broadcast IP on a Network Interface
If you want to set IPv4 address, netmask and Broadcast IP altogether on a network interface then you need to use ifconfig <interface> <ipv4_address> netmask <mask> broadcast <broadcast_ip>
syntax. In this example we are setting IPv4 address 192.168.29.75
, netmask 255.255.255.0
and broadcast IP 192.168.29.255
to network interface enp0s3 using ifconfig enp0s3 netmask 255.255.255.0 broadcast 192.168.29.255
command as shown below.
[root@localhost ~]# ifconfig enp0s3 192.168.29.75 netmask 255.255.255.0 broadcast 192.168.29.255
Example 22: How to Add an Alias to a Network Interface
Alias feature allows us to create additional network interfaces in Linux. If you want to add an alias to a network interface then you need to use below ifconfig command. Here we are adding an alias enp0s3:0
to network interface enp0s3
and assigning an ipv4 address 192.168.29.76
using ifconfig enp0s3:0 192.168.29.76
command as shown below.
[root@localhost ~]# ifconfig enp0s3:0 192.168.29.76 [root@localhost ~]# ifconfig -a enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.29.75 netmask 255.255.255.0 broadcast 192.168.29.255 ether 08:00:27:0b:3e:c5 txqueuelen 1000 (Ethernet) RX packets 2134 bytes 221372 (216.1 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1058 bytes 130503 (127.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp0s3:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.29.76 netmask 255.255.255.0 broadcast 192.168.29.255 ether 08:00:27:0b:3e:c5 txqueuelen 1000 (Ethernet) lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Example 23: How to Remove an Alias
If you want to remove an alias then you need to use ifconfig <alias> down
syntax. In this example we are removing an alias enp0s3:0
using ifconfig enp0s3:0 down
command as shown below.
[root@localhost ~]# ifconfig enp0s3:0 down [root@localhost ~]# ifconfig -a enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.29.75 netmask 255.255.255.0 broadcast 192.168.29.255 ether 08:00:27:0b:3e:c5 txqueuelen 1000 (Ethernet) RX packets 2191 bytes 226544 (221.2 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1092 bytes 135230 (132.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Example 24: How to Check the MAC Address of a Network Interface
If you are looking to check only the MAC address of your Network Interface then you need to filter ether
keyword from ifconfig enp0s3
command output as shown below.
[root@localhost ~]# ifconfig enp0s3 | grep ether ether 08:00:27:0b:3e:c5 txqueuelen 1000 (Ethernet)
Example 25: How to Change the MAC Address of a Network Interface
You can also change the MAC Address of a network interface by first shutting down the interface using below ifconfig command.
[root@localhost ~]# ifconfig enp0s3 down
Then change the address using ifconfig enp0s3 hw ether AA:BB:CC:DD:EE
command.
[root@localhost ~]# ifconfig enp0s3 hw ether AA:BB:CC:DD:EE
Once done, bring up the interface using ifconfig enp0s3 up
command as shown below.
[root@localhost ~]# ifconfig enp0s3 up
Example 26: How to enable ARP Protocol for a Network Interface
ARP is known as Address Resolution Protocol. It is used to map the IPv4 address to MAC Address. If you want to enable ARP protocol for your network interface then you need to use ifconfig <interface> arp
syntax. In this example we are enabling ARP protocol for enp0s3
interface using ifconfig enp0s3 arp
command as shown below.
[root@localhost ~]# ifconfig enp0s3 arp
Example 27: How to Disable ARP Protocol for a Network Interface
If you want to disable ARP protocol on a network interface then you just need to add hyphen(-)
with arp
option as shown below. In this example we are disabling arp protocol for enp0s3
interface using ifconfig enp0s3 -arp
command as shown below.
[root@localhost ~]# ifconfig enp0s3 -arp
Example 28: How to Enable Point to Point Mode on an Interface
When you want to establish a direct link between two system without anyone listening in between then using pointopoint
option might be the best choice. In this example, a source system with IPv4 address 192.168.29.75
is connecting directly to destination system of IPv4 address 192.168.29.76
using ifconfig enp0s3 192.168.29.75 pointopoint 192.168.29.76
command as shown below.
[root@localhost ~]# ifconfig enp0s3 192.168.29.75 pointopoint 192.168.29.76
Example 29: How to Disable Point to Point Mode on an Interface
If you want to disable point to point mode on an interface then you need to use hyphen(-)
with pointopoint
option as shown below. This example has the same command as above with hypen(-)
being the only addition to remove the Point to Point connection.
[root@localhost ~]# ifconfig enp0s3 192.168.29.75 -pointopoint 192.168.29.76
Example 30: How to Check the Length of the Transmit Queue
If you want to check the length of the transmit queue then you need to filter txqueuelen
keyword from ifconfig enp0s3
command output as shown below. Here transmit queue length is set to 1000
.
[root@localhost ~]# ifconfig enp0s3 | grep txqueuelen ether 08:00:27:0b:3e:c5 txqueuelen 1000 (Ethernet)
Example 31: How to Set the Length of the Transmit Queue
If you want to set the length of the transmit queue then you need to use ifconfig <interface> txqueuelen <value>
syntax. In this example we are setting transmit queue value to 2000
using ifconfig enp0s3 txqueuelen 2000
command as shown below.
[root@localhost ~]# ifconfig enp0s3 txqueuelen 2000 [root@localhost ~]# ifconfig enp0s3 | grep txqueuelen ether 08:00:27:0b:3e:c5 txqueuelen 2000 (Ethernet)
Example 32: How to Create a Tunnel to the Destination
In Linux, you can establish a tunnel between two systems to keep the connections dedicated and private using a sit(IPv6-in-IPv4) device. If you want to create a tunnel using ifconfig
command then first you need to bring up the sit0 device using ifconfig sit0 up
command.
[root@localhost ~]# ifconfig sit0 up
Confirm the interface status by using ifconfig sit0
command.
[root@localhost ~]# ifconfig sit0
sit0: flags=193<UP,RUNNING,NOARP> mtu 1480
inet6 ::192.168.29.76 prefixlen 96 scopeid 0x80<compat,global>
inet6 ::127.0.0.1 prefixlen 96 scopeid 0x90<compat,host>
sit txqueuelen 1000 (IPv6-in-IPv4)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Next is to add the local 6to4 address using below ifconfig command. Here we are adding local 6to4 address 1001:60c0:b706::1/16
to sit0 device using ifconfig sit0 add 1001:60c0:b706::1/16
command.
[root@localhost ~]# ifconfig sit0 add 1001:60c0:b706::1/16
Finally we need to add the route to the global IPv6 network using 6to4 relay as shown below.
[root@localhost ~]# route -A inet6 add 2000::/3 gw ::192.168.29.1 dev sit0
Example 33: How to Remove the Created Tunnel
To remove the tunnel, first you need to remove the route using below command.
[root@localhost ~]# route -A inet6 del 2000::/3 gw ::192.168.29.1 dev sit0
Then delete the 6to4 address using below ifconfig command.
[root@localhost ~]# ifconfig sit0 del 1001:60c0:b706::1/16
Finally delete the sit0 device by using ifconfig sit0 down
command as shown below.
[root@localhost ~]# ifconfig sit0 down
Example 34: How to Enable All Multicast Mode for a Network Interface
If you want to enable All Multicast mode for a network interface then you need to use ifconfig enp0s3 allmulti
command as shown below.
[root@localhost ~]# ifconfig enp0s3 allmulti
Verify it by filtering the ALLMULTI
keyword from ifconfig enp0s3
output.
[root@localhost ~]# ifconfig enp0s3 | grep ALLMULTI enp0s3: flags=4675<UP,BROADCAST,RUNNING,ALLMULTI,MULTICAST> mtu 1500
Example 35: How to Disable All Multicast Mode
If you want to disable all multicast mode from a network interface then you need to add hyphen(-)
with allmulti
option as shown below. In this example, we are disabling all multicast mode from enp0s3
interface using ifconfig enp0s3 -allmulti
command as shown below.
[root@localhost ~]# ifconfig enp0s3 -allmulti
Example 36: How to Assign IPv6 Address to an Interface
You can also assign an IPv6 address to an interface using ifconfig
command.
[root@localhost ~]# ifconfig enp0s3 add 1001:0428:0:e101::1/64
If you now check the output by filtering inet6
keyword from ifconfig enp0s3
output then you should see the assigned IPv6 address on the output as shown below.
[root@localhost ~]# ifconfig enp0s3 | grep inet6 inet6 1001:428:0:e101::1 prefixlen 64 scopeid 0x0<global>
Example 37: How to Remove IPv6 Address from an Interface
If you want to remove IPv6 address from an interface then you need to use ifconfig <interface> del <ipv6>
syntax. In this example we are removing IPv6 address 1001:0428:0:e101::1/64
from interface enp0s3 using ifconfig enp0s3 del 1001:0428:0:e101::1/64
command as shown below.
[root@localhost ~]# ifconfig enp0s3 del 1001:0428:0:e101::1/64
Example 38: How to Check the Transmission Status
If you only want to check the transmission status then you can filter RUNNING
keyword from ifconfig enp0s3
output as shown below.
[root@localhost ~]# ifconfig enp0s3 | grep RUNNING enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
Example 39: How to Check the Transmission Errors
If you want to check the transmission errors then you need to filter errors
keyword from ifconfig enp0s3
command output as shown below.
[root@localhost ~]# ifconfig enp0s3 | grep errors RX errors 0 dropped 0 overruns 0 frame 0 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Example 40: How to Check the total no of bytes received over the Interface
If you want to check the total number of bytes received over the interface then you need to filter the RX keyword from ifconfig enp0s3 | grep bytes command output as shown below.
[root@localhost ~]# ifconfig enp0s3 | grep bytes | grep RX RX packets 361 bytes 34935 (34.1 KiB)
Example 41: How to Check the total number of bytes transmitted over the Interface
If you want to check the total number of bytes transmitted over the interface enp0s3
then you need to filter the TX
keyword from ifconfig enp0s3 | grep bytes
command output as shown below.
[root@localhost ~]# ifconfig enp0s3 | grep bytes | grep TX TX packets 228 bytes 27710 (27.0 KiB)
Example 42: How to check the number of transmitted packets that experienced Ethernet collisions
If you want to check the number of transmitted packets that experienced ethernet collisions then you need to filter collisions keyword from ifconfig enp0s3
command output as you can see below. Here collisions value is 0 which means there are no transmitted packets that experienced ethernet collisions.
[root@localhost ~]# ifconfig enp0s3 | grep collisions TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Example 43: How to Check the number of packets that experienced loss of carriers
If you want to check the number of packets that experienced loss of carriers then you need to filter carrier keyword from ifconfig enp0s3
command as shown below. Here the carrier value is 0 which means there are no packets that experienced loss of carriers.
[root@localhost ~]# ifconfig enp0s3 | grep carrier TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Example 44: How to Check the number of misaligned frames
If you want to check the number of misaligned frames then you need to grep frame
keyword from ifconfig enp0s3
command output as shown below. Here the frame value is 0 which means there are no misaligned frames.
[root@localhost ~]# ifconfig enp0s3 | grep frame RX errors 0 dropped 0 overruns 0 frame 0
Example 45: How to check the number of received packets that experienced fifo overruns
If you want to check the number of received packets that experience fifo overruns then you need to filter overruns
keyword from ifconfig enp0s3 | grep RX
command output as shown below. Here overruns is showing a value of 0 which means that there are no received packets that experienced fifo overruns.
[root@localhost ~]# ifconfig enp0s3 | grep RX | grep overruns RX errors 0 dropped 0 overruns 0 frame 0
Example 46: How to Check the number of dropped packets due to unintended VLAN tags
If you want to check the number of dropped packets due to unintended VLAN tags then you need to filter dropped
keyword from ifconfig enp0s3 | grep RX
command output as shown below. Since here dropped value is 0 so there are no dropped packets due to unintended VLAN tags.
[root@localhost ~]# ifconfig enp0s3 | grep RX | grep dropped RX errors 0 dropped 0 overruns 0 frame 0
Example 47: How to Check the Man Page of ifconfig command
If you want to check the man page of ifconfig command then you need to use man ifconfig
command as shown below.
[root@localhost ~]# man ifconfig
IFCONFIG(8) Linux System Administrator's Manual IFCONFIG(8)
NAME
ifconfig - configure a network interface
SYNOPSIS
ifconfig [-v] [-a] [-s] [interface]
ifconfig [-v] interface [aftype] options | address ...
NOTE
This program is obsolete! For replacement check ip addr and ip link. For statistics use ip -s link.
DESCRIPTION
Ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it
is usually only needed when debugging or when system tuning is needed.
If no arguments are given, ifconfig displays the status of the currently active interfaces. If a single interface argument is given, it displays
the status of the given interface only; if a single -a argument is given, it displays the status of all interfaces, even those that are down.
Otherwise, it configures an interface.
Example 48: How to Check all the options available with ifconfig command
If you want to check all the options available with ifconfig command then you need to use ifconfig --help
command as you can see below.
[root@localhost ~]# ifconfig --help
Usage:
ifconfig [-a] [-v] [-s] <interface> [[<AF>] <address>]
[add <address>[/<prefixlen>]]
[del <address>[/<prefixlen>]]
[[-]broadcast [<address>]] [[-]pointopoint [<address>]]
[netmask <address>] [dstaddr <address>] [tunnel <address>]
[outfill <NN>] [keepalive <NN>]
[hw <HW> <address>] [mtu <NN>]
[[-]trailers] [[-]arp] [[-]allmulti]
[multicast] [[-]promisc]
[mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]
[txqueuelen <NN>]
[[-]dynamic]
[up|down] ...