[Solved] Port range in order to firewall

I am trying to create a range of TCP ports ranging from 10000 to 20000 but not how I add ports because if I put in the following format 10000: 20000 tells me that they must be separated by commas but do not want to add the port 10000 and i want to add all 20000 from 10000 to 20000

hi, did you take a look at this post?

Hello , i’ve done a fix and fork on GitHUB. @alefattorini @giacomo @filippo_carletti - put some fix to nethserver-base, it is a real problem that have been discussed long time ago.

sed -i ‘s/$this->createValidator()->isEmpty()/$this->createValidator()->minLength(1)/g’ /usr/share/nethesis/NethServer/Module/PortForward/Modify.php

it gave error if field is NULL

Reading @giacomo 's comment I think that it’s not an easy fix.
AFAIK, when you forward a range of ports, the destination should be blank, meaning “same ports”.
As you may have noticed, I filed another issue regarding port fwd yesterday, I hope to review all the code next week and merge your pull request. Stay tuned.

I looked into this, but I’m missing the point.

You have a host called testHost and you want to forward all ports from 10000 to 20000 without changing the range. So port 10000 on the firewall will be forwarded to port 10000 to testHost.
Is this scenario you can simply leave the destination port field blank.

The only thing you can’t do is mapping a range to another. Something like range 10000:20000 on the firewall, mapped to 30000:40000 on the target host.

Am I wrong?

I have tried again with destination ports left balnk and it worked.

1 Like