Some networking tools

The ifconfig command

The ifconfig -a command is used to display information about the system's network interfaces:


tille:~> ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:80:29:E9:60:0E  
          inet addr:192.168.42.1  Bcast:192.168.42.255  Mask:255.255.255.0
          inet6 addr: fe80::280:29ff:fee9:600e/10 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:11941732 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10041389 errors:0 dropped:0 overruns:0 carrier:0
          collisions:39583 txqueuelen:100 
          Interrupt:11 Base address:0x340 

eth1      Link encap:Ethernet  HWaddr 00:20:AF:05:21:AC  
          inet6 addr: fe80::220:afff:fe05:21ac/10 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5838232 errors:2 dropped:0 overruns:2 frame:2
          TX packets:4765727 errors:0 dropped:0 overruns:0 carrier:0
          collisions:201 txqueuelen:100 
          Interrupt:5 Base address:0x300 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:363023 errors:0 dropped:0 overruns:0 frame:0
          TX packets:363023 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 

ppp0      Link encap:Point-to-Point Protocol  
          inet addr:217.136.109.80  P-t-P:217.136.104.1  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:1340796 errors:1346706 dropped:0 overruns:0 frame:0
          TX packets:887453 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3 

This host has two network cards and a modem.

The ping, host and traceroute commands

ping: sends a packet to a host, requesting a reply. With ping you can test if a host is reachable. Depending on the system wide configuration, ping may send only one packet, or a packet every second until you tell it to stop.

host: display DNS information about a host.


tille@sprawl:~>host www.belnet.be
www.belnet.be. has address 193.190.198.19
tille@sprawl:~>

dig and nslookup provide similar information.

traceroute: displays the route to a host and some statistics:


tille~:>traceroute www.belnet.be
traceroute to www.belnet.be (193.190.198.19), 30 hops max, 38 byte packets
 1  adsl-59393.turboline.skynet.be (217.136.104.1)  28.528 ms  19.031 ms  16.579 ms
 2  adsl1-atm5-1-0-46.evere.brussels.skynet.be (194.78.255.177)  13.626 ms  13.502 ms  15.359 ms
 3  intl3-gigabitethernet1-0.evere.brussels.skynet.be (195.238.2.137)  15.119 ms  16.550 ms  17.329 ms
 4  pc1.c7206vxr.bnix.belnet.net (194.53.172.111)  17.833 ms  48.631 ms  32.909 ms
 5  dalet.belnet.be (193.190.198.19)  36.456 ms  37.822 ms  16.750 ms
tille~:>