1
0
mirror of https://github.com/fwbuilder/fwbuilder synced 2026-03-19 17:57:22 +01:00

* OSConfigurator_pix_os.cpp (_printInterfaceConfiguration): see #2343

"Interface nameif error when installing generated config for FWSM".
Use correct  "nameif" command sytax  in FWSM 2.x and 4.x.
This commit is contained in:
Vadim Kurland 2011-04-13 15:33:50 -07:00
parent 074aae6427
commit 6cc059b91c
12 changed files with 318 additions and 6 deletions

View File

@ -1,5 +1,9 @@
2011-04-13 Vadim Kurland <vadim@netcitadel.com> 2011-04-13 Vadim Kurland <vadim@netcitadel.com>
* OSConfigurator_pix_os.cpp (_printInterfaceConfiguration): see #2343
"Interface nameif error when installing generated config for FWSM".
Use correct "nameif" command sytax in FWSM 2.x and 4.x.
* OSConfigurator_pix_os.cpp (_printSSHConfiguration): see #2344 * OSConfigurator_pix_os.cpp (_printSSHConfiguration): see #2344
"FWSM install errors for clear commands". Using correct syntax for "FWSM install errors for clear commands". Using correct syntax for
"clear" commands for FWSM v4.x "clear" commands for FWSM v4.x

View File

@ -194,9 +194,9 @@ void OSConfigurator_pix_os::_getAddressConfigurationForInterface(
string OSConfigurator_pix_os::_printInterfaceConfiguration() string OSConfigurator_pix_os::_printInterfaceConfiguration()
{ {
ostringstream res; ostringstream res;
string host_os = fw->getStr("host_OS");
string version = fw->getStr("version"); string version = fw->getStr("version");
string platform = fw->getStr("platform"); string platform = fw->getStr("platform");
//string::size_type n;
bool configure_address = fw->getOptionsObject()->getBool("pix_ip_address"); bool configure_address = fw->getOptionsObject()->getBool("pix_ip_address");
bool configure_standby_address = bool configure_standby_address =
@ -231,8 +231,18 @@ string OSConfigurator_pix_os::_printInterfaceConfiguration()
if (configlet_name.isEmpty()) configlet_name = "regular_interface_"; if (configlet_name.isEmpty()) configlet_name = "regular_interface_";
if (XMLTools::version_compare(version, "7.0") < 0) configlet_name += "6"; if (host_os == "pix_os")
if (XMLTools::version_compare(version, "7.0") >= 0) configlet_name += "7"; {
if (XMLTools::version_compare(version, "7.0") < 0) configlet_name += "6";
if (XMLTools::version_compare(version, "7.0") >= 0) configlet_name += "7";
}
if (host_os == "fwsm_os")
{
if (XMLTools::version_compare(version, "4.0") < 0) configlet_name += "2";
if (XMLTools::version_compare(version, "4.0") >= 0) configlet_name += "4";
}
cnf = new Configlet(fw, "pix_os", configlet_name); cnf = new Configlet(fw, "pix_os", configlet_name);
cnf->removeComments(); cnf->removeComments();
@ -293,13 +303,23 @@ string OSConfigurator_pix_os::_printInterfaceConfiguration()
string OSConfigurator_pix_os::_printFailoverConfiguration() string OSConfigurator_pix_os::_printFailoverConfiguration()
{ {
ostringstream res; ostringstream res;
string host_os = fw->getStr("host_OS");
string version = fw->getStr("version"); string version = fw->getStr("version");
string platform = fw->getStr("platform"); string platform = fw->getStr("platform");
//string::size_type n;
QString configlet_name = "failover_commands_"; QString configlet_name = "failover_commands_";
if (XMLTools::version_compare(version, "7.0") < 0) configlet_name += "6";
if (XMLTools::version_compare(version, "7.0") >= 0) configlet_name += "7"; if (host_os == "pix_os")
{
if (XMLTools::version_compare(version, "7.0") < 0) configlet_name += "6";
if (XMLTools::version_compare(version, "7.0") >= 0) configlet_name += "7";
}
if (host_os == "fwsm_os")
{
if (XMLTools::version_compare(version, "4.0") < 0) configlet_name += "2";
if (XMLTools::version_compare(version, "4.0") >= 0) configlet_name += "4";
}
Configlet cnf(fw, "pix_os", configlet_name); Configlet cnf(fw, "pix_os", configlet_name);
cnf.removeComments(); cnf.removeComments();

View File

@ -0,0 +1,37 @@
## -*- mode: shell-script; -*-
##
## To be able to make changes to the part of configuration created
## from this configlet you need to copy this file to the directory
## fwbuilder/configlets/pix_os/ in your home directory and modify it.
## Double "##" comments are removed during processing but single "#"
## comments are be retained and appear in the generated script. Empty
## lines are removed as well.
##
## Configlets support simple macro language with these constructs:
## {{$var}} is variable expansion
## {{if var}} is conditional operator.
##
##
## http://www.cisco.com/en/US/docs/security/pix/pix63/configuration/guide/failover.html
##
## failover ip address outside 209.165.201.2
## failover ip address inside 192.168.2.2
## failover ip address failover 192.168.254.2
## failover ip address state 192.168.253.2
## failover link state
## failover lan unit primary
## failover lan interface failover
## failover lan key 12345678
## failover lan enable
## failover
##
##
## "failover ip address" commands are added bu the failover_interface_6 configlet
failover link {{$state_sync_interface_label}}
failober lan unit {{$primary_or_secondary}}
failover lan interface {{$failover_interface_label}}
failover key {{$failover_key}}
failover lan enable
failover

View File

@ -0,0 +1,34 @@
## -*- mode: shell-script; -*-
##
## To be able to make changes to the part of configuration created
## from this configlet you need to copy this file to the directory
## fwbuilder/configlets/pix_os/ in your home directory and modify it.
## Double "##" comments are removed during processing but single "#"
## comments are be retained and appear in the generated script. Empty
## lines are removed as well.
##
## Configlets support simple macro language with these constructs:
## {{$var}} is variable expansion
## {{if var}} is conditional operator.
##
##
## failover
## failover lan unit primary
## failover lan interface failover Ethernet3
## failover lan enable
## failover key ******
## failover link state Ethernet2
## failover interface ip failover 10.1.0.1 255.255.255.0 standby 10.1.0.2
## failover interface ip state 10.0.0.1 255.0.0.0 standby 10.0.0.2
failover lan unit {{$primary_or_secondary}}
failover lan interface {{$failover_interface_label}} {{$failover_interface_name}}
failover lan enable
failover key {{$failover_key}}
failover interface ip {{$failover_interface_label}} {{$failover_interface_primary_address}} {{$failover_interface_primary_netmask}} standby {{$failover_interface_standby_address}}
failover link {{$state_sync_interface_label}} {{$state_sync_interface_name}}
failover interface ip {{$state_sync_interface_label}} {{$state_sync_interface_primary_address}} {{$state_sync_interface_primary_netmask}} standby {{$state_sync_interface_standby_address}}
failover

View File

@ -0,0 +1,18 @@
## -*- mode: shell-script; -*-
##
## To be able to make changes to the part of configuration created
## from this configlet you need to copy this file to the directory
## fwbuilder/configlets/pix_os/ in your home directory and modify it.
## Double "##" comments are removed during processing but single "#"
## comments are be retained and appear in the generated script. Empty
## lines are removed as well.
##
## Configlets support simple macro language with these constructs:
## {{$var}} is variable expansion
## {{if var}} is conditional operator.
##
nameif {{$interface_name}} {{$interface_label}} security{{$security_level}}
{{if configure_interface_address}}ip address {{$interface_label}} {{$address}} {{$netmask}} {{endif}}
{{if configure_standby_address}}failover ip address {{$interface_label}} {{$standby_address}} {{endif}}

View File

@ -0,0 +1,18 @@
## -*- mode: shell-script; -*-
##
## To be able to make changes to the part of configuration created
## from this configlet you need to copy this file to the directory
## fwbuilder/configlets/pix_os/ in your home directory and modify it.
## Double "##" comments are removed during processing but single "#"
## comments are be retained and appear in the generated script. Empty
## lines are removed as well.
##
## Configlets support simple macro language with these constructs:
## {{$var}} is variable expansion
## {{if var}} is conditional operator.
##
interface {{$interface_name}}
description LAN/STATE Failover Interface
no nameif
exit

View File

@ -0,0 +1,25 @@
## -*- mode: shell-script; -*-
##
## To be able to make changes to the part of configuration created
## from this configlet you need to copy this file to the directory
## fwbuilder/configlets/pix_os/ in your home directory and modify it.
## Double "##" comments are removed during processing but single "#"
## comments are be retained and appear in the generated script. Empty
## lines are removed as well.
##
## Configlets support simple macro language with these constructs:
## {{$var}} is variable expansion
## {{if var}} is conditional operator.
##
{{if static_address}}
nameif {{$interface_name}} {{$interface_label}} security{{$security_level}}
{{if configure_interface_address}}ip address {{$interface_label}} {{$address}} {{$netmask}} {{endif}}
{{if configure_standby_address}}failover ip address {{$interface_label}} {{$standby_address}} {{endif}}
{{endif}}
{{if dhcp_address}}
nameif {{$interface_name}} {{$interface_label}} security{{$security_level}}
{{if configure_interface_address}}ip address {{$interface_label}} dhcp setroute retry 10 {{endif}}
{{endif}}

View File

@ -0,0 +1,41 @@
## -*- mode: shell-script; -*-
##
## To be able to make changes to the part of configuration created
## from this configlet you need to copy this file to the directory
## fwbuilder/configlets/pix_os/ in your home directory and modify it.
## Double "##" comments are removed during processing but single "#"
## comments are be retained and appear in the generated script. Empty
## lines are removed as well.
##
## Configlets support simple macro language with these constructs:
## {{$var}} is variable expansion
## {{if var}} is conditional operator.
##
{{if static_address}}
interface {{$interface_name}}
nameif {{$interface_label}}
{{if configure_interface_address}}
ip address {{$address}} {{$netmask}} {{if configure_standby_address}} standby {{$standby_address}} {{endif}}
{{endif}}
security-level {{$security_level}}
exit
{{endif}}
{{if dhcp_address}}
interface {{$interface_name}}
nameif {{$interface_label}}
{{if configure_interface_address}}
ip address dhcp setroute
{{endif}}
security-level {{$security_level}}
exit
{{endif}}

View File

@ -0,0 +1,16 @@
## -*- mode: shell-script; -*-
##
## To be able to make changes to the part of configuration created
## from this configlet you need to copy this file to the directory
## fwbuilder/configlets/pix_os/ in your home directory and modify it.
## Double "##" comments are removed during processing but single "#"
## comments are be retained and appear in the generated script. Empty
## lines are removed as well.
##
## Configlets support simple macro language with these constructs:
## {{$var}} is variable expansion
## {{if var}} is conditional operator.
##

View File

@ -0,0 +1,20 @@
## -*- mode: shell-script; -*-
##
## To be able to make changes to the part of configuration created
## from this configlet you need to copy this file to the directory
## fwbuilder/configlets/pix_os/ in your home directory and modify it.
## Double "##" comments are removed during processing but single "#"
## comments are be retained and appear in the generated script. Empty
## lines are removed as well.
##
## Configlets support simple macro language with these constructs:
## {{$var}} is variable expansion
## {{if var}} is conditional operator.
##
interface {{$interface_name}}
no nameif
no ip address
no security-level
exit

View File

@ -0,0 +1,37 @@
## -*- mode: shell-script; -*-
##
## To be able to make changes to the part of configuration created
## from this configlet you need to copy this file to the directory
## fwbuilder/configlets/pix_os/ in your home directory and modify it.
## Double "##" comments are removed during processing but single "#"
## comments are be retained and appear in the generated script. Empty
## lines are removed as well.
##
## Configlets support simple macro language with these constructs:
## {{$var}} is variable expansion
## {{if var}} is conditional operator.
##
## interface ethernet0 vlan3 logical
{{if static_address}}
interface {{$parent_interface}} {{$interface_name}} logical
nameif {{$interface_name}} {{$interface_label}} security{{$security_level}}
{{if configure_interface_address}}
ip address {{$interface_label}} {{$address}} {{$netmask}}
{{endif}}
{{endif}}
{{if dhcp_address}}
nameif {{$interface_name}} {{$interface_label}} security{{$security_level}}
{{if configure_interface_address}}
ip address {{$interface_label}} dhcp setroute retry 10
{{endif}}
{{endif}}

View File

@ -0,0 +1,42 @@
## -*- mode: shell-script; -*-
##
## To be able to make changes to the part of configuration created
## from this configlet you need to copy this file to the directory
## fwbuilder/configlets/pix_os/ in your home directory and modify it.
## Double "##" comments are removed during processing but single "#"
## comments are be retained and appear in the generated script. Empty
## lines are removed as well.
##
## Configlets support simple macro language with these constructs:
## {{$var}} is variable expansion
## {{if var}} is conditional operator.
##
{{if static_address}}
interface {{$interface_name}}
vlan {{$vlan_id}}
nameif {{$interface_label}}
{{if configure_interface_address}}
ip address {{$address}} {{$netmask}} {{if configure_standby_address}} standby {{$standby_address}} {{endif}}
{{endif}}
security-level {{$security_level}}
exit
{{endif}}
{{if dhcp_address}}
interface {{$interface_name}}
vlan {{$vlan_id}}
nameif {{$interface_label}}
{{if configure_interface_address}}
ip address dhcp setroute
{{endif}}
security-level {{$security_level}}
exit
{{endif}}