def METHOD_NAME(self, ping_config):
    pa_kwargs = {}
    if self.params.carrier_ipversion == "ipv4":
        ip_filter = {"family": AF_INET}
    else:
        ip_filter = {"family": AF_INET6, "is_link_local": False}
    m1_carrier = self.matched.host1.eth0
    m2_carrier = self.matched.host2.eth0
    m1_carrier_ip = m1_carrier.ips_filter(**ip_filter)[0]
    m2_carrier_ip = m2_carrier.ips_filter(**ip_filter)[0]
    """
    encap udp: IP 192.168.200.1.5000 > 192.168.200.2.5000: UDP
    encap ip: 192.168.200.1 > 192.168.200.2:  ip-proto-115 106
    """
    if self.params.l2tp_encapsulation == "ip":
        pa_kwargs["p_filter"] = "{} proto 115".format(
            "ip" if self.params.carrier_ipversion == "ipv4" else "ip6",
        )
        grep_pattern = "{} {} > {}:[ ]*ip-proto-115".format(
            "IP" if self.params.carrier_ipversion == "ipv4" else "IP6",
            m1_carrier_ip,
            m2_carrier_ip,
        )
    elif self.params.l2tp_encapsulation == "udp":
        pa_kwargs["p_filter"] = "udp"
        grep_pattern = "{} {}.[0-9]+ > {}.[0-9]+:[ ]*UDP".format(
            "IP" if self.params.carrier_ipversion == "ipv4" else "IP6",
            m1_carrier_ip,
            m2_carrier_ip,
        )
    pa_kwargs["grep_for"] = [grep_pattern]
    if ping_config.count:
        pa_kwargs["p_min"] = ping_config.count
    m2 = ping_config.destination
    pa_config = PacketAssertConf(m2, m2_carrier, **pa_kwargs)
    return pa_config