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

Find by Tag

4G Networks 5G Networks 6LoWLAN 6LoWPAN 802.11 802.11ah 802.11ax 802.11ay 802.11az Ad-Hoc Addressing Analysis Ansible Architecture ARP Assessment AToM Automation Baseline BGP Bloom's Taxonomy Bluehost Cable cat CellStream Cellular Central Office Cheat Sheet Chrome Cisco Cloud CMD Company Policy Computer Consulting Data Center Data Networking Dependencies DHCPv6 DNS Docker Documentation Dublin-Traceroute dumpcap Earth Earthquakes ECMP Ethernet Ethics Etiquette Evaluation Field Operations Five Monkey Rule G-MPLS Gauge GeoIP GNS3 Google GQUIC Hands-On History Home Network ICMP ICMPv6 IEEE 802.11p IEEE 802.15.4 India Internet IoT IPv4 IPv6 IRINN IS-IS L2VPN L3VPN LDP LifeNet Linux LLN LoL M-BGP MAC Macro Microsoft Milky Way mininet Monitoring MPLS mtr Multicast Murphy Name Resolution Netcat NetMon netsh Networking nmap NSE Observations OLPC Online School OpenFlow OSPF OSPFv2 OSPFv3 OSX OTT Paris-Traceroute Parrot PIM Policy POTS POTS to Pipes PPP Profile Project Management PW3E QoS QUIC Railroad Remote Desktop Requirements Resume Review RIP Routing RPL RSVP Rural SDN Security Service Provider Small Business SONET Speed SSL Status Storms Subnetting Support SYSCTL T-Shark TCP TCP/IP Telco Telecom 101 Telecommunications Telephone Testing Tools Traceroute Traffic Engineering Training Travel Tunnel Ubuntu Utility Video Virtualbox Virtualization VoIP VRF VXLAN Wi-Fi Wi-Fi 4 Wi-Fi 5 Wi-Fi 6 Windows Wireless Wireless 5G Wireshark WLAN Writing Zenmap ZigBee

Twitter Feed