Re: Forwarding broadcast traffic

From: Eric Lammerts (eric@lammerts.org)
Date: Sat Mar 03 2001 - 15:21:48 EST


On Sat, 3 Mar 2001, Jon Masters wrote:
> e.g. on desktop a broadcast udp packet (with a specified port) needs to
> go not only to itself and the router but also the "REST OF LAN" part
> too - and vice versa. Removing the router is not an option.

Write an application that creates 2 sockets listening on the same port
but different interfaces (using the SO_BINDTODEVICE socket option, see
the dhcp source for an example). Then forward any packet you receive
on one socket to the other side. If you need to keep the source ip
intact, you may have to use a raw socket for the sending part.

You could adapt a DHCP relay program to do this stuff instead of
writing it from scratch.

Eric

-- 
Eric Lammerts <eric@lammerts.org> | "An NT server can be run by
http://www.lammerts.org           |  an idiot, and usually is."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Mar 07 2001 - 21:00:14 EST