[ECOS] TAP device not created on running "ping_test"

Mandeep Sandhu mandeepsandhu.chd@gmail.com
Mon Jul 27 13:44:00 GMT 2009

> Hi Mandeep
> I would narrow a circle. First, try to bring up and configure any tapN
> device on a host handy (without rawether and eCos app). Test then that
> interface. I found that `tunctl' utility is very useful for that. I'd
> installed it from sources, but, the utility exists in the Ubuntu's
> `uml-utilities' package.
> I want to believe that is host-side issue. It's just command to start
> man tunctl
> Create (tunctl), configure (ifconfig/route) e.g. tap0 device and check
> that works as you could expect (ping). Then go to eCos network tests.

Thanks for pointing out tunctl. But I'm not able to get ping to work...!

I created a device tap0. Assigned it an IP addr:
Then I setup eth0 with IP

$ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:1d:09:54:e6:e3
          inet addr:  Bcast:  Mask:
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

$ ifconfig tap0
tap0      Link encap:Ethernet  HWaddr 4e:54:8e:5a:9e:80
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::4c54:8eff:fe5a:9e80/64 Scope:Link
          RX packets:52 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:17 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:2184 (2.1 KB)  TX bytes:0 (0.0 B)

pinging each of these IP's obviously works as the kernel sees these 2
IP addr's as assigned local interfaces, so I guess the packets never go out
of the interface.

$ ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.044 ms
--- ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.044/0.044/0.044/0.000 ms
$ ping
PING ( 56(84) bytes of data.
64 bytes from icmp_seq=1 ttl=64 time=0.041 ms
64 bytes from icmp_seq=2 ttl=64 time=0.041 ms
--- ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.041/0.041/0.041/0.000 ms

But, if I ping specifying the interface, then it does not work!

$ ping -I tap0
PING ( from tap0: 56(84) bytes of data.
>From icmp_seq=1 Destination Host Unreachable
>From icmp_seq=2 Destination Host Unreachable
>From icmp_seq=3 Destination Host Unreachable
--- ping statistics ---
4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 3015ms
, pipe 3

Shouldn't the packet coming out of tap0 be routed to the proper interface by
the kernel?

I also ran the "ping_test" of ecos with the following setup.

My host:
ethernet.tdf : eth0 real eth0
ecos IP:
server IP:

I had connected my PC's eth0 to another PCs eth port. On second PC
eth0's IP was

Running the ping test shows that ecos is able to send/rcv packets from

Now if I change tdf file to use tap0:
eth0 ethertap tap0 00:FE:42:63:84:A5

And setup eth0 locally on my PC with same IP (, the test
starts failing.

Any pointers?

I'm trying to create a TAP device from a userspace program to see if I
get a tap0
device when I open /dev/net/tun with the proper IOCTL. The sample snip
shown here does not work though!

The program is not even compiling! :( Trying to fix that now!


> Sergei

Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list