A problem with variable

Nicolas KARP nicolaskarp at freE.fr
Wed Aug 20 18:57:40 UTC 2008


Leslie Jensen a écrit :
>
> I've defined a variable
>
> proxyport = "{ 8080 }"
>
> The rule
>
> rdr on $int_if inet proto tcp from $internal_net to any /
> port $proxy_services -> $proxy port $proxyport
>
> gives me a "Syntax error in config file:"
>
> I use the same variable in another rule and it does not produce a 
> "Syntax error"
>
> pass in on $int_if inet proto tcp from $internal_net to /
> $proxy port $proxyport keep state
>
> If I change the variable in the first rule to 8080 it works.
>
> Can someone shed some light on this?
>
> Thanks
>
> /Leslie
> _______________________________________________
> freebsd-pf at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-pf
> To unsubscribe, send any mail to "freebsd-pf-unsubscribe at freebsd.org"
Hi (one more time ;) )

You can't use a list in a rdr rule :

see man pf.conf  anf precisely the Grammar of PF.conf 
<http://www.openbsd.org/cgi-bin/man.cgi?query=pf.conf&apropos=0&sektion=0&manpath=OpenBSD+Current&arch=i386&format=html#end>

 rdr-rule       = [ "no" ] "rdr" [ "pass" [ "log" [ "(" logopts ")" ] ] ]
                      [ "on" ifspec ] [ af ]
                      [ protospec ] hosts [ "tag" string ] [ "tagged" string ]
                      [ "->" ( redirhost | "{" redirhost-list "}" )
                      [ *portspec* ] [ *pooltype* ] ]


pooltype       = ( "bitmask" | "random" |
                      "source-hash" [ ( hex-key | string-key ) ] |
                      "round-robin" ) [ sticky-address ]


portspec       = "port" ( number | name ) [ ":" ( "*" | number | name ) ]




More information about the freebsd-pf mailing list