How to open tcp and udp ports?

Hello, I'm here to see if you could give me a hand, and install the last OpenWRT verification and I wanted to see if they guide me to enable TCP and TCP ports TCP: 1024-1124,3216,9960-9969,18000,18060, 18120,27900,28910,29900
UDP: 1024-1124,18000,29900,37000-40000
From already thank you very much Saludos desde Argentina

https://openwrt.org/docs/guide-user/firewall/start

3 Likes

That's a lot of ports to open!

Are you sure that you need them always open from the outside all the time?

Most applications will use the "stateful" rules that are already present to open the connections from the inside that will allow return packets on the same connection, without having to keep the ports open all the time.

1 Like

If you don't strict require all those ports to be open to the general public, consider using a VPN instead.

Could you give us more information how your setup looks like?

It easy very easy to do this with iptables... I could give you the cmds.
I'm amazed that you need so many open ports.

1 Like

@NeMe_FuUuRyyyyY, welcome to the community!

See: https://openwrt.org/docs/guide-user/firewall/firewall_configuration

In /etc/config/network
config redirect
	option target 'DNAT'
	option src 'wan'
	option dest 'lan'
	option src_dport '1024-1124'
	option dest_ip '192.168.1.x'
	option dest_port '1024-1124'
	option name 'Rule_1'
	option proto 'tcp'

config redirect
	option target 'DNAT'
	option src 'wan'
	option dest 'lan'
	option src_dport '3216'
	option dest_ip '192.168.1.x'
	option dest_port '3216'
	option name 'Rule_2'
	option proto 'tcp'

config redirect
	option target 'DNAT'
	option src 'wan'
	option dest 'lan'
	option src_dport '9960-9969'
	option dest_ip '192.168.1.x'
	option dest_port '9960-9969'
	option name 'Rule_3'
	option proto 'tcp'

config redirect
	option target 'DNAT'
	option src 'wan'
	option dest 'lan'
	option src_dport '18000'
	option dest_ip '192.168.1.x'
	option dest_port '18000'
	option name 'Rule_4'
	option proto 'tcp'

config redirect
	option target 'DNAT'
	option src 'wan'
	option dest 'lan'
	option src_dport '18060'
	option dest_ip '192.168.1.x'
	option dest_port '18060'
	option name 'Rule_5'
	option proto 'tcp'

config redirect
	option target 'DNAT'
	option src 'wan'
	option dest 'lan'
	option src_dport '18120'
	option dest_ip '192.168.1.x'
	option dest_port '18120'
	option name 'Rule_6'
	option proto 'tcp'

config redirect
	option target 'DNAT'
	option src 'wan'
	option dest 'lan'
	option src_dport '27900'
	option dest_ip '192.168.1.x'
	option dest_port '27900'
	option name 'Rule_7'
	option proto 'tcp'

config redirect
	option target 'DNAT'
	option src 'wan'
	option dest 'lan'
	option src_dport '28910'
	option dest_ip '192.168.1.x'
	option dest_port '28910'
	option name 'Rule_8'
	option proto 'tcp'

config redirect
	option target 'DNAT'
	option src 'wan'
	option dest 'lan'
	option src_dport '29900'
	option dest_ip '192.168.1.x'
	option dest_port '29900'
	option name 'Rule_9'
	option proto 'tcp'

config redirect
	option target 'DNAT'
	option src 'wan'
	option dest 'lan'
	option src_dport '1024-1124'
	option dest_ip '192.168.1.x'
	option dest_port '1024-1124'
	option name 'Rule_10'
	option proto 'udp'

config redirect
	option target 'DNAT'
	option src 'wan'
	option dest 'lan'
	option src_dport '18000'
	option dest_ip '192.168.1.x'
	option dest_port '18000'
	option name 'Rule_11'
	option proto 'udp'

config redirect
	option target 'DNAT'
	option src 'wan'
	option dest 'lan'
	option src_dport '29000'
	option dest_ip '192.168.1.x'
	option dest_port '29000'
	option name 'Rule_12'
	option proto 'udp'

config redirect
	option target 'DNAT'
	option src 'wan'
	option dest 'lan'
	option src_dport '37000-40000'
	option dest_ip '192.168.1.x'
	option dest_port '37000-40000'
	option name 'Rule_13'
	option proto 'udp'
2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.