Issue with Port Forwarding

Hi everyone,

I was trying to setup my TS3 Server, so I needed to open port UDP 9987 on my Turris Omnia. I tried to open the port adding a rule under Traffic Rules, but it does not work. Then I tried on Port Forwarding, but still same problem.
I have read of other users having the same issue. For some restarting the router works but not for me. I have also tried a factory reset and also tried to reflash the router.
Same story, I am not able to open this port.

Any help or suggestion? Here below the screenshots:

Many thanks in advance.
Paolo

In forward rule you have both source and destination port as 9987. Are you sure that the client software is also using port 9987? Or is it automatically selected by OS from unused port pool?

I use only this settings and TS3 server is running, IP adress 192.168.1.114 is STATIC.

For white: 9987 is default TS3 port, in client software this port is not needed. Client need only TS3 IP adress.

UDP and TCP connection always needs a port at the both ends for it to work but normally at the side starting the connection it is freely selected by OS from the unused port pool.

Yes, but when is TS3 server set to default port 9987, than in TS3 client server adress is need write off only IP. UDP is need write off only when is set another port than default, default port is set automatically by TS3 client, but not seen in server address.

In the original screenshot you had fixed both ends of the connection to port 9987.

Hi guys, thanks for the reply and the support.
I have tried as LeRacK suggests, but the result is always the same. Port closed.
I have tried to restart the router but it seems I cannot open this port.

The other doubt I have is in the firewall. The settings in my firewall are as below. Does this impact the port forwarding?

Thanks again for the reply and the support!
Paolo

Thanks for the reply LeRacK!

I have the same configuration you have posted, but unfortunately the port is not open.

I don’t know really why this happens.
If I check on http://www.yougetsignal.com/tools/open-ports/ the port is closed.

Paolo

Probably a dumb question but your TS3 server is running right?

Hi iddqd,

yes the server is running, but the ports are not open.
I have the same issue with utorrent. The UPNP automatic mapping does not work and the utorrent port is closed.

I am really out of ideas.

Thanks,
Paolo

UPNP is broken in current releases of Turris (it was broken in OpenWRT itself, and Turris hadn’t picked up the upstream fix). I found this and submitted a fix here: https://forum.test.turris.cz/t/upnp-says-its-working-not-really/1644/6?u=tonyquan which the Turris devs have accepted. That won’t help for a static port forward though. If I get a chance I’ll try to take a look at this case. The zone rules you pointed out in the screenshots are prioritized lower than the ones in the filter table so should not be interfering.

as I mentioned this should be a redirect rather than a forward. Delete your other rules off the “Traffic Rules” screen, then click “Save and Apply” before going ahead. to create a redirect from LuCI go here:

http://router_ip_address/cgi-bin/luci/admin/network/firewall/forwards

The “Traffic Rules” screen you were trying is the wrong one to use for this. You want the forwards screen because for this to work you need a redirect firewall rule, the “Traffic Rules” screen can’t be used to create redirects. in your case it sounds like you want protocol UDP, external zone wan, external port 9987, internal zone lan, internal IP 192.168.1.130 (is that where your TS3 server is running?) and internal port 9987. Click “Add” to add the rule, then “Save and Apply”. No restart of the router should be required.

ssh to the router and look at /etc/config/firewall, you should see a section like this (assuming you called the rule ts3:

config redirect
        option target 'DNAT'
        option src 'wan'
        option dest 'lan'
        option proto 'udp'
        option src_dport '9987'
        option dest_ip '192.168.1.130'
        option dest_port '9987'
        option name 'ts3'

You could have skipped the web UI entirely and just added this info to the file and restarted the firewall using “/etc/init.d/firewall restart” to get the same effect.

Hi Tonyqyan,

thanks for your useful reply. I tried what you suggested but without success.
Here is what I have and what the router replies when I restart the firewall:

config rule
option name ‘Allow-DHCP-Renew’
option src ‘wan’
option proto ‘udp’
option dest_port ‘68’
option target ‘ACCEPT’
option family ‘ipv4’

config rule
option name ‘Allow-Ping’
option src ‘wan’
option proto ‘icmp’
option icmp_type ‘echo-request’
option family ‘ipv4’
option target ‘ACCEPT’

config rule
option name ‘Allow-IGMP’
option src ‘wan’
option proto ‘igmp’
option family ‘ipv4’
option target ‘ACCEPT’

config rule
option name ‘Allow-DHCPv6’
option src ‘wan’
option proto ‘udp’
option src_ip ‘fe80::/10’
option src_port ‘547’
option dest_ip ‘fe80::/10’
option dest_port ‘546’
option family ‘ipv6’
option target ‘ACCEPT’

config rule
option name ‘Allow-MLD’
option src ‘wan’
option proto ‘icmp’
option src_ip ‘fe80::/10’
list icmp_type ‘130/0’
list icmp_type ‘131/0’
list icmp_type ‘132/0’
list icmp_type ‘143/0’
option family ‘ipv6’
option target ‘ACCEPT’

config rule
option name ‘Allow-ICMPv6-Input’
option src ‘wan’
option proto ‘icmp’
list icmp_type ‘echo-request’
list icmp_type ‘echo-reply’
list icmp_type ‘destination-unreachable’
list icmp_type ‘packet-too-big’
list icmp_type ‘time-exceeded’
list icmp_type ‘bad-header’
list icmp_type ‘unknown-header-type’
list icmp_type ‘router-solicitation’
list icmp_type ‘neighbour-solicitation’
list icmp_type ‘router-advertisement’
list icmp_type ‘neighbour-advertisement’
option limit ‘1000/sec’
option family ‘ipv6’
option target ‘ACCEPT’

config rule
option name ‘Allow-ICMPv6-Forward’
option src ‘wan’
option dest ‘*’
option proto ‘icmp’
list icmp_type ‘echo-request’
list icmp_type ‘echo-reply’
list icmp_type ‘destination-unreachable’
list icmp_type ‘packet-too-big’
list icmp_type ‘time-exceeded’
list icmp_type ‘bad-header’
list icmp_type ‘unknown-header-type’
option limit ‘1000/sec’
option family ‘ipv6’
option target ‘ACCEPT’

config defaults
option syn_flood ‘1’
option input ‘ACCEPT’
option output ‘ACCEPT’
option forward ‘REJECT’

config zone
option name ‘lan’
list network ‘lan’
option input ‘ACCEPT’
option output ‘ACCEPT’
option forward ‘ACCEPT’

config zone
option name ‘wan’
list network ‘wan’
list network ‘wan6’
option input ‘REJECT’
option output ‘ACCEPT’
option forward ‘REJECT’
option masq ‘1’
option mtu_fix ‘1’

config forwarding
option src ‘lan’
option dest ‘wan’

config include
option path ‘/etc/firewall.user’

config include
option path ‘/usr/share/firewall/turris’
option reload ‘1’

config include
option path ‘/etc/firewall.d/with_reload/firewall.include.sh’
option reload ‘1’

config include
option path ‘/etc/firewall.d/without_reload/firewall.include.sh’
option reload ‘0’

config include ‘miniupnpd’
option type ‘script’
option path ‘/usr/share/miniupnpd/firewall.include’
option family ‘any’
option reload ‘1’

config redirect
option target ‘DNAT’
option src ‘wan’
option dest ‘lan’
option proto ‘udp’
option src_dport ‘9987’
option dest_ip ‘192.168.1.130’
option dest_port ‘9987’
option name ‘TS3 Server’

root@turris:~# /etc/init.d/firewall restart
Warning: Unable to locate ipset utility, disabling ipset support

  • Flushing IPv4 filter table
  • Flushing IPv4 nat table
  • Flushing IPv4 mangle table
  • Flushing IPv4 raw table
  • Flushing IPv6 filter table
  • Flushing IPv6 mangle table
  • Flushing IPv6 raw table
  • Flushing conntrack table …
  • Populating IPv4 filter table
    • Zone ‘lan’
    • Zone ‘wan’
    • Rule ‘Allow-DHCP-Renew’
    • Rule ‘Allow-Ping’
    • Rule ‘Allow-IGMP’
    • Redirect ‘TS3 Server’
    • Forward ‘lan’ → ‘wan’
  • Populating IPv4 nat table
    • Zone ‘lan’
    • Zone ‘wan’
    • Redirect ‘TS3 Server’
  • Populating IPv4 mangle table
    • Zone ‘lan’
    • Zone ‘wan’
  • Populating IPv4 raw table
    • Zone ‘lan’
    • Zone ‘wan’
  • Populating IPv6 filter table
    • Zone ‘lan’
    • Zone ‘wan’
    • Rule ‘Allow-DHCPv6’
    • Rule ‘Allow-MLD’
    • Rule ‘Allow-ICMPv6-Input’
    • Rule ‘Allow-ICMPv6-Forward’
    • Forward ‘lan’ → ‘wan’
  • Populating IPv6 mangle table
    • Zone ‘lan’
    • Zone ‘wan’
  • Populating IPv6 raw table
    • Zone ‘lan’
    • Zone ‘wan’
  • Set tcp_ecn to off
  • Set tcp_syncookies to on
  • Set tcp_window_scaling to on
  • Running script ‘/etc/firewall.user’
  • Running script ‘/usr/share/firewall/turris’
    ! Skipping due to path error: No such file or directory
  • Running script ‘/etc/firewall.d/with_reload/firewall.include.sh’
  • Running script ‘/etc/firewall.d/without_reload/firewall.include.sh’
  • Running script ‘/usr/share/miniupnpd/firewall.include’

Any further suggestion? Is there anything else I can try? any way to test 100% if the port is open or not?

Thanks,
Paolo

this looks fine. I tested the same, the only difference was I used a TCP server rather than UDP. I can try setting up a UDP based server and see if it works for me. some obvious things:

  • is 192.168.1.130 the right IP address? if the server host is getting its IP address via DHCP, it may change. I’d suggest using a static IP assignment for a server, it will make this easier.
  • can you connect to the server from hosts on your LAN?

I can connect from inside the LAN but I cannot connect from outside.
The IP is given by DHCP, but I have checked everytime and it stayed the same, 192.168.1.130

I seriously do not know why this happens…

what is upstream of your Turris Omnia? (what do you connect your Turris Omnia to for internet service?) is there any device there that potentially has a firewall or is blocking ports? Many ISPs supply their own modem/router combination devices that have built in firewalls, you might need to disable that firewall, open holes there, or bridge that device.

I was about to write down this same conclusion. I have a router which I have set up in bridge mode. This might probably be the one giving the issue…
I will try and check if there is any setting I need to change.
I will keep you updated.

Thanks!
Paolo

Sorry for my question, but is your external IP adress in TS3 client correct ? My ISP sometimes change IP,s.

Maybe a stupid one…but did you stop and start the service under “startup” in Luci after changing configs?

I made that mistake a few times.