I want to allow a specific mac address to access a specific port on a remote server . That port routes to a web application. What command should I use ? Can I do that via ubf(ubuntu firewall) ?
You mention that the server is remote, so it might not be possible to do what you want. Why not? Because Machine Address Codes (MAC) do not span gateway boundaries.
If your client computer is on the same sub-net as your remote server, then its MAC would be in the ethernet information and could be handled by iptables. Example:
sudo iptables -A INPUT -i $EXTIF -m mac --mac-source 00:14:BF:BC:25:EE -j ACCEPT
where $EXTIF in my case is "enp4s0".
I do not know if ufw (a front end for iptables) can do this or not.