Take a look here:
Ubuntu: How to add an iptables rule that UFW can't create
I added the netbios-ns helper to iptables, raw table using UFW config files under
(Taken from Arch Linux - Samba - source iptables command
iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns
This allows browsing an MS Windows network using Thunar as an example.
I added the translated syntax to the
/etc/ufw/after.rules file, at the beginning, just after the initial comment block, see below:
# Rules that should be run after the ufw command line added rules. Custom
# rules should be added to one of these chains:
# netbios helper function allow browsing windows network
-A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns
# Don't delete these required lines, otherwise there will be errors
Note: this syntax is the one used by iptables-save.
Then restart UFW.
Note that I had to insert at the beginning of the
after.rules file, otherwise if I was appending at the end of the file, it was adding 3 times the same entry to the OUTPUT chain in the raw table once
ufw was restarted.
It allowed me to avoid using the
/etc/ufw/user.rules. Perhaps it is an option that you can consider.
I hope it may help.