opnsense / core

OPNsense GUI, API and systems backend
https://opnsense.org/
BSD 2-Clause "Simplified" License
3.35k stars 752 forks source link

Dpinger Payload Data Option/Setting #4047

Closed gitwer closed 4 years ago

gitwer commented 4 years ago

Important notices Before you add a new report, we ask you kindly to acknowledge the following: [x] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md [x] I have searched the existing issues and I'm convinced that mine is new.

Is your feature request related to a problem? Please describe.

I have a gateway that is always marked as down by dpinger if I put in a monitor IP address (I have tested multiple). The interface is active and up, but dpinger always sees it as down. I believe I have traced the problem to this: https://redmine.pfsense.org/issues/5830

I have tested this using ping on the FW with 2 different WAN providers:

====

1) ping 9.9.9.9 via the gateway with non-0 packet size <-- WORKS $ ping -s 1 -c 4 9.9.9.9 PING 9.9.9.9 (9.9.9.9): 1 data bytes 9 bytes from 9.9.9.9: icmp_seq=0 ttl=53 9 bytes from 9.9.9.9: icmp_seq=1 ttl=53 9 bytes from 9.9.9.9: icmp_seq=2 ttl=53 9 bytes from 9.9.9.9: icmp_seq=3 ttl=53 --- 9.9.9.9 ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss

====

2) ping 9.9.9.9 via the gateway with 0 packet size <-- BROKEN $ ping -s 0 -c 4 9.9.9.9 PING 9.9.9.9 (9.9.9.9): 0 data bytes --- 9.9.9.9 ping statistics --- 4 packets transmitted, 0 packets received, 100.0% packet loss

====

I have also tested using a different wan provider/connection using the same IP:

====

3) ping 9.9.9.9 via the DIFFERENT gateway with non-0 packet size <-- WORKS $ ping -s 1 -c 4 9.9.9.9 PING 9.9.9.9 (9.9.9.9): 1 data bytes 9 bytes from 9.9.9.9: icmp_seq=0 ttl=61 9 bytes from 9.9.9.9: icmp_seq=1 ttl=61 9 bytes from 9.9.9.9: icmp_seq=2 ttl=61 9 bytes from 9.9.9.9: icmp_seq=3 ttl=61 --- 9.9.9.9 ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss

====

4) ping 9.9.9.9 via the DIFFERENT gateway with 0 packet size <-- WORKS $ ping -s 0 -c 4 9.9.9.9 PING 9.9.9.9 (9.9.9.9): 0 data bytes 8 bytes from 9.9.9.9: icmp_seq=0 ttl=61 8 bytes from 9.9.9.9: icmp_seq=1 ttl=61 8 bytes from 9.9.9.9: icmp_seq=2 ttl=61 8 bytes from 9.9.9.9: icmp_seq=3 ttl=61 --- 9.9.9.9 ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss

====

Other related links: https://forum.netgate.com/topic/111753/gateway-showed-as-offline-but-working-dpinger-trouble/4 https://forum.netgate.com/topic/94460/one-dpinger-gateway-status-offline/13

Describe the solution you'd like I would like a GUI interface element to allow dpinger to be configured (either global, or per instance/gateway) to use a non zero payload size. e.g. a checkbox saying include a non-zero payload in dpinger that adds "-d 1" to the params on the page: /system_gateways_edit.php?id=1

Describe alternatives you've considered 1) Manually trying to edit config (see additional context below to quick test results to get my setup working) 2) Assume gateway is always up and don't monitor

Additional context Add any other context or screenshots about the feature request here.

I have edited line 278 of this file (/usr/local/etc/inc/plugins.inc.d/dpinger.inc) and changed the line to include "-d 1" as below and it worked - the interface was listed as up.

mwexec_bg("/usr/local/bin/dpinger -f -d 1 {$params}");

AdSchellevis commented 4 years ago

@gitwer https://github.com/opnsense/core/commit/ab0420415182d76e61d56d103f841c2c9f3d44c7 should do the trick.