I want to setup an IPv4 firewall for UDP connections to port :7777 with the following rules:
- By default block all connections to UDP Port :7777.
- Allow only whitelisted IPs connections to UDP Port :7777.
- If an IP has made a UDP connection to port :8888 then add it to the whitelist.
How can I archive this? Can this be done using IPTables, UFW or something else?