Feature #3859
openMake it possible to set the source IP address for gateway monitoring
0%
Description
In some cases pfsense does not configure the correct source ip address for apinger checks.
One such scenario is when you have 2 IP addresses on an Interface (a main IP address and an IP Alias). When you defined a gateway on the IP alias subnet, apinger is configured to monitor it using the main interface IP address.
For example:
WAN Link has address a.a.a.a/24, default gateway is a.a.a.x
on the WAN Link there is also the IP alias b.b.b.b/24, and a router on b.b.b.y
apinger configuration will look like this:
target "a.a.a.x" {
description "GW_WAN"
srcip "a.a.a.a"
alarms override "loss","delay","down";
rrd file "/var/db/rrd/GW_WAN-quality.rrd"
}
target "b.b.b.y" {
description "GW_ALIAS"
srcip "a.a.a.a"
alarms override "loss","delay","down";
rrd file "/var/db/rrd/GW_ALIAS-quality.rrd"
}
When instead it should look like this:
target "b.b.b.y" {
description "GW_ALIAS"
srcip "b.b.b.b"
alarms override "loss","delay","down";
rrd file "/var/db/rrd/GW_ALIAS-quality.rrd"
}
A simple solution I implemented on pfSense 2.1.5 is to add a new parameter for the gateway object to specify the source IP address for the monitoring purposes. This patch works fine but lets the user configure totally bogus IP addresses as the source IP. A better solution would be to offer a drop-down list of all the IP addresses available on the specified interface. (although I have not spent the time required for that solution).
The 2 modified files are:
/etc/inc/gwlb.php
/usr/local/www/system_gateways_edit.php
Files