Is it possible ? arduino mega

Hello. Arduino mega have an ethernet windshield. I realized a project. Everything works but I have a question. It can be run from another place not only in that network? For example I drug & in town and from there inclusions given anything?
thanks

/*
  Web Server
 
 A simple web server that shows the value of the analog input pins.
 using an Arduino Wiznet Ethernet shield. 
 
 Circuit:
 * Ethernet shield attached to pins 10, 11, 12, 13
 * Analog inputs attached to pins A0 through A5 (optional)
 
 created 18 Dec 2009
 by David A. Mellis
 modified 9 Apr 2012
 by Tom Igoe
 
 */

#include <SPI.h>
#include <Ethernet.h>

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0x2D };


byte gateway[] = { 192, 168, 0, 1 }; //               <------- PUT YOUR ROUTERS IP Address to which your shield is connected Here
byte subnet[] = { 255, 255, 255, 0 }; //                <------- It will be as it is in most of the cases
IPAddress ip(192,168,0,199);

// Initialize the Ethernet server library
// with the IP address and port you want to use 
// (port 80 is default for HTTP):
EthernetServer server(80);


#define RELAY_CH1  2
#define RELAY_CH2  3
#define RELAY_CH3  4
#define RELAY_CH4  5
#define RELAY_CH5  6
#define RELAY_CH6  7
#define RELAY_CH7  8
#define RELAY_CH8  9

String readString;

void setup() {
  
  
        pinMode(RELAY_CH1, OUTPUT); 
 	digitalWrite(RELAY_CH1, HIGH);  // switch on LED1
 
        pinMode(RELAY_CH2, OUTPUT); 
 	digitalWrite(RELAY_CH2, HIGH);  // switch on LED2
 
        pinMode(RELAY_CH3, OUTPUT); 
 	digitalWrite(RELAY_CH3, HIGH);  // switch on LED3
 
        pinMode(RELAY_CH4, OUTPUT); 
 	digitalWrite(RELAY_CH4, HIGH);  // switch on LED4
 
        pinMode(RELAY_CH5, OUTPUT); 
 	digitalWrite(RELAY_CH5, HIGH);  // switch on LED5
 
        pinMode(RELAY_CH6, OUTPUT); 
 	digitalWrite(RELAY_CH6, HIGH);  // switch on LED6
 
        pinMode(RELAY_CH7, OUTPUT); 
 	digitalWrite(RELAY_CH7, HIGH);  // switch on LED7
 
        pinMode(RELAY_CH8, OUTPUT); 
 	digitalWrite(RELAY_CH8, HIGH);  // switch on LED8
  
  
  
 // Open serial communications and wait for port to open:
  Serial.begin(9600);
   while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }


  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip);
  
  server.begin();
  Serial.print("server is at ");
  Serial.println(Ethernet.localIP()); 
  
}
void loop() {
  // listen for incoming clients
  EthernetClient client = server.available();
  
  if (client) {
    Serial.println("new client");
    // an http request ends with a blank line
    boolean currentLineIsBlank = true;
    while (client.connected()) {
           
      if (client.available()) {
        
        char c = client.read();
        
        if (readString.length() < 100) {
          //store characters to string
          readString += c;			//Serial.print(c);
        }
        
        Serial.write(c);
        // 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' && currentLineIsBlank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println("Connection: close");  // the connection will be closed after completion of the response
	  client.println("Refresh: 5");  // refresh the page automatically every 5 sec
          client.println();
          client.println("<!DOCTYPE HTML>");
          client.println("<html>");
          
          client.println("<HEAD>");
          client.println("<meta name='apple-mobile-web-app-capable' content='yes' />");
          client.println("<meta name='apple-mobile-web-app-status-bar-style' content='black-translucent' />");
          //client.println("<link rel=\"stylesheet\" type=\"text/css\" href=\"http://www.digital2u.net/autohome.css\" />");
          client.println("<meta http-equiv=\"refresh\" content=\"5;url=http://192.168.0.199/\"/>" );
          client.println("</HEAD>");
          
          client.println("<body bgcolor=\"#D0D0D0\">");
          //client.println("<hr/>");
          //client.println("<hr/>");
          
          //client.println("<h4><center><img border=\"2\" src=\"https://lh3.googleusercontent.com/-C6BoJrRUFko/UEUFeCwkvdI/AAAAAAAAAOc/E7gcYvPV6r4/s960/Logo.jpg\" /></center></h4>");
          //client.println("<hr/>");
          //client.println("<hr/>");
                   
          client.print("<center> <p> <h1>Welcome to Arduino Home Control V0.25 (Active Low)  </h1></p> ");
          //client.println("
");
          //client.println("
");
          
          
          // Relay Status Display
          client.println("<center>");
          
              client.println("<table border=\"5\">");
              
                  client.println("<tr>"); 
                      if (!digitalRead(RELAY_CH1))
                      { 
                           client.print("<td> <p style=\"font-family:arial;color:black;font-size:26px;\">Device 1.</p><p style=\"font-family:arial;color:green;font-size:35px;\">ON</p> </td>");
                      }
                      else
                      {
                           client.print("<td> <p style=\"font-family:arial;color:black;font-size:26px;\">Device 1.</p><p style=\"font-family:arial;color:red;font-size:35px;\">OFF</p></td>");
                      }
 if (!digitalRead(RELAY_CH2))
                      {   
                           client.print("<td> <p style=\"font-family:arial;color:black;font-size:26px;\">Device 2.</p><p style=\"font-family:arial;color:green;font-size:35px;\">ON</p></td>");
                      }
                      else
                      {  
                          client.print("<td> <p style=\"font-family:arial;color:black;font-size:26px;\">Device 2.</p><p style=\"font-family:arial;color:red;font-size:35px;\">OFF</p></td>");
                      }
                     
                      
                      if (!digitalRead(RELAY_CH3))
                      { 
                           client.print("<td><p style=\"font-family:arial;color:black;font-size:26px;\">Device 3.</p><p style=\"font-family:arial;color:green;font-size:35px;\">ON</p></td>");
                      }
                      else
                      {
                          client.print("<td><p style=\"font-family:arial;color:black;font-size:26px;\">Device 3.</p><p style=\"font-family:arial;color:red;font-size:35px;\">OFF</p></td>");
                      }
                     
                     
                      if (!digitalRead(RELAY_CH4))
                      { 
                         client.print("<td><p style=\"font-family:arial;color:black;font-size:26px;\">Device 4.</p><p style=\"font-family:arial;color:green;font-size:35px;\">ON</p></td>");
                      }
                      else
                      {
                          client.print("<td><p style=\"font-family:arial;color:black;font-size:26px;\">Device 4.</p><p style=\"font-family:arial;color:red;font-size:35px;\">OFF</p></td>");
                      }
                     
                     
                      if (!digitalRead(RELAY_CH5))
                      { 
                           client.print("<td><p style=\"font-family:arial;color:black;font-size:26px;\">Device 5.</p><p style=\"font-family:arial;color:green;font-size:35px;\">ON</p></td>");
                      }
                      else
                      {
                          client.print("<td><p style=\"font-family:arial;color:black;font-size:26px;\">Device 5.</p><p style=\"font-family:arial;color:red;font-size:35px;\">OFF</p></td>");
                      }
                     
                             
                      if (!digitalRead(RELAY_CH6))
                      {   
                           client.print("<td><p style=\"font-family:arial;color:black;font-size:26px;\">Device 6.</p><p style=\"font-family:arial;color:green;font-size:35px;\">ON</p></td>");
                      }
                      else
                      {  
                          client.print("<td><p style=\"font-family:arial;color:black;font-size:26px;\">Device 6.</p><p style=\"font-family:arial;color:red;font-size:35px;\">OFF</p></td>");
                      }
                      
                          
                      if (!digitalRead(RELAY_CH7))
                      { 
                           client.print("<td><p style=\"font-family:arial;color:black;font-size:26px;\">Device 7.</p><p style=\"font-family:arial;color:green;font-size:35px;\">ON</p></td>");
                      }
                      else
                      {
                          client.print("<td><p style=\"font-family:arial;color:black;font-size:26px;\">Device 7.</p><p style=\"font-family:arial;color:red;font-size:35px;\">OFF</p></td>");
                      }
                     
                     
                      if (!digitalRead(RELAY_CH8))
                      { 
                         client.print("<td><p style=\"font-family:arial;color:black;font-size:26px;\">Device 8.</p><p style=\"font-family:arial;color:green;font-size:35px;\">ON</p></td>");
                      }
                      else
                      {
                          client.print("<td><p style=\"font-family:arial;color:black;font-size:26px;\">Device 8.</p><p style=\"font-family:arial;color:red;font-size:35px;\">OFF</p></td>");
                      }
                                         
                 client.println("</tr>");                   
              client.println("</table>"); 
              
          client.println("</center>");
          client.println("
");

I'm not 100% sure what you're asking but yes you can access your arduino server from another network but only if you follow certain steps.

Your router has local network ips and your modem has one public ip. You need to port forward your arduino local ip to your public ip. So from other networks, you can browse your public ip and they will point to your local arduino.

Depending on your internet service provider, your public ip could change from time to time.

mistergreen: I'm not 100% sure what you're asking but yes you can access your arduino server from another network but only if you follow certain steps.

Your router has local network ips and your modem has one public ip. You need to port forward your arduino local ip to your public ip. So from other networks, you can browse your public ip and they will point to your local arduino.

Depending on your internet service provider, your public ip could change from time to time.

I did not understand exactly what you mean. If changing the IP address in the code itself Arduino tried to replace given to my ip address but nothing happens. Does not work if someone can help?

Where did I say to change the ip in the code?

You port forward through your router. You don't touch the arduino.

I do not understand. Does not work. help

Try using google in your language. Look up 'port forward' and your internet router.

There's no way to help you if I don't speak your language.

Everything was done properly and went as I wanted. But I have another problem and he is. When you use IP router to get from place facing away after a few seconds work I rejected and forwarded to the IP-then that is where Arduino could be the problem? thanks in advance

Your public ip must change often. Your internet provider does that. You can check your public ip here. http://ip-lookup.net

There 2 ways to resolve this issue. 1. Buy a static IP from your internet provider. 2. Use a service like http://www.noip.com

mistergreen: Your public ip must change often. Your internet provider does that. You can check your public ip here. http://ip-lookup.net

There 2 ways to resolve this issue. 1. Buy a static IP from your internet provider. 2. Use a service like http://www.noip.com

Thank you very much.