Well I'm new in this things, I have been searching a solution for my problem, reset, and do it again, specify port and protocol, port in and out with a protocol, but i can't.
Information
problem: Firewall block some, not all, but some ips that are incoming in port that I config to allow incoming tcp and udp, i saw errors in syslog with tag [UFW BLOCK] SPT=45000 DPT=1563
...
What I want: only open ports ssh,http and range from 1500 to 1600 tcp and udp...
How I configured it
My commands to config firewall to allow incoming and outgoing connections
ufw allow 22
ufw allow 80
ufw allow 1500:1600/tcp
ufw allow 1500:1600/udp
Status of firewall with ufw
root@u19312139:~# ufw status
Status: active
To Action From
-- ------ ----
22 ALLOW Anywhere
80 ALLOW Anywhere
1500:1600/tcp ALLOW Anywhere
1500:1600/udp ALLOW Anywhere
22 (v6) ALLOW Anywhere (v6)
80 (v6) ALLOW Anywhere (v6)
1500:1600/tcp (v6) ALLOW Anywhere (v6)
1500:1600/udp (v6) ALLOW Anywhere (v6)
syslog log
note: command to see in real time syslog only lines that have "UFW"
tail -f /var/log/syslog | grep "UFW"
My output
[UFW BLOCK] IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx SRC=189.173.30.x DST=xx:xx:xx:xx LEN=52 TOS=0x00 PREC=0x00 TTL=53 ID=52308 DF PROTO=TCP SPT=52572 DPT=1557 WINDOW=1445 RES=0x00 ACK FIN URGP=0
[UFW BLOCK] IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx SRC=189.173.30.x DST=xx:xx:xx:xx LEN=52 TOS=0x00 PREC=0x00 TTL=53 ID=52309 DF PROTO=TCP SPT=52572 DPT=1557 WINDOW=1445 RES=0x00 ACK FIN URGP=0
[UFW BLOCK] IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx SRC=189.173.30.x DST=xx:xx:xx:xx LEN=52 TOS=0x00 PREC=0x00 TTL=53 ID=12518 DF PROTO=TCP SPT=62545 DPT=80 WINDOW=1445 RES=0x00 ACK FIN URGP=0
[UFW BLOCK] IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx SRC=189.173.30.x DST=xx:xx:xx:xx LEN=52 TOS=0x00 PREC=0x00 TTL=53 ID=52310 DF PROTO=TCP SPT=52572 DPT=1557 WINDOW=1445 RES=0x00 ACK FIN URGP=0
[UFW BLOCK] IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx SRC=189.173.30.x DST=xx:xx:xx:xx LEN=52 TOS=0x00 PREC=0x00 TTL=53 ID=12519 DF PROTO=TCP SPT=62545 DPT=80 WINDOW=1445 RES=0x00 ACK FIN URGP=0
[UFW BLOCK] IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx SRC=189.173.30.x DST=xx:xx:xx:xx LEN=52 TOS=0x00 PREC=0x00 TTL=53 ID=52311 DF PROTO=TCP SPT=52572 DPT=1557 WINDOW=1445 RES=0x00 ACK FIN URGP=0
[UFW BLOCK] IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx SRC=189.173.30.x DST=xx:xx:xx:xx LEN=52 TOS=0x00 PREC=0x00 TTL=53 ID=12520 DF PROTO=TCP SPT=62545 DPT=80 WINDOW=1445 RES=0x00 ACK FIN URGP=0
[UFW BLOCK] IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx SRC=189.173.30.x DST=xx:xx:xx:xx LEN=52 TOS=0x00 PREC=0x00 TTL=53 ID=52312 DF PROTO=TCP SPT=52572 DPT=1557 WINDOW=1445 RES=0x00 ACK FIN URGP=0
[UFW BLOCK] IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx SRC=187.237.167.x DST=xx:xx:xx:xx LEN=40 TOS=0x00 PREC=0x00 TTL=115 ID=2280 DF PROTO=TCP SPT=42542 DPT=1563 WINDOW=10880 RES=0x00 ACK URGP=0
[UFW BLOCK] IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx SRC=189.173.30.x DST=xx:xx:xx:xx LEN=52 TOS=0x00 PREC=0x00 TTL=53 ID=12521 DF PROTO=TCP SPT=62545 DPT=80 WINDOW=1445 RES=0x00 ACK FIN URGP=0
[UFW BLOCK] IN=eth0 OUT= MAC=xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx SRC=187.210.142.x DST=xx:xx:xx:xx LEN=40 TOS=0x00 PREC=0x00 TTL=117 ID=6018 PROTO=TCP SPT=48744 DPT=1563 WINDOW=8160 RES=0x00 ACK URGP=0
Notes:
- SPT= is source port?.
- DPT is the port, right?, but It is 15xx range, and I put in firewall allow 1500 to 1600.
- What can I do for fix this problems, I think i'm doing It right, but the
[UFW BLOCK]
show that ufw block connection from some ips...