-
Notifications
You must be signed in to change notification settings - Fork 34
The kernel itself can do this #12
Comments
Definitely sounds like a more simple preferable option if you're on linux :). I'm stuck on pfsense, which is a BSD base. |
I can almost guarantee there's some way to get BPF to do this. IIRC, BPF is going to replace netfilter on Linux, with netfilter's full functionality emulated in BPF. But anyway, just thought you would be interested. |
Ahh, I don't have much experience with BPF. If anyone else has more experience I'd love to hear if it was possible. Obsoleting this package would be great, especially if it solves the split-udp packet issue. |
@squarooticus Thank you very much for finding this! I've been struggling with casting between my vlans. I'm having a little bit of trouble understanding what value to set the source ip of the mangled packet to. Is that source IP (192.168.1.1 and 192.168.3.1) the IP of the gateway on that lan? Or is the the IP of the interface on the relay? Thanks! |
Yes, exactly. An address on the outgoing interface in the same subnet as the clients connected to that link. (For IPv4 in the usual case, that means the single IP address assigned to that interface. For IPv6, that means the link local address for that interface.) |
@squarooticus This looks very interesting and could be very useful, thx. Any idea what this rule would like in iptables? Do I need SNAT or TEE or something else, any guidance appreciated. |
@hogkite Very likely TEE is the equivalent of dup. I don't know what the equivalent for changing the source address is, however: SNAT will change the source address, but may add an entry to the connection tracking table. It might not because the destination is a multicast address, but who knows? And even if it does, does it matter? So I would try that. Or take the time to switch to nftables: it's a lot nicer than iptables. FWIW, my current implementation does this in two steps:
I must have run into a problem or edge case with the previous implementation, but I honestly don't remember why I changed it. |
OK thanks for the update |
I just simplified it (FSVO "simplify").
I'll show myself out. |
In trying to debug my Google Cast issues last night, I discovered your daemon. It works great, presumably because it doesn't ingest and then create new mDNS payloads like avahi-daemon does. But then I realized nftables can do the same thing. To wit:
The above repeats mDNS packets from enp2s0.10 to enp2s0.30 and vice versa. Works great. Kinda nuts how simple this is.
The text was updated successfully, but these errors were encountered: