[Click] KernelTun usage

Mike Miller michael.g.miller at gmail.com
Wed Mar 2 20:56:20 EST 2011


Turned out to be rp_filter messing with me, since the source IPs were not on
the local subnet.

sudo sysctl -w net.ipv4.conf.default.rp_filter=0 cleared it up.

- Mike

On Wed, Mar 2, 2011 at 6:48 PM, Mike Miller <michael.g.miller at gmail.com>wrote:

> I'm trying to route packets to another user-level process on my system
> using KernelTun:
>
> tun::KernelTun(1.0.0.1/8);
> tun[0] -> Print("Shouldn't get packets") -> Discard;
> tun[1] -> Print("Error!") -> Discard;
>
> udpSocket -> { Some processing junk which creates a UDP packet destined for
> 1.0.0.1 } -> tun;
>
> I have the user-level process listen via a UDP socket bound explicitly to
> 1.0.0.1 and interface tun0(I've verified my program fails to start if click
> isn't running to create the tun0 interface).
>
> However, the packets never arrive at my program! `sudo tcpdump -i tun0`
> shows that packets destined for 1.0.0.1 are getting to the tun0 interface,
> but they are not appearing at my program. Does click(or tun or linux)
> somehow hijack sent packets to 1.0.0.1 so that other user-level processes
> can't receive them? If so, what's the best solution here?
>
> Thanks!
> Mike
>


More information about the click mailing list