Some programs found in most linux distributions can help us understand better the current state of our networks. In this section you will find a short description of some of them.
ping is a basic network command line tool that is very useful to test network connectivity. It sends an echo request to a target host using the Internet Control Message Protocol (ICMP), which is an auxiliary prococol of the Internet Protocol (IP).
if the echo request reaches the target host, it will answer with an echo response back.
to use ping just issue:
$ ping <ip_addr>
replacing <ip_addr>
with the destination's IP address.
the ip command is a powerful tool to show and manipulate network devices, routing, interfaces and tunnels.
useful ip commands are:
ip address
: display addresses on interfaces and their properties. Can also add new addresses and delete old ones.
ip route
: show the routing table. You can also add or delete a route using ip route add <destination> via <gateway>
ip link
: show the state of the network interfaces
iperf is a tool used for measuring network performance by quantifying the achievable bandwith in IP networks. It works using a client server model and can be used using both the TCP and UDP transport protocols.
To measure bandwidth using iperf, start the command on the server machine as follows:
iperf -s
and on the client machine:
iperf -c <server_ip>
tcpdump is a program that is used to capture and analyze traffic from a network interface. It can also filter based on protocols, destination or source ip address, destination or source port (in case of tcp or udp), etc.
to start tcpdump simply issue:
tcpdump -i <interface>
One way to log into your device is by finding out its IPv6 address through IPv6 broadcast pings. For that, you can assign an IPv6 address to the ethernet interface on your host machine which is connected to the device and issue a broadcast ping with:
$ ping -v ff02::1%<interface_name>
Replace <interface_name> with the name of the interface you are connecting to the device with.
Example of running a broadcast ping
$ ping ff02::1%enx34298f711a12
PING ff02.1%enx34298f711a12(ff022::1%enx34298f711a12) 56 data bytes
64 bytes from fe80::15%enx34298f711a12: icmp seq=1 ttl=64 tlme=0.028 ms
64 bytes from fe80::c693:ff:fela:a35d%enx34298f711a12 icmp seq=1 ttl=64 time2.75 ms (DUP!)
NOTE: Device with a longer ping time and the (DUP!) marker is likely to be the desired device
The device will reply and the output will show the device’s IPv6 address, which you can then use to log in with ssh, like:
$ ssh root@<ip:v6:addr>%<interface_name>
You should now see the device’s welcome message.
You can now issue commands directly on the device. This includes previously discussed ping commands as well as the Meshmerize CLI commands