All the static IP Ethernet.begin functions call the next function in line. So if you call the begin function like this
byte mac[] = {0xDE,0xAD,0xBE,0xEF,0xFE,0xED);
IPAddress ip(192,168,0,2);
Ethernet.begin(mac,ip);
// then it creates this variable
IPAddress dns_server(192,168,0,1);
// and calls the next function like this
Ethernet.begin(mac,ip,dns_server);
// then it creates this variable
IPAddress gateway(192,168,0,1);
// and calls the next function like this
Ethernet.begin(mac,ip,dns_server,gateway);
// then it creates this variable
IPAddress subnet(255,255,255,0);
// and calls the next function like this
Ethernet.begin(mac,ip,dns_server,gateway,subnet);
Here are the functions from Ethernet.cpp
void EthernetClass::begin(uint8_t *mac_address, IPAddress local_ip)
{
// Assume the DNS server will be the machine on the same network as the local IP
// but with last octet being '1'
IPAddress dns_server = local_ip;
dns_server[3] = 1;
begin(mac_address, local_ip, dns_server);
}
void EthernetClass::begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server)
{
// Assume the gateway will be the machine on the same network as the local IP
// but with last octet being '1'
IPAddress gateway = local_ip;
gateway[3] = 1;
begin(mac_address, local_ip, dns_server, gateway);
}
void EthernetClass::begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dns_server, IPAddress gateway)
{
IPAddress subnet(255, 255, 255, 0);
begin(mac_address, local_ip, dns_server, gateway, subnet);
}
void EthernetClass::begin(uint8_t *mac, IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
{
W5100.init();
SPI.beginTransaction(SPI_ETHERNET_SETTINGS);
W5100.setMACAddress(mac);
W5100.setIPAddress(local_ip.raw_address());
W5100.setGatewayIp(gateway.raw_address());
W5100.setSubnetMask(subnet.raw_address());
SPI.endTransaction();
_dnsServerAddress = dns_server;
}