You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

Network utils: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>Hashar
 
imported>Ayounsi
(Redirected page to Network cheat sheet)
 
Line 1: Line 1:
here's some useful stuff i use to diagnose network problems:
#REDIRECT [[Network cheat sheet]]
 
* IP addresses
<pre>
[root@ariel root]# ip addr
1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
    inet6 ::1/128 scope host
      valid_lft forever preferred_lft forever
4: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:50:45:5b:d0:8c brd ff:ff:ff:ff:ff:ff
    inet 207.142.131.244/26 brd 207.142.131.255 scope global eth0
    inet6 2001:470:1f01:367:250:45ff:fe5b:d08c/64 scope global deprecated dynamic
      valid_lft 1897645sec preferred_lft -89555sec
    inet6 fe80::250:45ff:fe5b:d08c/64 scope link
      valid_lft forever preferred_lft forever
5: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:50:45:5b:d0:8d brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.2/16 brd 10.0.255.255 scope global eth1
    inet6 fe80::250:45ff:fe5b:d08d/64 scope link
      valid_lft forever preferred_lft forever
6: sit0: <NOARP> mtu 1480 qdisc noop
    link/sit 0.0.0.0 brd 0.0.0.0
</pre>
iproute2 is much better than ifconfig; example:
ip addr add 10.0.0.3 dev eth0
....
ip addr del 10.0.0.3 dev eth0
with no need for eth0:X virtual interfaces
 
ip route add default via 10.0.0.4
 
*packet sniffing; tcpdump:
tcpdump -s 1520 -lni eth0 host bacon and port not 22
(exclude port 22 to avoid seeing your own traffic)
* or tethereal (nicer for some things, can decode http requests, mysql data streams etc):
tethereal -s 1520 -ni eth0 host bacon and port not 22
 
* arping: like ping but uses ARP instead of ICMP (gets through firewall on the LAN)
 
[[Category:Network]]
[[Category:Network]]

Latest revision as of 22:23, 21 December 2017