To acheive the first one, you'll have to do thorough security audit using tools like nmap, nessus or commercial vulnerability scanner such as cybercop.
The second one is connectivity issue. You'll need to use some kind of proxy server or NAT+packet filter.
The second one is connectivity issue. You'll need to use some kind of proxy server or NAT+packet filter.