Can not read packets from a tun interface

282 Views Asked by At

My plan is to read from one tun interface and write to another.

Here are my command when I set up the interface:

sudo ip tuntap add dev router0 mod tun
sudo ip addr add 10.0.0.138/24 dev router0
sudo 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
    link/none 
    inet 10.0.0.138/24 scope global router0
       valid_lft forever preferred_lft forever

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

Here is my ping 10.0.0.138 output:

PING 10.0.0.138 (10.0.0.138) 56(84) bytes of data.
64 bytes from 10.0.0.138: icmp_seq=1 ttl=64 time=0.063 ms
64 bytes from 10.0.0.138: 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?

0

There are 0 best solutions below