hey there are some unofficial LAN patch available for NFS UG series, try them.
I had the patch for UG but deleted the whole game with patch last year, so now dont have one.
If everything fails try this:
Disable firewall
Set the default gateway, DNS server as same as ur ip address, and do the same in ur friends computer.
It was the solution for NFS most wanted that worked for me.
Google is the friend.