Unable to set different port range for port forwarding

Glad to see this awesome community supporting very much.
When i set port range for port forwarding, it is not taking into effect.
Example:

  1. This works:
    config redirect 'myrule'
    option src 'wan'
    option proto 'tcpudp'
    option dest 'lan'
    option src_dport '81'
    option dest_ip '192.168.1.229'
    option dest_port '80'
    option family 'ipv4'
    option target 'DNAT'

  2. This works:
    config redirect 'myrule'
    option src 'wan'
    option proto 'tcpudp'
    option dest 'lan'
    option src_dport '50-80'
    option dest_ip '192.168.1.229'
    option dest_port '50-80'
    option family 'ipv4'
    option target 'DNAT'

  3. This doesn't work:
    config redirect 'myrule'
    option src 'wan'
    option proto 'tcpudp'
    option dest 'lan'
    option src_dport '50-80'
    option dest_ip '192.168.1.229'
    option dest_port '150-180'
    option family 'ipv4'
    option target 'DNAT'

I am expecting my ports being forwarded like:
External Port ---> Internal Port

  • 51 ------> 151
  • 52 ------> 152
  • 53 ------> 153
    .
    .
  • 80 ------> 180

Current, openwrt forces me to keep src and dest ports identical (if entered as a range).
I observe that couple of router also forces to do same. Some even don't give option to give dest port range seperately, E.g., https://support.google.com/fiber/answer/4643957?hl=en

Is this a specification requirement how port forwarding works?
Or this is improper behavior?

Its a limitation of the underlying iptables implementation afaik.

@jow thanks for very quick response.
Do we have any standard or specs document regarding this behavior for iptables or anything?

One starting point for documentation is https://www.netfilter.org/documentation/index.html