Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Oct 082012

Modern way to show current IP address(es) in Linux


In the past we already showed that you can get the IP information using the command "ifconfig", actually the modern way to do the job is

# ip a

1: lo:  mtu 16436 qdisc noqueue state UNKNOWN 

2: eth0:  mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:26:5e:3e:42:d2 brd ff:ff:ff:ff:ff:ff
Jul 092012

How to show current routing table


To show the current system's routing table, you can try:

# sudo netstat -nr
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface         UG        0 0          0 eth0         UG        0 0          0 eth0   U         0 0          0 eth0   U         0 0          0 eth0
Jun 212012

Network sniffing with tcpflow


Wireshark is the De facto standard in network sniffing, but most of the time you might just want to analyse the content passing through your web browser or web server, then it is easy with tcpflow

For example, to show your communication with to console, you can use

sudo tcpflow -c -i en0 src or dst host