diff options
author | Chris Buechler <cmb@pfsense.org> | 2012-05-28 20:07:34 -0700 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2012-05-28 20:07:34 -0700 |
commit | b61fc7948326cd808bf1357a8a530880224ec62c (patch) | |
tree | 09f90ec3454996e81b4c3a48c42d3a1d1c83d7d6 | |
parent | 3864c8951c23d691101b18911bb5e76d603e4d1b (diff) | |
parent | fc5bf06ee85e1783eed5a570c4d2c5eb47adc936 (diff) | |
download | pfsense-packages-b61fc7948326cd808bf1357a8a530880224ec62c.tar.gz pfsense-packages-b61fc7948326cd808bf1357a8a530880224ec62c.tar.bz2 pfsense-packages-b61fc7948326cd808bf1357a8a530880224ec62c.zip |
Merge pull request #253 from grangej/master
Added ability to set multiple areas in Quagga_OSPFD
-rw-r--r-- | config/quagga_ospfd/quagga_ospfd.inc | 47 | ||||
-rw-r--r-- | config/quagga_ospfd/quagga_ospfd.xml | 15 | ||||
-rw-r--r-- | config/quagga_ospfd/quagga_ospfd_interfaces.xml | 6 |
3 files changed, 57 insertions, 11 deletions
diff --git a/config/quagga_ospfd/quagga_ospfd.inc b/config/quagga_ospfd/quagga_ospfd.inc index 54d4ef3f..ab251825 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 */ @@ -139,6 +149,10 @@ function quagga_ospfd_install_conf() { if ($ospfd_conf['redistributestatic']) $conffile .= " redistribute static\n"; + + if ($ospfd_conf['redistributekernel']) + $conffile .= " redistribute kernel\n"; + if ($ospfd_conf['redistributedefaultroute']) $conffile .= " default-information originate\n"; @@ -153,24 +167,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..7989b855 100644 --- a/config/quagga_ospfd/quagga_ospfd.xml +++ b/config/quagga_ospfd/quagga_ospfd.xml @@ -122,10 +122,17 @@ <field> <fielddescr>Redistribute static</fielddescr> <fieldname>redistributestatic</fieldname> - <description>Enables the redistribution of static routes</description> + <description>Enables the redistribution of static routes (only works if you are using quagga static routes)</description> <type>checkbox</type> </field> <field> + <fielddescr>Redistribute Kernel</fielddescr> + <fieldname>redistributekernel</fieldname> + <description>Enables the redistribution of kernel routing table (this is required if using pfsense static routes)</description> + <type>checkbox</type> + </field> + + <field> <fielddescr>SPF Hold Time</fielddescr> <fieldname>spfholdtime</fieldname> <description>Set the SPF holdtime in MILLIseconds. The minimum time between two consecutive shortest path first calculations. The default value is 5 seconds; the valid range is 1-5 seconds.</description> @@ -161,6 +168,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> |