aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Grange <john@sd-networks.net>2012-05-28 18:45:05 -0700
committerJohn Grange <john@sd-networks.net>2012-05-28 18:45:05 -0700
commit0098b559c1dff219f982690c15b365c814c5d787 (patch)
tree1435d09fd16fead2967ae558856ba95ae60e6ea9
parent3864c8951c23d691101b18911bb5e76d603e4d1b (diff)
downloadpfsense-packages-0098b559c1dff219f982690c15b365c814c5d787.tar.gz
pfsense-packages-0098b559c1dff219f982690c15b365c814c5d787.tar.bz2
pfsense-packages-0098b559c1dff219f982690c15b365c814c5d787.zip
Multiple Areas in networks and interfaces
Added ability to change areas for selected interfaces and networks that are shared. Signed-off-by: John Grange <john@sd-networks.net>
-rw-r--r--config/quagga_ospfd/quagga_ospfd.inc43
-rw-r--r--config/quagga_ospfd/quagga_ospfd.xml6
-rw-r--r--config/quagga_ospfd/quagga_ospfd_interfaces.xml6
3 files changed, 45 insertions, 10 deletions
diff --git a/config/quagga_ospfd/quagga_ospfd.inc b/config/quagga_ospfd/quagga_ospfd.inc
index 54d4ef3f..4b7e007e 100644
--- a/config/quagga_ospfd/quagga_ospfd.inc
+++ b/config/quagga_ospfd/quagga_ospfd.inc
@@ -82,6 +82,7 @@ function quagga_ospfd_install_conf() {
/* Interface Settings */
$passive_interfaces = array();
$interface_networks = array();
+
if ($config['installedpackages']['quaggaospfdinterfaces']['config']) {
foreach ($config['installedpackages']['quaggaospfdinterfaces']['config'] as $conf) {
$realif = get_real_interface($conf['interface']);
@@ -116,9 +117,18 @@ function quagga_ospfd_install_conf() {
if ($interface_subnet == 32)
$interface_subnet = 30;
$subnet = gen_subnet($interface_ip, $interface_subnet);
- $interface_networks[] = "{$subnet}/{$interface_subnet}";
- }
+ if (!empty($conf['interfacearea'])) {
+ $interface_networks[] = array( "subnet" => "{$subnet}/{$interface_subnet}", "area" => $conf['interfacearea']);
+ }
+ else {
+ $interface_networks[] = array( "subnet" => "{$subnet}/{$interface_subnet}", "area" => $ospfd_conf['area']);
+ }
+
+
+
+ }
}
+
/* OSPF Settings */
@@ -153,24 +163,37 @@ function quagga_ospfd_install_conf() {
if ($ospfd_conf['rfc1583'])
$conffile .= " ospf rfc1583compatibility\n";
- if (is_array($passive_interfaces))
+ if (is_array($passive_interfaces)) {
foreach ($passive_interfaces as $pint)
$conffile .= " passive-interface {$pint}\n";
+ }
+
- if (is_array($interface_networks))
- foreach ($interface_networks as $ifn)
- if (is_subnet($ifn))
- $conffile .= " network {$ifn} area {$ospfd_conf['area']}\n";
+ if (is_array($interface_networks)) {
+ foreach ($interface_networks as $ifn) {
+
+ if (is_subnet($ifn['subnet'])) {
+ $conffile .= " network {$ifn['subnet']} area {$ifn['area']}\n";
+ }
+
+ }
+ }
if (is_array($ospfd_conf['row'])) {
foreach ($ospfd_conf['row'] as $redistr) {
- if (isset($redistr['redistribute']))
+
+ if (isset($redistr['redistribute'])) {
$conffile .= " no ";
- $conffile .= " network {$redistr['routevalue']} area {$ospfd_conf['area']}\n";
+ }
+ if ($redistr['routearea'] == "") {
+ $conffile .= " network {$redistr['routevalue']} area {$ospfd_conf['area']}\n";
+ }
+ else {
+ $conffile .= " network {$redistr['routevalue']} area {$redistr['routearea']}\n";
+ }
}
}
}
-
$fd = fopen("/usr/local/etc/quagga/ospfd.conf", "w");
// Write out the configuration file
diff --git a/config/quagga_ospfd/quagga_ospfd.xml b/config/quagga_ospfd/quagga_ospfd.xml
index 3e76c4e4..49c9d86c 100644
--- a/config/quagga_ospfd/quagga_ospfd.xml
+++ b/config/quagga_ospfd/quagga_ospfd.xml
@@ -161,6 +161,12 @@
<type>input</type>
<size>25</size>
</rowhelperfield>
+ <rowhelperfield>
+ <fielddescr>Area ID</fielddescr>
+ <fieldname>routearea</fieldname>
+ <type>input</type>
+ <size>10</size>
+ </rowhelperfield>
</rowhelper>
</field>
</fields>
diff --git a/config/quagga_ospfd/quagga_ospfd_interfaces.xml b/config/quagga_ospfd/quagga_ospfd_interfaces.xml
index e0f55a58..21bc877f 100644
--- a/config/quagga_ospfd/quagga_ospfd_interfaces.xml
+++ b/config/quagga_ospfd/quagga_ospfd_interfaces.xml
@@ -69,6 +69,12 @@
<type>input</type>
</field>
<field>
+ <fielddescr>Area</fielddescr>
+ <fieldname>interfacearea</fieldname>
+ <description>The area for this interface (leave blank for default).</description>
+ <type>input</type>
+ </field>
+ <field>
<fielddescr>Description</fielddescr>
<fieldname>descr</fieldname>
<size>30</size>