Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

nftables can do this #13

@squarooticus

Description

@squarooticus

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 (and presumably somehow mangled) mDNS payloads like avahi-daemon does. But then I realized nftables can do the same thing. To wit:

table ip mangle {
    chain prerouting {
        type filter hook prerouting priority mangle; policy accept;
        ip daddr 224.0.0.251 iif enp2s0.30 ip saddr set 192.168.1.1 dup to 224.0.0.251 device enp2s0.10 notrack
        ip daddr 224.0.0.251 iif enp2s0.10 ip saddr set 192.168.3.1 dup to 224.0.0.251 device enp2s0.30 notrack
    }
}

table ip6 mangle {
    chain prerouting {
        type filter hook prerouting priority mangle; policy accept;
        ip6 daddr ff02::fb iif enp2s0.30 ip6 saddr set fd20:1111:1111:1::1 dup to ff02::fb device enp2s0.10 notrack
        ip6 daddr ff02::fb iif enp2s0.10 ip6 saddr set fd20:1111:1111::3::1 dup to ff02::fb device enp2s0.30 notrack
    }
}

The above repeats mDNS packets from enp2s0.10 to enp2s0.30 and vice versa. Works great. Kinda nuts how simple this is.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions