Preventing W5500 from responding to ping

#1

One common way to avoid unwanted attention from script kiddies when exposing a system to the Internet is to turn off responses to pings. The W5500 seems to respond to pings all on its own. Is there any way to configure the W5500 so it doesn’t do this?

#2

I am using ioLibrary. In the wizchip_conf.h, there is a typedef enum that looks like this:

/**
 * @ingroup DATA_TYPE
 *  Network mode
 */
typedef enum
{
#if _WIZCHIP_ == 5500   
    NM_FORCEARP = (1 << 1), ///< Force to APP send whenever udp data is sent. Valid only in W5500
#endif   
    NM_WAKEONLAN = (1 << 5), ///< Wake On Lan 
    NM_PINGBLOCK = (1 << 4), ///< Block ping-request
    NM_PPPOE = (1 << 3), ///< PPPoE mode
} netmode_type;

And there is an API for setting the mode:

/**
 * @ingroup extra_functions
 * @brief Set the network mode such WOL, PPPoE, Ping Block, and etc. 
 * @param pnetinfo Value of network mode. Refer to @ref netmode_type.
 */
int8_t wizchip_setnetmode(netmode_type netmode);

The actual function:

int8_t wizchip_setnetmode(netmode_type netmode)
{
    uint8_t tmp = 0;
#if _WIZCHIP_ != 5500   
    if (netmode & ~(NM_WAKEONLAN | NM_PPPOE | NM_PINGBLOCK)) return -1;
#else
    if (netmode & ~(NM_WAKEONLAN | NM_PPPOE | NM_PINGBLOCK | NM_FORCEARP)) return -1;
#endif      
    tmp = getMR();
    tmp |= (uint8_t)netmode;
    setMR(tmp);
    return 0;
}
#3

Found it in the manual - “Ping Block Mode”. Thought I had that thing memorized :slight_smile:.

Thanks!