Arduino ethernet board without router

Hi I want to use Arduino ethernet board without router. I use the lan cable from wall and connect it to Arduino. I used WebClient example but it said connection failed. Even though I add the subnet, dns, gateway, it didn't work. It works if i connect lan cable-router-lan cable-Arduino ethernet. I don't want to make a DHCP server. Is there any option? Did i miss something? Thank you for reading my question.

What's on the LAN cable from the wall? Home networks usually have a router as the first device in the house, so I guess that you have a router too. Please provide a more detailed description of your setup or better, post a picture of your network connections.

Thank you for answer. I am in the school. So it is not home networks. Wall-Lan cable-Arduino Ethernet Board is my plan. I am using usb cable and usb serial converter for uploading coding and supplying power. I have a question. If wall has router, then it should do DHCP. But it doesn't work. I don't know what to do. How can I access the router in the wall which can do DHCP. Please tell me about that. Thank you

Don't ask me what the hardware behind your LAN wall connector is doing. Go and ask your school network administrator which protocols your school network supports. There is the possibility to use DHCP on the Arduino but you have to get the necessary configuration data first. Post the information you get (without the actual IP addresses if they're public) here so we may help you.

The IT team said I can not use DHCP. So I want to assign the IP address. But It keeps fail. This is my code. It is same as WebClient example except subnet, gateway, dnserver. I already tried to declare subnet, gateway, dnserver as byte. But it does not work. Please let me know if you have a good idea. Thnak you

#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0x90,0xA2,0xDA,0x10,0x2A,0xCE};
char server[] = "www.google.com";  

IPAddress ip(172,27,108,26);
IPAddress subnet(255, 255,255,0);
IPAddress gateway(172,27,108,254);
IPAddress dnServer(203,237,32,100);

EthernetClient client;

void setup() {
  
  Serial.begin(9600);
  while (!Serial) {
    ;
  }


  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    Ethernet.begin(mac, ip,subnet,gateway,dnServer);
  }
 delay(1000);
  Serial.println("connecting...");

  
  if (client.connect(server, 80)) {
    Serial.println("connected");
   
    client.println("GET /search?q=arduino HTTP/1.1");
    client.println("Host: www.google.com");
    client.println("Connection: close");
    client.println();
  } else {
    
    Serial.println("connection failed");
  }
}

void loop() {
 
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }

 
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();

  
    while (true);
  }
}

If you are using the ethernet library included with the IDE, then your begin call has the parameters in the wrong order.

// change this
  Ethernet.begin(mac, ip,subnet,gateway,dnServer);

// to this
  Ethernet.begin(mac, ip, dnServer, gateway, subnet);