关于网络设备或是服务器, 管理人员几乎很少会守着设备进行维护及管理, 最普遍, 应用最广泛的就是 -- 远程管理. 下面简单介绍一下华为防火墙管理的几种方式.
博文大纲:
一, 华为防火墙常见的管理方式;
二, 各种管理方式配置详解;
1. 通过 Console 线进行管理;
2. 通过 Telnet 方式管理;
3. 通过 web 方式登录设备;
4. 配置 SSH 方式登录设备;
一, 华为防火墙常见的管理方式
提到管理, 必然会涉及到 AAA 的概念, 我们首先来了解一下 --AAA.
AAA 概述
AAA 是验证, 授权和记账三个英文单词的简称. 是一个能够处理用户访问请求的服务器程序, 主要目的是管理用户访问网络服务器, 为具有访问权限的用户提供服务.
其中:
验证: 哪些用户可以访问网络服务器;
授权: 具有访问权限的用户可以得到哪些服务, 具有什么样的权限;
记账: 如何对正在使用网络资源的用户进行审计;
AAA 服务器通常同网络访问控制, 网关服务器, 数据库及用户信息目录等协同工作. 若要访问网络资源, 首先要进行用户的入网认证, 这样才能访问网络资源. 鉴别的过程就是验证用户身份的合法性; 鉴别完成后, 才能对用户访问网络资源进行授权, 并对用户访问网络资源进行计费管理.
网络设备的 AAA 认证方式有本地验证, 远程身份验证两大类.
本地验证就是将用户和密码在本地创建并验证;
远程身份验证通过各个厂商自由的 AAA 服务器来完成, 这需要设备和 AAA 服务器进行关联;
华为防火墙常见的管理方式有:
通过 Console 方式管理: 属于带外管理, 不占用带宽, 适用于新设备的首次配置场景;
通过 Telnet 方式管理: 属于带内管理, 配置简单, 安全性低, 资源占用少, 主要适用于安全性不高的场景. 比如: 公司内部;
通过 Web 方式管理, 属于带内管理, 可以基于图形化管理, 更适用于新手配置设备;
通过 SSH 方式管理: 属于带内管理配置复杂, 安全性高, 资源占用高, 主要适用于对安全性要求较高的场景, 如通过互联网远程管理公司网络设备;
二, 各种管理方式配置详解
1. 通过 Console 线进行管理
这种方式适用于刚购买的新设备, 实际环境中, 插上 Console 即可! 这里就不再多说了!
2. 通过 Telnet 方式管理
Telnet 管理方式通过配置使终端通过 Telnet 方式登录设备, 实现对设备的配置和管理. 其实这种环境拓补只需一个防火墙 (版本为 USG6000) 和 Cloud(主要是为了可以桥接到宿主机或虚拟机)即可, 实验拓补如下:
(1)首次登录 Console 控制台时, 按要求配置密码, 如图
(2)配置防火墙接口 IP 地址, 便于日后管理
- <USG6000V1>
- system-view Enter system view, return user view with Ctrl+Z. [USG6000V1]undo
- info enable Info: Information center is disabled. [USG6000V1]int g0/0/0
- [USG6000V1-GigabitEthernet0/0/0]ip add 192.168.1.1 24 [USG6000V1-GigabitEthernet0/0/0]undo
- shutdown Info: Interface GigabitEthernet0/0/0 is not shutdown. [USG6000V1-GigabitEthernet0/0/0]quit
(3)打开防火墙的 Telnet 功能
[USG6000V1]telnet server enable
(4)配置防火墙允许远程管理
- [USG6000V1]int g0/0/0
- [USG6000V1-GigabitEthernet0/0/0]service-manage enable
- // 配置接口管理模式
- [USG6000V1-GigabitEthernet0/0/0]service-manage telnet permit
- // 允许 Telnet
- [USG6000V1-GigabitEthernet0/0/0]quit
(5)将防火墙接口 g0/0/0 加入安全区域
- [USG6000V1]firewall zone trust
- [USG6000V1-zone-trust]add int g0/0/0
- Error: The interface has been added to trust security zone.
- // 这是正常提示, 表示这个接口 已经添加到安全区域中
- [USG6000V1-zone-trust]quit
(6)将防火墙配置域间包过滤, 以保证网络基本通信正常
因为 Telnet 流量属于防火墙自身收发, 所以需要配置 Trust 区域到 Local 区域的安全策略, 命令如下:
- [USG6000V1]security-policy
- [USG6000V1-policy-security]rule name allow_telent
- // 配置规则, 其中 allow_telnet 为规则名, 可自定义
- [USG6000V1-policy-security-rule-allow_telent]source-zone trust
- // 匹配条件, 源区域是 trust 区域
- [USG6000V1-policy-security-rule-allow_telent]destination-zone local
- // 匹配条件, 目标区域是 local 区域
- [USG6000V1-policy-security-rule-allow_telent]action permit
- // 匹配条件满足后, 执行的动作, permit 为允许的意思
- [USG6000V1-policy-security-rule-allow_telent]quit
- [USG6000V1-policy-security]quit
(7)配置认证模式及本地用户信息
- [USG6000V1]user-interface vty 0 4
- [USG6000V1-ui-vty0-4]authentication-mode aaa
- // 用户接口验证方式为 AAA
- [USG6000V1-ui-vty0-4]protocol inbound telnet
- // 允许 Telnet 连接虚拟终端
- [USG6000V1-ui-vty0-4]quit
- [USG6000V1]aaa
- [USG6000V1-aaa]manager-user lzj
- // 配置本地用户 lzj
- [USG6000V1-aaa-manager-user-lzj]password cipher [email protected]
- // 配置用户密码(cipher 为密文方式)
- Info: You are advised to config on man-machine mode.
- // 建议使用 man-machine 方式配置密码
- [USG6000V1-aaa-manager-user-lzj]service-type telnet
- // 配置服务类型为 telnet
- [USG6000V1-aaa-manager-user-lzj]level 3
- // 配置用户权限级别
- [USG6000V1-aaa-manager-user-lzj]quit
- [USG6000V1-aaa]quit
注意: USG6000 系列属于最新版本, 配置本地用户名和密码需要使用 manager-user 命令, 之前的版本则使用 local-user 命令.
(8)客户端测试访问
客户端 Telnet 访问成功!
3. 通过 Web 方式登录设备
建议在模拟器上重新部署设备, 当然也可在 Telnet 的基础上继续配置 Web 方式访问! 为了简单明了, 朋友更加明白配置 Web 方式, 本人重新画实验拓补, 实验拓补还是原本的样子, 一朵 Cloud 模拟真实客户端, 一台 USG6000 防火墙. 配置命令如下:
- <USG6000V1>sys
- Enter system view, return user view with Ctrl+Z.
- [USG6000V1]undo info enable
- Info: Information center is disabled.
- [USG6000V1]int g0/0/0
- [USG6000V1-GigabitEthernet0/0/0]ip add 192.168.1.254 24
- [USG6000V1-GigabitEthernet0/0/0]undo shutdown
- Info: Interface GigabitEthernet0/0/0 is not shutdown.
- [USG6000V1-GigabitEthernet0/0/0]service-manage http permit
- [USG6000V1-GigabitEthernet0/0/0]service-manage https permit
- [USG6000V1-GigabitEthernet0/0/0]quit
- // 打开接口的 http 和 https 管理
- [USG6000V1]firewall zone trust
- [USG6000V1-zone-trust]add int g0/0/0
- Error: The interface has been added to trust security zone.
- // 正常提示, 可以忽略
- [USG6000V1-zone-trust]quit
- // 配置接口加入 Trust 区域
- [USG6000V1]security-policy
- [USG6000V1-policy-security]rule name allow_web
- [USG6000V1-policy-security-rule-allow_web]source-zone trust
- [USG6000V1-policy-security-rule-allow_web]destination-zone local
- [USG6000V1-policy-security-rule-allow_web]action permit
- [USG6000V1-policy-security-rule-allow_web]quit
- [USG6000V1-policy-security]quit
- // 如果在 Telnet 基础上配置 Web 方式访问, 这些安全配置可以忽略
- [USG6000V1]Web-manager security enable
- // 开启 https 安全访问功能
- [USG6000V1]aaa
- [USG6000V1-aaa]manager-user lzj
- [USG6000V1-aaa-manager-user-lzj]password
- Enter Password:
- Confirm Password:
- // 在这种模式下, 配置的密码将不可见, 这也是华为推荐的方式
- [USG6000V1-aaa-manager-user-lzj]service-type Web
- // 指定服务类型
- [USG6000V1-aaa-manager-user-lzj]level 3
- // 指定权限级别
- [USG6000V1-aaa-manager-user-lzj]quit
- [USG6000V1-aaa]quit
注意:
其中 "web-manager security enable" 命令后也可以自定义端口, 比如: Web-manager security enableport 2000, 执行 security 参数, 是开启 https 管理, 不加 security 参数则表示可以开启 http 管理. 绝对不允许 https 和 http 管理使用相同的端口, 这样配置会导致端口冲突. 访问失败!
客户端访问验证:
客户端通过 Web 方式访问成功!
4. 配置 SSH 方式登录设备
为了初学者能够看明白, 这里还是重新部署设备, 实验拓补, 跟前两种方式一样! 也可在之前的基础继续配置, 根据自己能力即可! SSH 方式登录设备, 配置命令如下:
- <USG6000V1>sys
- Enter system view, return user view with Ctrl+Z.
- [USG6000V1]undo info enable
- Info: Information center is disabled.
- [USG6000V1]int g0/0/0
- [USG6000V1-GigabitEthernet0/0/0]ip add 192.168.1.20 24
- [USG6000V1-GigabitEthernet0/0/0]undo shutdown
- Info: Interface GigabitEthernet0/0/0 is not shutdown.
- [USG6000V1-GigabitEthernet0/0/0]service-manage enable
- [USG6000V1-GigabitEthernet0/0/0]service-manage SSH permit
- [USG6000V1-GigabitEthernet0/0/0]quit
- // 打开接口的 SSH 管理
- [USG6000V1]firewall zone trust
- [USG6000V1-zone-trust]add int g0/0/0
- Error: The interface has been added to trust security zone.
- // 正常提示, 可以忽略
- [USG6000V1-zone-trust]quit
- [USG6000V1]security-policy
- [USG6000V1-policy-security]rule name allow_ssh
- [USG6000V1-policy-security-rule-allow_ssh]source-zone trust
- [USG6000V1-policy-security-rule-allow_ssh]destination-zone local
- [USG6000V1-policy-security-rule-allow_ssh]action permit
- [USG6000V1-policy-security-rule-allow_ssh]quit
- [USG6000V1-policy-security]quit
- [USG6000V1]
- // 配置安全策略, 如果在 Web 方式或者 Telnet 方式之后, 这些步骤可以省略
- [USG6000V1]rsa local-key-pair create
- // 创建 SSH 所需的密钥对
- The key name will be: USG6000V1_Host
- The range of public key size is (512 ~ 2048).
- NOTES: If the key modulus is greater than 512,
- it will take a few minutes.
输入默认的密钥长度, 默认值为 2048
- Input the bits in the modulus[default = 2048]:
- Generating keys...
- .+++++
- ........................++
- ....++++
- ...........++
- [USG6000V1]user-interface vty 0 4
- [USG6000V1-ui-vty0-4]authentication-mode aaa
- Warning: The level of the user-interface(s) will be the default level of AAA use
- rs, please check whether it is correct.
- [USG6000V1-ui-vty0-4]protocol inbound SSH
- [USG6000V1-ui-vty0-4]quit
- // 并且开启 SSH 协议访问
- [USG6000V1]SSH user lzj
- // 指定 lzj 为 SSH 用户
- [USG6000V1]SSH user lzj authentication-type password
- // 配置认证方式
- [USG6000V1]SSH user lzj service-type stelnet
- // 配置服务类型
- [USG6000V1]aaa
- [USG6000V1-aaa]manager-user lzj
- // 创建本地用户 lzj
- [USG6000V1-aaa-manager-user-lzj]password cipher [email protected]
- Info: You are advised to config on man-machine mode.
- // 提示建议使用 man-machine 模式设置密码
- [USG6000V1-aaa-manager-user-lzj]service-type SSH
- // 指定服务类型为 SSH
- [USG6000V1-aaa-manager-user-lzj]level 3
- // 管理模式为 3
- [USG6000V1-aaa-manager-user-lzj]quit
- [USG6000V1-aaa]quit
- [USG6000V1]stelnet server enable
- // 开启 SSH 服务
客户端访问测试:
本人习惯使用 xshell, 个人习惯, cmd 命令框也可以的!
客户端 SSH 方式访问成功!
来源: http://www.bubuko.com/infodetail-3252965.html