So I currently have this code loaded into my Arduino w/ Ethernet shield and it works perfectly, however it only works locally. The Arduino acts as a server and receives incoming HTTP requests which dictate whether an LED is turned on or off by a "$1" or "$2" at the end of the URL. But of course it only works locally at the moment because I'm connecting through the Arduino's IP address. My question is how might I be able to make this work for anybody who accesses the server from an internet connection anywhere? Would I have to get a DNS or port forward, something along those lines? Or perhaps change the code? Here is the current code:

void loop(){ // listen for incoming clients EthernetClient client = server.available(); if (client) { // an http request ends with a blank line boolean currentLineIsBlank = true; while (client.connected()) { if (client.available()) { char c = client.read(); // if you've gotten to the end of the line (received a newline // character) and the line is blank, the http request has ended, // so you can send a reply

if (c == '\n') { // you're starting a new line currentLineIsBlank = true; } else if (c != '\r') { // you've gotten a character on the current line currentLineIsBlank = false; } } } // give the web browser time to receive the data delay(1); // close the connection: client.stop(); }}

//LINKS://http://192.168.2.2/$1 turns on LED//http://192.168.2.2/$2 turns off LED

Then you need to: 1. From a PC, enter into the router (usually 192.168.1.1) and configure it to forward the (internal) port 80 of the address 192.168.2.2 (Arduino) to the 80 (external) port. (You can also map the internal 80 to another external port, for example 8080, 65000, ...)2. Access Arduino from INTERNET using the external address of your router (example): 252.66.75.43:80 (or 252.66.75.43:8080, or 252.66.75.43:65000, using the port configured in point 1)

NOTE: since the (external) address of the router could change in the time, most router have a function called DDNS (Dynamic DNS.. wikipedia), where you can link your (changing) current router external address to a fixed web address. Try services like tzo, no-ip or ddns.org. In this case, the point 2 becomes:

2.b Access your Arduino from an address like: www.youraddressname.ddns.org:80 (or :8080, or :65000, ... as in point 1)