openwrt / odhcpd

This repository is a mirror of https://git.openwrt.org/?p=project/odhcpd.git. Pull requests will be accepted which will be merged in odhcpd.git
GNU General Public License v2.0
162 stars 98 forks source link

prefix_filter #120

Closed brianjmurrell closed 5 years ago

brianjmurrell commented 5 years ago

I have an OpenWRT 18.06.1 router with 3 IPv6 links to the Internet. I have configured a prefix_filter on the lan interface in /etc/config/dhcp:

config dhcp 'lan'
        option interface 'lan'
        option dhcpv6 'disabled'
        option ra 'server'
        option ra_management '1'
        list dns 'fd31:aeb1:48df::2'
        option prefix_filter '2001:1234::/32'

But my LAN hosts are still seeing all of the available IPv6 prefixes in the RAs from the router.

dedeckeh commented 5 years ago

The odhcpd version in use in OpenWrt 18.06.1 had an issue related to the parsing of the prefix_filter config option; this was fixed in commit https://git.openwrt.org/?p=project/odhcpd.git;a=commit;h=ae6cf8008e50ba9838a056d78cb6aea405c55b7d. I backported this fix together with another fix to OpenWrt-18.06 branch (https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=016a71a18a238842e36d6742af7fb852fe5742dc)

brianjmurrell commented 5 years ago

Does this option not support being able to set multiple prefix_filters?

    list prefix_filter '2001:1234::/32'
    list prefix_filter '2001:5678::/32'

results in no prefixes being filtered.

dedeckeh commented 5 years ago

The prefix_filter config option does currently not support multiple prefixes; I discussed this briefly with the original author of the patch in http://lists.infradead.org/pipermail/openwrt-devel/2018-January/010573.html. Feel free to submit a patch if the current implementation does not support your use case