Project

General

Profile

Actions

Feature #3859

open

Make it possible to set the source IP address for gateway monitoring

Added by Patrick Bihan-Faou about 10 years ago. Updated about 8 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
Gateway Monitoring
Target version:
-
Start date:
09/11/2014
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:

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

gwlb.php.patch (1.57 KB) gwlb.php.patch Patch to add custom srcip in apinger configuration Patrick Bihan-Faou, 09/11/2014 09:40 AM
system_gateways_edit.php.patch (3.5 KB) system_gateways_edit.php.patch User interface to set the srcip option for gateways Patrick Bihan-Faou, 09/11/2014 09:40 AM
Actions

Also available in: Atom PDF