tech-net archive

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

Re: npf: map (rdr) range of ports




> On Nov 5, 2026, at 7:07 PM, Timo Buhrmester <timo%math.uni-bonn.de@localhost> wrote:
> 
> I find it pretty counter-intuitive that a port redirect like this:
> | map pppoe0 dynamic proto tcp 192.168.1.17 port 40000-40100 <- ifaddrs(pppoe0) port 40000-40099

This is almost equal to no port mapping actually, I have opened a problem report to actually make this work.
see bin/60538.

> is a syntax error, but then this:
> | map pppoe0 dynamic proto tcp 192.168.1.17 port 40000 <- ifaddrs(pppoe0) port 40000-40099
> is fine syntactically, however it maps all 100 ports to 40000.  ipf with its equiavlent syntax would've mapped 40000 to 40000, 40001 to 40001 and so forth.
> 
> And the result seems to be that I have to add 100 map lines if i want to redirect this port range.  Am I missing something?

For now, i think you can easily do a no-ports on the dynamic rule and the ports won’t be touched. which i think is the same.

map pppoe0 dynamic no-ports proto tcp 192.168.1.17  <- ifaddrs(pppoe0) port 40000-40099

to end up mapping the same ports per translation.

Emmanuel







Home | Main Index | Thread Index | Old Index