Operation Manual

interface eth0 to 192.168.12.154/30 with standard broadcast (option brd), enter ip
addr add 192.168.12.154/30 brd + dev eth0.
To have a working connection, you must also congure the default gateway. To set a
gateway for your system, enter ip route add gateway_ip_address. To
translate one IP address to another, use nat: ip route add
nat ip_address via other_ip_address.
To display all devices, use ip link ls. To display the running interfaces only, use
ip link ls up. To print interface statistics for a device, enter ip -s link
ls device_name. To view addresses of your devices, enter ip addr. In the output
of the ip addr, also nd information about MAC addresses of your devices. To show
all routes, use ip route show.
For more information about using ip, enter ip help or see the ip(8) man page.
The help option is also available for all ip subcommands. If, for example, you need
help for ip addr, enter ip addr help. Find the ip manual in /usr/share/
doc/packages/iproute2/ip-cref.pdf.
13.6.2.2 Testing a Connection with ping
The ping command is the standard tool for testing whether a TCP/IP connection works.
It uses the ICMP protocol to send a small data packet, ECHO_REQUEST datagram,
to the destination host, requesting an immediate reply. If this works, ping displays a
message to that effect, which indicates that the network link is basically functioning.
ping does more than only test the function of the connection between two computers:
it also provides some basic information about the quality of the connection. In Exam-
ple 13.10, “Output of the Command ping” (page 277), you can see an example of the
ping output. The second-to-last line contains information about the number of trans-
mitted packets, packet loss, and total time of ping running.
As the destination, you can use a hostname or IP address, for example,
ping example.com or ping 192.168.3.100. The program sends packets until
you press Ctrl + C.
276 Reference