Cisco经典文档

当前位置: 首页Cisco经典文档FWSM : 多上下文(Multiple Context )配置示例


FWSM : 多上下文(Multiple Context )配置示例

            

 

                                                       文档下载:

切换至英文原版


 

内容

前言
前提条件
      需求
      使用的组件
      惯例
背景信息
      上下文配置文件
      不支持的功能
      安全上下文的管理访问
配置
      网络图
      启用或禁用多上下文模式
      配置安全上下文
      FWSM : 系统执行空间配置
      在上下文和系统执行空间之间切换
      FWSM - contextA 配置
      FWSM - contextB 配置
      在多上下文模式中保存配置更改
验证
故障排除
      还原单一上下文模式
      重新加载安全上下文
      重命名上下文
      删除上下文
 


前言

本文档介绍用于在防火墙服务模块 (FWSM) 中配置多上下文的步骤。

您可以将一个 FWSM 划分为多个虚拟设备(称为安全上下文)。 每个上下文都有自己的安全策略、接口和管理员。 多个上下文类似于多个独立设备。 多上下文模式支持许多功能,包括路由表、防火墙功能和管理。 不支持某些功能,包括动态路由协议。

可以在下列情况下使用多安全上下文:

  • 您是服务提供商,想要向多个客户出售安全服务。 在 FWSM 上启用多个安全上下文后,便可以实施一个经济的、节省空间的解决方案,该解决方案使所有客户流量彼此分开且保持安全,并且简化了配置。

  • 您是大型企业或大学校园,希望使各部门完全保持独立。

  • 您是一个企业,想要为不同部门提供不同的安全策略。

  • 您的网络需要多个防火墙。

请参阅 PIX/ASA 7.x 及更高版本: 多上下文配置示例,了解有关如何描述用于在安全工具中配置多上下文的步骤的详细信息。

前提条件

需求

本文档没有任何特定的要求。

使用的组件

本文档中的信息基于运行软件版本 3.2(5) 的防火墙服务模块 (FWSM)。

本文档中的信息都是基于特定实验室环境中的设备创建的。 本文档中使用的所有设备最初均采用原始(默认)配置。 如果您在一个工作网络中操作,在使用之前请确认您已经理解所有指令的潜在影响。

惯例

有关文档规则的详细信息,请参阅 Cisco 技术提示规则

背景信息

上下文配置文件

上下文配置

FWSM 为每个上下文均提供一个配置,以标识安全策略、接口和几乎所有可在独立设备上配置的选项。 您可以在内部闪存或外部闪存卡上存储上下文配置,也可以从 TFTP、FTP 或 HTTP 服务器下载它们。

系统配置

系统管理员使用每个上下文配置所在位置、分配的接口和系统配置中的其他上下文操作参数的配置来添加并管理上下文,系统配置与单一模式配置类似,是启动配置。 系统配置标识 FWSM 的基本设置。 系统配置不包括本身的任何网络接口或网络设置; 相反,当系统需要访问网络资源(例如从服务器下载上下文)时,它使用被指定为管理上下文的一个上下文。 系统配置包括一个仅用于对数据流进行故障切换的专用故障切换接口。

管理上下文配置

管理上下文与任何其他上下文类似,不同之处在于,当您登录管理上下文后,您将具有系统管理员权限,并且能够访问系统和所有其他上下文。 管理上下文在任何情况下都不受限制,并且可以作为普通上下文使用。 但因为登录管理上下文会授予您对所有上下文的管理员权限,因此,您可能需要将管理上下文的访问权限限制到适当的用户。 管理上下文必须驻留在闪存中,不能驻留在远程位置。

如果您的系统已处于多上下文模式中,或者您从单一模式转换,则管理上下文会自动创建为内部闪存上的一个称作 admin.cfg 的文件。 此上下文被命名为 admin。 如果不希望将 admin.cfg 作为管理上下文,则可以更改管理上下文。

不支持的功能

多上下文模式不支持以下功能:

  • 动态路由协议

    安全上下文仅支持静态路由。 不能在多上下文模式下启用 OSPF 或 RIP。

  • 组播

安全上下文的管理访问

FWSM 在多上下文模式下提供了系统管理员访问权限以及单个上下文的管理员访问权限。 以下各部分介绍以系统管理员或上下文管理员身份登录:

系统管理员访问

您可以通过两种方式以系统管理员身份访问 FWSM:

  • 从交换机到 FWSM 的会话。

    从交换机访问系统执行空间。

  • 使用 Telnet、SSH 或 ASDM 访问管理上下文。

    有关如何启用 Telnet、SSH 和 SDM 访问权限的详细信息,请参阅配置管理访问

作为系统管理员,您可以访问所有上下文。

当您从管理或系统切换到上下文时,您的用户名会变为默认的 enable_15 用户名。 如果您在该上下文中配置了命令授权,则需要为 enable_15 用户配置授权权限,也可以用您在上下文的命令授权配置中为其提供了足够权限的另一个名称来登录。 输入 login 命令以便以用户名登录。 例如,您使用用户名 admin 登录管理上下文。 管理上下文没有任何命令授权配置,但所有其他上下文均包括命令授权。 为方便起见,每个上下文配置均包括一个具有最大权限的用户 admin。 当您从管理上下文切换到 contextA 时,您的用户名会发生变化,因此,您必须在输入 login 命令时以 admin 身份再次登录。 当您切换到 contextB 时,必须再次输入 login 命令以便以 admin 身份登录。

系统执行空间不支持任何 AAA 命令,但您可以配置它自己的启用口令以及在本地数据库中的用户名,以便提供单独的登录。

上下文管理员访问

您可以使用 Telnet、SSH 或 ASDM 访问上下文。 如果您登录到非管理上下文,则只能访问该上下文的配置。 您可以提供对上下文的单独登录。

配置

本部分提供有关如何配置本文档中所述功能的信息。

注意: 使用命令查找工具仅限注册用户)可获取有关本部分所使用命令的详细信息。

网络图

本文档使用以下网络设置:

/image/gif/paws/107524/fwsm-multiple-context-config-01.gif

启用或禁用多上下文模式

您的 FWSM 可能已针对多个安全上下文进行了配置,具体取决于从 Cisco 订购它的方式。 然而,如果您要升级,则可能需要按照本部分中的过程从单一模式转换到多模式。 ASDM 不支持更改模式,因此,您需要使用 CLI 更改模式。

备份单一模式配置

当您从单一模式转换为多模式时,FWSM 会将运行配置转换为两个文件。 将不保存原始启动配置,因此,如果它与运行配置有所不同,您应该在继续操作之前备份它。

启用多上下文模式

即使经过重新启动,上下文模式(单一模式或多模式)也不会存储在配置文件中。 如果您需要将配置复制到另一个设备,请将新设备上的模式设置为与模式命令匹配。

当您从单一模式转换为多模式时,FWSM 会将运行配置转换为两个文件:

  1. 一个新的启动配置,其中包含系统配置

  2. 一个 admin.cfg,其中包含位于内部闪存的根目录中的管理上下文

原始运行配置保存为 old_running.cfg(位于内部闪存的根目录中)。 将不保存原始启动配置。 FWSM 自动将管理上下文的一个条目添加到名称为“admin”的系统配置中。

输入下面的命令以启用多模式:

hostname(config)#mode multiple

系统会提示您重新启动 FWSM。

FWSM(config)#mode multiple

WARNING: This command will change the behavior of the device
WARNING: This command will initiate a Reboot
Proceed with change mode? [confirm]
Convert the system configuration? [confirm]
!
The old running configuration file will be written to flash

The admin context configuration will be written to flash

The new running configuration file was written to flash
Security context mode: multiple

***
*** --- SHUTDOWN NOW ---
***
*** Message to all terminals:
***
***   change mode

Rebooting....

Booting system, please wait...
*
*

!--- Output suppressed


*
*
INFO: Admin context is required to get the interfaces
*** Output from config line 20, "arp timeout 14400"
Creating context 'admin'... Done. (1)
*** Output from config line 23, "admin-context admin"

Cryptochecksum (changed): a219baf3 037b31b4 09289829 1ab9790a

*** Output from config line 25, "  config-url flash:/admi..."

Cryptochecksum (changed): d4f0451b 405720e1 bbccf404 86be061c
Type help or '?' for a list of available commands.
FWSM>

重新启动后,FWSM 的默认配置如下所示:

FWSM 的默认配置

FWSM#show running-config
: Saved
:
FWSM Version 3.2(5)5 <system>
!
resource acl-partition 12
hostname FWSM
domain-name default.domain.invalid
enable password 8Ry2YjIyt7RRXU24 encrypted
!
interface Vlan501
!
interface Vlan502
!
passwd 2KFQnbNIdI.2KYOU encrypted
class default
  limit-resource IPSec 5
  limit-resource Mac-addresses 65535
  limit-resource ASDM 5
  limit-resource SSH 5
  limit-resource Telnet 5
  limit-resource All 0
!

ftp mode passive
gdb enable
pager lines 24
no failover
no asdm history enable
arp timeout 14400
console timeout 0

admin-context admin
context admin
  allocate-interface Vlan501
  allocate-interface Vlan502
  config-url disk:/admin.cfg


!--- admin context is created
!--- by default once you enable 
!--- multiple mode

!

prompt hostname context
Cryptochecksum:d62411d2a15f1da35c76fe071b61dcdb
: end
FWSM#

 

 

配置安全上下文

系统配置中的安全上下文定义用于标识上下文名称、配置文件 URL、上下文可以使用的接口和其他上下文参数。

注意:  如果您没有管理上下文(例如,清除了配置),则必须首先在输入以下命令时指定管理上下文名称:

hostname(config)#admin-context <name>

注意: 虽然,您的配置中不存在此上下文名称,但可随后输入 context name 命令以便与指定的名称匹配,从而继续管理上下文配置。

若要在系统配置中添加或更改上下文,请完成以下这些步骤:

  1. 若要添加或修改上下文,请在系统执行空间中输入以下命令:

    hostname(config)#context <name>
    
    

    该名称是一个最大长度为 32 个字符的字符串。 该名称区分大小写,因此,您可以有两个分别名为“customerA”和“CustomerA”的上下文。 您可以使用字母、数字或连字符,但名称不能以连字符开始或结束。

    “System”或“Null”(大写或小写字母)是保留名称,不能使用。

  2. (可选)若要添加此上下文的说明,请输入以下命令:

    hostname(config-ctx)#description text
    
    
    
  3. 若要指定可在上下文中使用的接口,请输入以下命令:

    hostname(config-ctx)#allocate-interface vlannumber[-vlannumber] [map_name[-map_name] 
    [invisible | visible]]
    

    您可以多次输入此命令以指定不同的范围。 如果用此命令的 no 形式删除分配,则会从运行配置中删除包括此接口的所有上下文命令。

    输入 VLAN 编号或 VLAN 范围,它们通常是从 2 到 1000 和从 1025 到 4094。 有关支持的 VLAN,请参阅交换机文档。 使用 show vlan 命令可查看分配给 FWSM 的 VLAN 的列表。 您可以分配尚未分配给 FWSM 的 VLAN,但如果希望它们传递流量,则需要从交换机分配它们。 当您分配接口时,FWSM 会自动在系统配置中为每个 VLAN 添加 interface 命令。

  4. 输入以下命令以标识系统从中下载上下文配置的 URL:

    hostname(config-ctx)#config-url url
    

    当您添加上下文 URL 时,如果配置可用,系统会立即加载上下文以便运行它。

    注意: 先输入 allocate-interface 命令,然后再输入 config-url 命令。 FWSM 必须在加载上下文配置之前,将接口分配到上下文; 上下文配置可能包括引用接口的命令,例如 interface、nat、global 等。 如果您首先输入 config-url 命令,则 FWSM 会立即加载上下文配置。 如果上下文包含任何引用接口的命令,则这些命令将失败。

在下面的方案中,请完成表中的步骤以配置多上下文。

有两个客户,客户 A 和客户 B。在一个 FWSM 模块中创建三个多上下文(实际上是三个 FWSM),例如,对应于客户 A 的 contextA、对应于客户 B 的 contextB,以及用于管理 FWSM 上下文的 admin 上下文。

注意: 在 FWSM 中使用 Catalyst 6500 系列交换机之前,在该交换机中创建 VLAN 300、301、400、401、500 和 501。

在系统执行空间中创建上下文,为每个创建的上下文分配相应的 VLAN,并为每个上下文配置 URL 路径,如下所示。

FWSM 多上下文配置步骤

FWSM(config)#context admin
FWSM(config-ctx)#allocate-interface VLAN500
FWSM(config-ctx)#allocate-interface VLAN501
FWSM(config-ctx)#config-url disk:/admin.cfg


!--- Allocate VLAN 500 and 501 to admin context


FWSM(config)#context contextA


!--- Customer A Context as Context A


FWSM(config-ctx)#allocate-interface VLAN300
FWSM(config-ctx)#allocate-interface VLAN301


!--- Allocate VLAN 300 and 301 to admin context


FWSM(config-ctx)#config-url disk:/contextA.cfg
WARNING: Could not fetch the URL disk:/contextA.cfg
INFO: Creating context with default config


!--- To identify the URL from which the 
!--- system downloads the context configuration.


FWSM(config-ctx)#context contextB
Creating context 'contextB'... Done. (3)


!--- Customer B Context as Context B


FWSM(config-ctx)#allocate-interface VLAN400
FWSM(config-ctx)#allocate-interface VLAN401


!--- Allocate VLAN 400 and 401 to admin context


FWSM(config-ctx)#config-url disk:/contextB.cfg
WARNING: Could not fetch the URL disk:/contextB.cfg
INFO: Creating context with default config
FWSM(config-ctx)#exit

 

 

FWSM : 系统执行空间配置

FWSM - 系统执行空间配置

FWSM(config)#show running-config
: Saved
:
FWSM Version 3.2(5)5 <system>
!
resource acl-partition 12
hostname FWSM
domain-name default.domain.invalid
enable password 8Ry2YjIyt7RRXU24 encrypted
!
interface Vlan300
!
interface Vlan301
!
interface Vlan400
!
interface Vlan401
!
interface Vlan501
!
interface Vlan502
!
passwd 2KFQnbNIdI.2KYOU encrypted
class default
  limit-resource IPSec 5
  limit-resource Mac-addresses 65535
  limit-resource ASDM 5
  limit-resource SSH 5
  limit-resource Telnet 5
  limit-resource All 0
!

ftp mode passive
gdb enable
pager lines 24
no failover
no asdm history enable
arp timeout 14400
console timeout 0

admin-context admin
context admin
  allocate-interface Vlan501
  allocate-interface Vlan502
  config-url disk:/admin.cfg
!

context contextA
  allocate-interface Vlan300
  allocate-interface Vlan301
  config-url disk:/contextA.cfg
!

context contextB
  allocate-interface Vlan400
  allocate-interface Vlan401
  config-url disk:/contextB.cfg
!

prompt hostname context
Cryptochecksum:d62411d2a15f1da35c76fe071b61dcdb
: end
FWSM#

 

 

在上下文和系统执行空间之间切换

如果您登录到系统执行空间(或者使用 Telnet 或 SSH 登录到管理上下文),则可以在上下文之间切换,并在每个上下文中执行配置和监视任务。 您在配置模式中编辑的运行配置或者受 copy 或 write 命令影响的运行配置依赖于您的位置。 当您处于系统执行空间中时,运行配置仅包含系统配置; 当您位于上下文中时,运行配置仅包括相应的上下文。 例如,如果您输入 show running-config 命令,则不能查看所有运行配置(系统和所有上下文)。 将仅显示当前配置。 不过,如果使用 write memory all 命令,则可以从系统执行空间保存所有上下文运行配置。

若要在系统执行空间和上下文之间切换,或者在上下文之间切换,请参考以下这些命令:

  • 若要切换到上下文,请输入以下命令:

    hostname#changeto context <context name>
    

    提示将更改为:

    hostname/name#
    
  • 若要切换到系统执行空间,请输入以下命令:

    hostname/admin#changeto system
    

    提示将更改为:

    hostname#
    

FWSM - contextA 配置

若要配置 contextA,请切换到 contextA 并按照以下过程执行操作:


!--- From the system execution space, 
!--- enter the changeto context contextA command
!--- in order to configure the contextA configuration.

FWSM(config)#changeto context contextA

FWSM/context1(config)#

FWSM - contextA 的默认配置

FWSM/contextA(config)#show running-config


!--- Default configuration of the context1


: Saved
:
FWSM Version 3.2(5)5 <context>
!
hostname contextA
enable password 8Ry2YjIyt7RRXU24 encrypted
names
!
interface Vlan300
 no nameif
 no security-level
 no ip address
!
interface Vlan301
no nameif
 no security-level
 no ip address
!
passwd 2KFQnbNIdI.2KYOU encrypted
gdb enable
pager lines 24
mtu inside 1500
mtu outside 1500
no asdm history enable
arp timeout 14400
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 1:00:00 h225 1:00:00 mgcp 0:05:00
timeout mgcp-pat 0:05:00 sip 0:30:00 sip_media 0:02:00
timeout sip-invite 0:03:00 sip-disconnect 0:02:00
timeout uauth 0:05:00 absolute
no snmp-server location
no snmp-server contact
telnet timeout 5
ssh timeout 5
!
class-map inspection_default
 match default-inspection-traffic
!
!
policy-map global_policy
 class inspection_default
  inspect dns maximum-length 512
  inspect ftp
  inspect h323 h225
  inspect h323 ras
  inspect netbios
  inspect rsh
  inspect skinny
  inspect smtp
  inspect sqlnet
  inspect sunrpc
  inspect tftp
  inspect sip
  inspect xdmcp
!
service-policy global_policy global
Cryptochecksum:00000000000000000000000000000000
: end
FWSM/contextA#
 no nameif
 no security-level
 no ip address
!
passwd 2KFQnbNIdI.2KYOU encrypted
gdb enable
pager lines 24
no asdm history enable
arp timeout 14400
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 1:00:00 h225 1:00:00 mgcp 0:05:00
timeout mgcp-pat 0:05:00 sip 0:30:00 sip_media 0:02:00
timeout sip-invite 0:03:00 sip-disconnect 0:02:00
timeout uauth 0:05:00 absolute
no snmp-server location
no snmp-server contact
telnet timeout 5
ssh timeout 5
!
class-map inspection_default
 match default-inspection-traffic
!
!
policy-map global_policy
 class inspection_default
  inspect dns maximum-length 512
  inspect ftp
  inspect h323 h225
  inspect h323 ras
  inspect netbios
  inspect rsh
  inspect skinny
  inspect smtp
  inspect sqlnet
  inspect sunrpc
  inspect tftp
  inspect sip
  inspect xdmcp
!
service-policy global_policy global
Cryptochecksum:00000000000000000000000000000000
: end

 

 

客户 A 的 Internet 连接配置。

FWSM - contextA 的配置

FWSM/contextA(config)#interface vlan300
FWSM/contextA(config-if)#nameif inside
WARNING: VLAN *300* is not configured.
INFO: Security level for "inside" set to 100 by default.
Access Rules Download Complete: Memory Utilization: 1%
FWSM/contextA(config-if)#ip address 10.1.1.1 255.255.255.0
FWSM/contextA(config-if)#no shut

FWSM/contextA(config-if)#interface vlan 301
FWSM/contextA(config-if)#nameif outside
INFO: Security level for "outside" set to 0 by default.
Access Rules Download Complete: Memory Utilization: 1%
FWSM/contextA(config-if)#ip add 192.168.1.1 255.255.255.0
FWSM/contextA(config-if)#no shut

FWSM/contextA(config)#access-list outbound permit ip any any
FWSM/contextA(config)#nat (inside) 1 access-list outbound
FWSM/contextA(config)#global (outside) 1 interface
INFO: outside interface address added to PAT pool
FWSM/contextA(config)#route outside-context1 0.0.0.0 0.0.0.0 192.168.1.5
FWSM/contextA(config)#exit

 

 

FWSM - contextA 配置

FWSM/contextA#show running-config
: Saved
:
FWSM Version 3.2(5)5 <context>
!
hostname contextA
enable password 8Ry2YjIyt7RRXU24 encrypted
names
!
interface Vlan300
 nameif inside
 security-level 100
 ip address 10.1.1.1 255.255.255.0
!
interface Vlan301
 nameif outside
 security-level 0
 ip address 192.168.1.1 255.255.255.0
!
passwd 2KFQnbNIdI.2KYOU encrypted
access-list outbound extended permit ip any any
gdb enable
pager lines 24
mtu inside 1500
mtu outside 1500
no asdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 1 access-list outbound
route outside 0.0.0.0 0.0.0.0 192.168.1.5 1


!--- Output Suppressed


!
class-map inspection_default
 match default-inspection-traffic
!
!
policy-map global_policy
 class inspection_default
  inspect dns maximum-length 512
  inspect ftp
  inspect h323 h225
  inspect h323 ras
  inspect netbios
  inspect rsh
  inspect skinny
  inspect smtp
  inspect sqlnet
  inspect sunrpc
  inspect tftp
  inspect sip
  inspect xdmcp
!
service-policy global_policy global
Cryptochecksum:00000000000000000000000000000000
: end
FWSM/contextA#

 

 

FWSM - contextB 配置

客户 B 的 Internet 连接配置。

若要配置 contextB,请从 contextA 切换到 contextB:


!--- From the system execution space, enter  
!--- the changeto context contextB command
--- in orderto configure the contextB configuration.

FWSM/contextA(config)#changeto context contextB
FWSM/contextB(config)#

FWSM - contextB 配置

FWSM/contextB(config)#show running-config
: Saved
:
FWSM Version 3.2(5)5 <context>
!
hostname contextB
enable password 8Ry2YjIyt7RRXU24 encrypted
names
!
interface Vlan400
 nameif inside
 security-level 100
 ip address 10.2.2.1 255.255.255.0
!
interface Vlan401
 nameif outside
 security-level 0
 ip address 192.168.2.1 255.255.255.0
!
passwd 2KFQnbNIdI.2KYOU encrypted
access-list outbound extended permit ip any any
gdb enable
pager lines 24
mtu inside 1500
mtu outside 1500
no asdm history enable
arp timeout 14400
global (outside) 1 interface
nat (inside) 1 access-list outbound
route outside 0.0.0.0 0.0.0.0 192.168.2.5 1

!--- Output Suppressed


!
class-map inspection_default
 match default-inspection-traffic
!
!
policy-map global_policy
 class inspection_default
  inspect dns maximum-length 512
  inspect ftp
  inspect h323 h225
  inspect h323 ras
  inspect netbios
  inspect rsh
  inspect skinny
  inspect smtp
  inspect sqlnet
  inspect sunrpc
  inspect tftp
  inspect sip
  inspect xdmcp
!
service-policy global_policy global
Cryptochecksum:00000000000000000000000000000000
: end
FWSM/contextB(config)#

 

 

同样,配置管理上下文以便从内部和外部接口管理 FWSM 及其上下文。

在多上下文模式中保存配置更改

您可以分别保存每个上下文(和系统)配置,也可以同时保存所有上下文配置。 本部分包括以下主题:

分别保存每个上下文和系统

若要保存系统或上下文配置,请在系统或上下文中输入以下命令:

hostname#write memory

注意: copy running-config startup-config 命令与 write memory 命令等效。

对于多上下文模式,上下文启动配置可以驻留在外部服务器上。 在这种情况下,安全设备会将配置保存回您在上下文 URL(HTTP 或 HTTPS URL 除外,它们不让您将配置保存到服务器)中标识的服务器。

同时保存所有上下文配置

若要同时保存所有上下文配置以及系统配置,请在系统执行空间中输入以下命令:

hostname#write memory all [/noconfirm]

如果不输入 /noconfirm 关键字,则会看到以下提示:

Are you sure [Y/N]:

验证

使用本部分可确认配置能否正常运行。

命令输出解释程序工具仅限注册用户)(OIT) 支持某些 show 命令。 使用 OIT 可查看对 show 命令输出的分析。

  • show context - 显示各种上下文。

    FWSM(config)#show context
    Context Name      Class      Interfaces           Mode         URL
    *admin            default    Vlan501,Vlan502      Routed       disk:/admin.cfg
     contextA         default    Vlan300,Vlan301      Routed       disk:/contextA.cfg
     contextB         default    Vlan400,Vlan401      Routed       disk:/contextB.cfg
    
    Total active Security Contexts: 3
  • show mode - 验证 FWSM 是配置成了单一模式还是多模式。

    FWSM(config)#show mode
    Security context mode: multiple
    The flash mode is the SAME as the running mode.

故障排除

还原单一上下文模式

如果您从多模式转换到单一模式,则可能需要首先将完全启动配置(如果存在)复制到 FWSM; 从多模式继承的系统配置不是单一模式设备的完全有效配置。 由于系统配置没有将任何网络接口作为其配置的一部分,因此,您必须从控制台访问安全设备以执行复制。

若要将旧的运行配置复制到启动配置,并将模式更改为单一模式,请在系统执行空间中完成以下这些步骤:

  1. 若要将原始运行配置的备份版本复制到当前启动配置,请在系统执行空间中输入以下命令:

    hostname(config)#copy flash:old_running.cfg startup-config
    
  2. 若要将模式设置为单一模式,请在系统执行空间中输入以下命令:

    hostname(config)#mode single
    

FWSM 将重新启动。

重新加载安全上下文

您可以通过以下两种方式重新加载上下文:

  1. 清除运行配置,然后导入启动配置。

    此操作会清除与上下文关联的大多数属性,例如连接和 NAT 表。

  2. 从系统配置删除上下文。

    此操作会清除可用于故障排除的其他属性,例如内存分配。 但是,若要将上下文添加回系统,则需要您重新指定 URL 和接口。

本部分包括以下主题:

重命名上下文

在多上下文模式中,不支持在不更改配置的情况下重命名上下文。

您可以将配置保存为防火墙配置,但需要将整个配置复制到新的上下文名称,并删除旧的上下文配置。

删除上下文

使用以下命令可删除上下文。 从系统执行空间发出以下命令:

no context contA

并且,确保删除上下文的对应配置文件。

dir disk:
 
delete disk:/contA.cfg

 

 

注:本人能力有限,如遇不足之处,还请指正!

China-CCIE  QQ交流群:106155045   点击与作者QQ交谈