Not able to connect to Web server Externally

I am using an arduino ethernet shield with a enc28j60 like this one. I am using UIPEthernet library as shown here as well as its example code. For some reason, I am not able to connect to the web server externally. Is this a problem with networking, or just the code?

  1. ping you arduino server(is it in network or not).
    2)I guess You shold make arduino server . if it's working - try to make arduino-client.

I'm able to ping in inside the network, and I can access it inside the network as well. I'll try the client.

Sorry, I need a little guidance on what to do on the tcp client.

Router settings set up correctly? Port forwarding, pinhole in your firewall, whatever it's called for you.

Yep, I'm pretty sure I've got all of them

Have you considered it may be your ISP blocking your request? Many ISPs are blocking port 80 requests to residential (non-commercial) IP addresses. Are you using port 80 for the server? If so, you might want to change that to port 8080 or 8088.

Whenever I change the port number, instead of showing the website it shows my html code. And I still can't access it from the outside.

If your code is getting sent, then it's mostly working. You may just have your header info wrong so your browser isn't parsing.
But you still haven't shown your top secret code, so . . . .

It had always worked locally in my network, but I can’t access it from a dfferent network.

Here’s my code:

#include <UIPEthernet.h> // Used for Ethernet

byte mac[] = { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11};
IPAddress ip(192, 168, 0, 133);
IPAddress subnet(255, 255, 255, 0);
IPAddress gateway(192, 168, 0 ,1);
EthernetServer server = EthernetServer(80);

void setup() {

  // start the Ethernet connection and the server:
  Ethernet.begin(mac, ip, gateway, subnet);

  Serial.print("IP Address: ");

void loop() {
  // listen for incoming clients
  EthernetClient client = server.available();

  if (client)
    Serial.println("-> New Connection");

    // an http request ends with a blank line
    boolean currentLineIsBlank = true;

    while (client.connected())
      if (client.available())
        char 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)
            client.println("<!DOCTYPE html>");
            client.println("<meta charset='UTF-8'>");
            client.println("<title>Hello World</title>");
              client.println("<h1>Hello World</h1>");

        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

    // close the connection:
    Serial.println("   Disconnected\n");