Here are my command when I set up the interface:

 ip tuntap add dev router0 mod tun
 ip addr add dev router0
 ip link set dev router0 up

Here is the output of ip addr show dev router0

8: router0: <NO-CARRIER,POINTOPOINT,MULTICAST,NOARP,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 500
    inet scope global router0
       valid_lft forever preferred_lft forever

As you see, the state says down despite me using ip link set dev router0 up.

When I try to ping listen on the interface using tshark via sudo tshark -i router0, nothing happens.

Here is my ping output:

PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.063 ms
64 bytes from icmp_seq=2 ttl=64 time=0.058 ms

Here is my sudo tshark -i router0 output:

Capturing on 'router0'

Nothing is coming through

What is the problem?

  • 1
    So what are you actually trying to achieve? A TUN interface does nothing on its own. You must have software that does something with it.
    – Daniel B
    Commented Jun 15, 2022 at 19:55
  • For a project, I am creating a router that has a routing table and reads/writes to interfaces. I will be using tun interfaces as my router's interfaces to receive/send packets from. Commented Jun 15, 2022 at 19:58


You must log in to answer this question.

Browse other questions tagged .