@haluong:
The application establishs connection by inputting PC IP or PC Name. When 2 PCs in same network, the connection is OK, but in different networks, it isn't.
"it isn't" is nowhere near enough detail - what application? what does it report? how does the application work - for example, do the two "ends" each try to establish a connection to the other end?
Does a ping from a PC on LAN to a PC on another network get a response? If not, what is reported?
@haluong:
I don't know how to set firewall to allow the connections. Could you please help me your ideas?
Default LAN firewall rules allow a computer on LAN to establish connections with any other computer. I'm happy to help with ideas but I don't have time or the interest to write down everything I might think of. I need more information to work with to help reduce the number of possibilities to consider.