Networking/Computing Tips/Tricks

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?

Let us know in the comments!

 

 

 

Comments powered by CComment

The nicest thing you can do is use these inks to support us!  Thank you!

Support our research!  Buy me a coffee :)

Support our research. Become a Patron!

Find by Tag

4G Networks 5G Networks 6in4 6LoWLAN 6LoWPAN 802.11 802.11ah 802.11ax 802.11ay 802.11az Addressing Analysis Ansible Architecture ARP AToM BGP Bloom's Taxonomy Broadband Cable cat CBRS CellStream Cellular Central Office Cheat Sheet Chrome Cisco Cloud Coloring Rules Computer Consulting CPI Customer Support Data Center Data Networking DHCPv6 DNS Docker Documentation Dublin-Traceroute dumpcap ECMP Ethernet Ethics Fragmentation G-MPLS Git GNS3 Google GQUIC Hands-On History Home Network ICMP ICMPv6 IEEE 802.11p IEEE 802.15.4 Interface Control Internet IoT IPsec IPv4 IPv6 IS-IS L2VPN L3VPN LDP Linux LLN LoL M-BGP MAC MAC OSx Macro Microsoft mininet Monitoring MPLS MTU Multicast My Room Name Resolution Netcat Netmiko NetMon netsh Networking Network Science nmap Npcap Online School OpenFlow OSPF OSPFv2 OSPFv3 OSX OTT Paris-Traceroute Parrot PIM pktmon PMTU Policy POTS POTS to Pipes PPP Profile Programming Project Management Protocol 41 PW3E Python QoS QUIC Remote Desktop Requirements RIP Routing RPL RSVP Rural SAS SDN Security Service Provider Small Business SONET Speed SS7 SSH SSL Subnetting SYSCTL T-Shark TCP TCP/IP Telco Telecom 101 Telecommunications Telephone termshark TLS Tools Traceroute Traffic Engineering Training Travel Tunnel Ubuntu Utility Video Virtualbox Virtualization VoIP VRF VXLAN Webex WEP Wi-Fi Wi-Fi 4 Wi-Fi 5 Wi-Fi 6 Wi-Fi 6/6E Windows Winpcap Wireless Wireless 5G Wireshark Wireshark Tip WLAN WPA2 Zenmap ZigBee Zoom

Support us by clicking:

Twitter Feed