proxy or NAT

how do i configure proxy in freeBSD or NAT so that when i set it up as a server can connect other to my new gateway