Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

from this article: the author created a tun interface

# openvpn --mktun --dev tun2
# ip link set tun2 up
# ip addr add dev tun2

then he did a ICMP ping to

# ping
PING ( 56(84) bytes of data.
From icmp_seq=2 Destination Host Unreachable
From icmp_seq=3 Destination Host Unreachable


and he used tshark or tcpdump to capture packets on interface tun2, and he can capture packets as below:

 0.000000 ->     ICMP Echo (ping) request
 0.999374 ->     ICMP Echo (ping) request
 1.999055 ->     ICMP Echo (ping) request

I followed the same procedures, but I can't capture packets like he did, and I don't get Destination Host Unreachable. I think the problem is due to local routing, in his test, it seems that the system regard as the default gateway for subnet, but in my test, it is not the case.

so how can I get the same result as the author's?

BTW, on my machine:

    tun2      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
              inet addr:  P-t-P:  Mask:
              UP POINTOPOINT NOARP MULTICAST  MTU:1500  Metric:1
              RX packets:7 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:100
              RX bytes:420 (420.0 b)  TX bytes:0 (0.0 b)

route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    0      0        0 wlan0   U     0      0        0 tun2   U     2      0        0 wlan0

I don't understand what is the meaning of for gateway, so I did add a route:

route add -net netmask gw

and get

    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface         UG    0      0        0 wlan0   UG    0      0        0 tun2   U     0      0        0 tun2   U     2      0        0 wlan0

still it doesn't work. I really don't understand why.

share|improve this question
Your route table is showing on tun3 not tun2. If you are capturing on the wrong interface, then you aren't going to see anything. – Zoredache Jun 3 '13 at 22:39
this is not the cause. I captured on tun3. Anyway, I edited the question to clear this confusion. – misteryes Jun 3 '13 at 22:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.