Help with ICMP Pings

Hello
I am trying to send ICMP pings form Ethernet module (ENC28J60) to multiple servers.
I found the code that send pings to one server. After modifying it does not work well. Program try to send pings to 0.0.0.0. How to fix it?

// Ping a remote server, also uses DHCP and DNS.   (1)
// 2011-06-12 <jc@wippler.nl> http://opensource.org/licenses/mit-license.php

#include <EtherCard.h>

// ethernet interface mac address, must be unique on the LAN
static byte mymac[] = { 0x74,0x69,0x69,0x2D,0x30,0x31 };

byte Ethernet::buffer[700];
static uint32_t timer;

// called when a ping comes in (replies to it are automatic)
static void gotPinged (byte* ptr) {
  ether.printIp(">>> ping from: ", ptr);
}

void setup () {
  Serial.begin(57600);
  Serial.println("\n[pings]");
  
  if (ether.begin(sizeof Ethernet::buffer, mymac,10) == 0)
    Serial.println( "Failed to access Ethernet controller");
  if (!ether.dhcpSetup())
    Serial.println("DHCP failed");

  ether.printIp("IP:  ", ether.myip);
  ether.printIp("GW:  ", ether.gwip);

  ether.parseIp(ether.hisip, "8.8.8.8");
  ether.printIp("SRV: ", ether.hisip);
  // call this to report others pinging us
  ether.registerPingCallback(gotPinged);
  
  timer = -9999999; // start timing out right away
  Serial.println();
}

bool sw = true; //SWITCH

void loop () {
  
  // report whenever a reply to our outgoing ping comes back
  if (ether.packetReceive() > 0 )
   Serial.println(" PING received ");
    
  // ping a remote server once every few seconds
   delay(2000);
   Serial.print(" PING send ");
   
   if (sw)
     ether.parseIp(ether.hisip, "8.8.8.8");
   else
     ether.parseIp(ether.hisip, "8.8.4.4");
    
   ether.printIp("SRV: ", ether.hisip);
   ether.clientIcmpRequest(ether.hisip);
   delay(1000);
  }

Describe what you expect your sketch to do. And describe what "does not work well" means. What output do you get? What did you expect?

I want to ping server 1, next server 2...
There is in setup
ether.parseIp(ether.hisip, "8.8.8.8");

I discovered that after ether.parseIp(ether.hisip, "8.8.8.8"); in main loop, program starts sending pings not to 8.8.8.8, but to 0.0.0.0...

Can you explain how to change IP where I want send ping?

Post the serial output of a run of your sketch.

I discovered that after ether.parseIp(ether.hisip, “8.8.8.8”); in main loop, program starts sending pings not to 8.8.8.8, but to 0.0.0.0…

How did you check that? Did you sniff the network? Can you post the content of the sent ICMP packet?

Have you tried pinging a host on your local network? Did you check that your gateway allows pinging outside hosts?