Networking/Computing Tips/Tricks

Rate this content:
5 of 5 - 2 votes
Thank you for rating this article.

One way to examine your network configuration in Linux is to use the "ip" command.  I have attached a cheat sheet from Red Hat.

By itself, it will show its options:

Screenshot from 2018 10 26 07 35 26 

So much going on here, and I find the help and man pages to be light on clarity and examples.

So let's explore.

Let's do the 'ip addr' command to display the addresses currently set on the machine (you could also have just typed 'ip a'):

Screenshot from 2018 10 26 07 41 06 

Because I have IPv6 running in my network, I have a lot more information than if I did not.  Nonetheless, we still see IPv4 information as well.  

You can see that I am connected wia my Wireless adapter, and the my wored Ethernet is not connected.  You can also see I must be running VirtualBox on this computer.

Before we dig any deeper, the new naming scheme is shown - look at my #2 interface: 'enp3s0'. 

Here is how it works:  It is referred to as the "Predictable Network Interface" naming.  It has been used on systemd-based Linux systems for some time now.  The interface name depends on the physical location of the hardware.  The "en" simply means "Ethernet", just like "eth" did in the prior naming schema "eth0".  The "p" is the bus or port number of the Ethernet NIC, and the "s" is the slot number (being that a card may have multiple slots).  So "enp3s0" means Ethernet, Port/Bus 3, Slot 0.

I am going to plug my wired Ethernet in to see the difference:

Screenshot from 2018 10 26 07 50 02

Now we see the 'enp3s0' interface has come up and has addresses as well.

What if you just wanted to view the IPv4 addresses?  Use the 'ip -4 addr' command:

Screenshot from 2018 10 26 10 28 47

For just IPv6, replace the '-4' with '-6'.

A couple of other definitions:

  • BROADCAST the interface supports broadcasting
  • MULTICAST the interface supports multicasting
  • UP the network interface is enabled
  • LOWER_UP is a physical layer link flag (the layer below the network layer, where IP is generally located). LOWER_UP indicates that an Ethernet cable was plugged in and that the device is connected to the network.  LOWER_UP differs from UP, which additionally requires the network interface to be enabled.

To just show a particular interface information, use the command 'ip addr show enp3s0':

Screenshot from 2018 10 26 11 27 04

Let's say you wanted to troubleshoot at Layer 2. 

You can view L2 information as follows with the 'ip link' command:

Screenshot from 2018 10 26 12 06 46

You can display the L2 statistics with the 'ip -s link show enp3s0' command to look at the Ethernet interface:

Screenshot from 2018 10 26 10 32 17

There are a number of other things you can do with the 'ip' command.  Let's look at some.

You can view the IP neighbors (think Neighbor Discovery in IPv6 and ARP in IPv4) with the 'ip neigh' command: 

Screenshot from 2018 10 26 10 24 56

You may want to see what Multicast Group addresses your interface belongs to.  Do this with the 'ip maddress show enp3s0' (this is particularly important for IPv6 networking):

Screenshot from 2018 10 26 11 29 29

You can view the current routing - what network is on which interface - with the 'ip route' command:

;Screenshot from 2018 10 26 10 26 44

What else have you found helpfull with this command?

I hope you find this article and its content helpful.  Comments are welcomed below.  If you would like to see more articles like this, please support us by clicking the patron link where you will receive free bonus access to courses and more, or simply buying us a cup of coffee!, and all comments are welcome!




Add comment


Did you learn something?
Did I save you time? 

Buy me a coffeeBuy me a coffee!

Find by Tag

5G Networks 6LoWLAN 6LoWPAN 802.11 802.11ah 802.11ax 802.11ay 802.11az ACL Addressing Analysis Ansible Architecture ARP Assessment AToM Backup Bandwidth BGP Bibliography Biography Briefings CBRS CellStream Cellular Central Office Cheat Sheet Chrome Cisco Clock Cloud Computer Consulting CPI Data Center Data Networking Decryption DHCPv4 DHCPv6 Display Filter DNS Documentation ECMP EIGRP Ethernet Flipping the Certification Model Follow Me Fragmentation Git GNS3 Google GQUIC Hands-On History Home Network HTTPS ICMP ICMPv6 IEEE 802.11p IEEE 802.15.4 In A Day Internet IOS Classic IoT IPv4 IPv6 L2 Switch L2VPN L3VPN LDP Learning Services Linux LLN Logging LoL M-BGP MAC MAC OSx Macro Microsoft mininet Monitoring Monitor Mode MPLS Multicast Name Resolution Netflow NetMon netsh Networking Network Science nmap Npcap nslookup Online Learning Online School OpenFlow OSPF OSPFv2 OSPFv3 OSX Parrot Passwords pcap pcap-ng PIM Ping Policy Port Mirror POTS POTS to Pipes PPP Profile Profiles Programming Project Management Python QoS QUIC Requirements RFC RIP Routing RPL RSVP SAS SDN Security Self Certification Service Provider Small Business Smartport SONET Span Port SSH SSL Subnetting T-Shark TCP TCP/IP Telco Telecom 101 Telecommunications Telnet Terminal TLS Tools Traceroute Traffic Analysis Traffic Engineering Training Travel Troubleshooting Tunnel Utility Video Virtualbox Virtualization Voice VoIP VXLAN Webex Wi-Fi Wi-Fi 4 Wi-Fi 5 Wi-Fi 6 Wi-Fi 6/6E Windows Wireless Wireless 5G Wireshark Wireshark Tip WLAN ZigBee Zoom

Twitter Feed