From: Shao-Lin Joseph Chung <sc57@cs...> - 2003-09-18 01:28:27
Hi, I did a search of the archive, but I can not find anything relevant.
Please forgive me if this question had been asked before. :-)
In my project, I use UML to setup a virtual network of several UMLs within
a physical machine. In one of the UMLs, I need to run a small caching
program that I wrote to cache certain packets from the network, e.g. eth0.
Later on, I need to put those packets back to the network and those
packets need to appear as packets coming from that interface at the first
So far, I had success of putting those packets back to the standard
network interface (e.g. eth0) using SOCK_RAW in PF_PACKET. However, in
order to make my implimentation independent on machines, I would like to
put those packets back to a virtual network interface (e.g. tap0) instead.
So, I used the UML's tunctl program inside the UML and set up a hardware &
IP address myself.
tap0 Link encap:Ethernet HWaddr 04:18:01:01:01:11
inet addr:192.168.6.11 Bcast:192.168.6.255 Mask:255.255.255.0
inet6 addr: fe80::618:1ff:fe01:111/10 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:2 overruns:0 carrier:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.6.0 * 255.255.255.0 U 0 0 0 tap0
192.168.4.0 * 255.255.255.0 U 0 0 0 eth1
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
Now, my problem is, when I put the raw packet to the interface, the packet
seems to be dropped, "TX packets:0 errors:0 dropped:2 overruns:0
Using the same implementation to put packets to either eth0 or eth1 is
fine, but not tap0. So I believe that there is something wrong in my
setup of the tap device.
Notice that I also run IPv6 in the UML. In fact, the 1st packet being
dropped in tap0 is the Neighbor Adv. packet for the automatically
generated link-local IPv6 address when tap0 is brought up.
Can anybody give me an idea of what I did wrong? Thanks for answering my