On 2022-07-17, Paul Pace <[email protected]> wrote:
> On 2022-07-17 00:28, Kapfhammer, Stefan wrote:
>> You need to define a table.
>> See relayed.conf manual page
>> Section macros
>
> The macros section does include include creating tables that contain a
> macro:
>
>
> MACROS
> Macros can be defined that will later be expanded in context.
> Macro
> names must start with a letter, digit, or underscore, and may
> contain any
> of those characters. Macro names may not be reserved words (for
> example,
> table, relay, or timeout). Macros are not expanded inside quotes.
>
> For example:
>
> www1="10.0.0.1"
> www2="10.0.0.2"
> table <webhosts> {
> $www1
> $www2
> }
>
>
> I have created macros and tables:
>
> adminip1 = 203.0.113.5
> adminip2 = 195.51.100.103
Don't they need to be in quotes?
> table <adminips1> { 203.0.113.5 }
> table <adminips2> {
> $adminip1
> $adminip2
> }
>
> When I replace $adminip1 with <adminips1> or <adminips2> in a working
> protocol
> filter rule on line 20, I get a bunch of syntax errors beginning on line
> 20.
>
> Thank you,
>
> Paul
>
>
>>
>> -Stefan
>>
>>
>>
>>
>> Le 16 juil. 2022 22:09, Paul Pace <[email protected]> a écrit :
>> Hello!
>>
>> I'm working on a relayd.conf configuration where I want to limit access
>> to the path of an admin panel at /admin/ by using the from parameter in
>> a protocol filter rule.
>>
>> I expect more than one IP address so want to use a macro with more than
>> one IP address (or even more than one macro), similar to how I use them
>> in httpd.conf and pf.conf:
>>
>> admin_ips = "{ 203.0.113.5, 198.51.100.103 }"
>>
>> When I add this to line 4 of relayd.conf and before creating a rule, I
>> get:
>>
>> relayd -n
>> /etc/realyd.conf:4: syntax error
>>
>> Have I just merely made a syntax error or is what I want to do not
>> possible in relayd.conf?
>>
>> Thank you,
>>
>>
>> Paul
>
>
--
Please keep replies on the mailing list.