Hi @milesich,
You can open any port you wish and use it to your needs. In your case to open ports 50 and 51, you’ll need to execute the following commands:
- If you are using UFW, you can execute
sudo ufw allow 50
sudo ufw allow 51
- If you are using only IPtables, you can execute
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 50 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 51 -j ACCEPT
All of the provided commands will help you with openning the port and allowing traffic. It’s possible however, you wish to enable traffic only for a certain IP address. In that case, you’ll need to modify your commands a bid.
- UFW example with allowing IP access on a certain port
sudo ufw allow from XXX.XXX.XXX.XXX to any port 50
sudo ufw allow from XXX.XXX.XXX.XXX to any port 51
- Iptables example with allowing IP access on a certain port
iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d XXX.XXX.XXX.XXX --dport 50 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d XXX.XXX.XXX.XXX --dport 51 -m state --state NEW,ESTABLISHED -j ACCEPT
Please remember to change XXX.XXX.XXX.XXX in any of the commands with your own IP address.
Reards,
KDSys