aboutsummaryrefslogtreecommitdiffstats
path: root/packages/snort
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-09-26 20:46:10 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-09-26 20:46:10 +0000
commit3691d2b4cc5d9f2635c80de0b7be377164517e1c (patch)
tree7289c68ef4f8598ed7faed755f143bf868e84d63 /packages/snort
parent1003dec108365f1ecc06eb840a0ee49d1d7bfb59 (diff)
downloadpfsense-packages-3691d2b4cc5d9f2635c80de0b7be377164517e1c.tar.gz
pfsense-packages-3691d2b4cc5d9f2635c80de0b7be377164517e1c.tar.bz2
pfsense-packages-3691d2b4cc5d9f2635c80de0b7be377164517e1c.zip
Add all virtual ips and ip addresses from all optional interfaces.
Diffstat (limited to 'packages/snort')
-rw-r--r--packages/snort/snort.inc15
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/snort/snort.inc b/packages/snort/snort.inc
index 12312b2e..e57e8df6 100644
--- a/packages/snort/snort.inc
+++ b/packages/snort/snort.inc
@@ -137,8 +137,23 @@ function generate_snort_conf() {
$home_net .= "{$subnet}/{$ifcfg['subnet']} ";
}
+ /* add all local ips to the whitelist */
+ $wan_if = get_real_wan_interface();
+ $ip = find_interface_ip($wan_if);
+ $home_net .= "{$ip} ";
+
+ /* iterate all interfaces and add to whitelist */
+ foreach($config['interfaces'] as $interface)
+ $home_net .= "{$interface['ipaddr']} ";
+
+ /* iterate all vips and add to whitelist */
+ if($config['virtualip'])
+ foreach($config['virtualip']['vip'] as $vip)
+ $home_net .= $vip['subnet'] . " ";
+
/* write out whitelist, convert spaces to carriage returns */
$whitelist_home_net = str_replace(" ", "\n", $home_net);
+
fwrite($whitelist, $whitelist_home_net);
/* close file */