Sending values to an Arduino Yun across different networks
I have accomplished this, first by reading this article on controlling a Yun through a web-browser on the same network. From there it was a matter of allowing my Yun to be accessed externally (setting up port-forwarding on my router) and changing a few lines of code to reflect the new location reference.

All the necessary files and code are included under the heading "Project Files" in the above link and no modification is needed to get it working within the same network. That said, I had to convert the two .jpg files to .png (and change the filenames in index.html) - I don't know why they wouldn't show up in my browser.

In brief:

The Yun hosts a webpage (index.html) which contains some indicators and control inputs. These objects are linked to the 32u4 using Bridge and the REST API - nothing special. The bulk of the html code is for visual purposes, and the actual REST calls are nice and simple.

What is good is that the webpage can be accessed from anywhere with the right jiggery-pokery, and with a little more determination can be hosted from anywhere.

External Access

Once you have that working, you need to do the following to allow access externally. I tested this using my smartphone - disconnected from my home WiFi of course - to ensure the link was over the Internet, not intranet.

1) Set up port forwarding and a static IP for the Yun. This is the fundamental step if you simply want to control your Yun over the Internet. However, I can't actually tell you how to do this because I don't know what equipment you have! Information is all over Google for setting up both DHCP static IP and port forwarding.

2) Get a static IP from your ISP for your home/work, or set up a Dynamic DNS service (these people offer it free, but I've never actually needed to use an external service). Most commercial ISPs tend to dish out static IPs, but that's no guarantee that yours will.

3) Access your Yun with a browser via: http://YOUR.IP.ADD.RES:PORT/arduino/&lt;SketchName&gt;.

External Hosting

If you want to host the webpage on something other than the Yun, you can! You will of course need a server to host this, either your work's central server or an external hosting service. You'll need to change some more lines in the code:

1) In the Yun sketch change server.ListenOnLocalhost(); to server.noListenOnLocalhost(); - the subtle difference is the 'no', and is essential for external control. Sorry, that's incorrect without a little more explanation than is required at the moment to answer your original question.

2) In the .html file, you need to change each instance of:

server = "/arduino/&lt;SOMETHING&gt;";


to

server = "YOUR.IP.ADD.RES:PORT/arduino/&lt;SOMETHING&gt;";


If you have the REST password set to ON then you have to incorporate the username/password in there too:

server = "username:password@YOUR.IP.ADD.RES:PORT/arduino/&lt;SOMETHING&gt;";


There are three occurences in the original file, so be sure to catch them all.

3) When making changes to the .html file, make sure you re-upload it to the external host, not the Yun - that mistake took me hours to figure out.

A little more...

While searching for the URL of the article in the opening paragraph I found this atricle on a similar theme. It looks to have plenty of information although I haven't read it yet fully yet; I've been busy writing an answer on Stack Exchange. External Access should be no different, and if you want the 'External Hosting' version you just need to find any line that references the 'server' as "/arduino/..." and change it to "YOUR.IP.ADD.RES:PORT/arduino...".