Re: nftables: defining variables containing ipv6 adresses

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You need to use a valid ipv6 address. E.g.:

define IP6ADDR = 2607:f8b0:400b:80f::2004    <-- a single address with no CIDR
define IP6PREFIX = 2607:f8b0:400b:80f::/64       <-- prefix with CIDR

If you're referencing the IP6PREFIX variable in a set, then you need
to set the interval flag in the set. E.g.:

set IP6PREFIX_SET {
    type ipv6_addr
    flags interval
    elements = {
        $IP6PREFIX
    }
}

otherwise you do not need the interval flag for single addresses:

set IP6ADDR_SET {
    type ipv6_addr
    elements = {
        $IP6ADDR
    }
}

Oliver


On Thu, May 21, 2020 at 6:38 AM Thomas Weberstaedt
<thomas.weberstaedt@xxxxxxxxxxxxxxxx> wrote:
>
> Hi,
>
> I am wondering, how may I define IPv6 variables?
>
> The obvious idea:
>
> define IP6PREFIX = fdaa:bbbb:cccc:dddd
>
> produces an error:
>
> /etc/nftables/setup.conf:7:29-29: Error: syntax error,
> unexpected colon, expecting newline or semicolon
>
> define IP6PREFIX = fdaa:bbbb:cccc:dddd
>                             ^
>
> What would be the proper way to do so? Any documentation on this?
>
> Thanks
>
> Ede



-- 
:o@>



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux