This answer is just a complementary to the answer provided by @Achala Dissanayake, and I'd like to thank him, again!
To make two computers on different Internet networks (e.g. Wifi, under a firewall or any combination of setting) connect to a machine A and send transactions/smart contracts to the private chain, in machine A, we can do the following:
First, we install Hamachi in all machines including machine A. Hamachi allows the computers to have an IP address and put them in a virtual LAN. Then each machine adds the IP address of machine A in Hamachi software (it's very easy to do that).
Assume machine A's IP address provided by Hamachi is: x.y.z.w
To initiate a private chain in machine A, we run the folllowing command line :
geth --identity "MyNodeName" --rpc --rpcport "8545" --rpccorsdomain "*"
--datadir Users/TestChain --port "30303" --rpcaddr
"x.y.z.w" --nodiscover --rpcapi "db,eth,net,web3,personal" --
networkid 123 init /Users/CustomGenesis.json
The second line will be:
geth --identity "MyNodeName" --rpc --rpcport "8545" --rpccorsdomain "*"
--datadir Users/TestChain --port "30303" --nodiscover --rpcaddr
"x.y.z.w" --rpcapi "db,eth,net,web3,personal" --networkid 123
console
Please pay attention to
--rpcaddr "x.y.z.w"
Please note that machine A can independently install Hamachi, get it IP and run the above lines without knowing anything about other machines.
In practice, the "x.y.z.w" will be an IP address provided by Hamachi.
Finally, in each machine willing to connect to machine A, via Metamask, we set up a "Custome RPC" and set the following as new RPC URL:
http://x.y.z.w:8545
Note, "Custome RPC" is an option in Metamask that allows us to provide our network details.
That's it. Now they can interact with machine A with a minimal setting, and the other nodes don't even need to install or run "geth", etc.
I've tested the above idea: I ran a private chain on a Macbook pro and connected to it using a Windows Vista laptop. They were connected to two different Wifi networks.