• raw sockets and iptables and route: she's not leaving

    From Charles T. Smith@110:110/2002 to All on Fri Jun 27 17:22:09 2014

    I'm working the end of an ip tunnel and trying to set packets free into
    the internet with:

    socket(AF_INET, SOCK_RAW, htons(ETH_P_ALL))

    I can see the pkts traverse my tunnel, enter my application and are sent
    on this socket. But wireshark doesn't see anything, and I can't coax
    iptables to log anything that I can understand.

    Question: do I have to bind(2) the socket to an outgoing interface or is
    that only for reception and the kernel works out, based on the
    destination address what i/f to put it on?

    If that's the case, how does that work with routing?

    If I have a route to my destination, starting from the tunnel, the app
    writes to the tunnel, the data goes through it and ends up at my gateway
    which then tries to eject it. At the far end of the tunnel, does it
    consult the routing tables again? What if I have another route to that
    same destination?

    --- MBSE BBS v1.0.1 (GNU/Linux-i386)
    * Origin: A noiseless patient Spider (110:110/2002@linuxnet)