基于公网的带内网管
选择一个业务接口和Loopback接口,作为管理接口
组网需求
无
配置思路
在业务接口和管理用Loopback接口下配置IP地址,并且都不绑定VPN。
数据准备
无
# 在业务接口和管理用Loopback接口下配置IP地址
[*HUAWEI-GigabitEthernet0/3/1] ip address 10.3.1.1 24 [*HUAWEI-GigabitEthernet0/3/1] commit [~HUAWEI-GigabitEthernet0/3/1] display this # interface GigabitEthernet0/3/1 undo shutdown ip address 10.3.1.1 255.255.255.0 # [~HUAWEI-GigabitEthernet0/3/1] quit [~HUAWEI] interface LoopBack 0 [~HUAWEI-LoopBack0] ip address 1.1.1.1 32 [*HUAWEI-LoopBack0] commit [~HUAWEI-LoopBack0] display this # interface LoopBack0 ip address 1.1.1.1 255.255.255.255 #
通过Ma-defend禁止从其他业务口上送管理协议报文
组网需求
为了保证只从某些业务口上接收管理协议报文,可以只放开部分特定业务口接收某些管理协议报文的能力,而禁止其他业务口上送管理协议报文。
配置思路
- 系统视图下,创建全局的ma-defend策略,禁止上送管理协议报文。
- 系统视图下,配置接口策略,允许特定管理协议报文通过。
- 在接口视图下,应用配置的接口策略。
- 查看配置结果以及丢弃报文计数。
- 创建全局的ma-defend策略,禁止从业务面上送ftp、snmp、ssh、telnet、tftp管理协议
[~HUAWEI] ma-defend global-policy [*HUAWEI-app-sec-global] protocol ftp deny [*HUAWEI-app-sec-global] protocol snmp deny [*HUAWEI-app-sec-global] protocol ssh deny [*HUAWEI-app-sec-global] protocol telnet deny [*HUAWEI-app-sec-global] protocol tftp deny [*HUAWEI-app-sec-global] enable [*HUAWEI-app-sec-global] commit [~HUAWEI-app-sec-global] quit
- 配置允许GE0/3/1上送telnet等管理协议
[~HUAWEI] ma-defend interface-policy 1 [*HUAWEI-app-sec-interface-1] protocol ftp permit [*HUAWEI-app-sec-interface-1] protocol snmp permit [*HUAWEI-app-sec-interface-1] protocol ssh permit [*HUAWEI-app-sec-interface-1] protocol telnet permit [*HUAWEI-app-sec-interface-1] protocol tftp permit [*HUAWEI-app-sec-interface-1] commit [~HUAWEI-app-sec-interface-1] quit [~HUAWEI] interface gigabitethernet0/3/1 [~HUAWEI-GigabitEthernet0/3/1] ma-defend-interface 1 [*HUAWEI-GigabitEthernet0/3/1] commit [~HUAWEI-GigabitEthernet0/3/1] quit
说明:
当前配置情况下,只有配置举例的GE0/3/1接口可以接入,包括管理口在内的其他接口将无法接入,如果已经接入的设备将会脱管。
- 查看配置结果
[~HUAWEI] display ma-defend all MA-defend policy type: global-policy ---------------------------------------------------- The global-policy is enabled -------------------------------------------------- protocol rule -------------------------------------------------- FTP deny SSH deny SNMP deny TELNET deny TFTP deny ---------------------------------------------------- MA-defend policy type: interface-policy 1 ---------------------------------------------------- The interface-policy is bound to interface: GigabitEthernet0/3/1 -------------------------------------------------- protocol rule -------------------------------------------------- FTP permit SSH permit SNMP permit TELNET permit TFTP permit
- 查看是否所有业务口均不能上送管理协议,管理协议均被丢弃(可以查看统计计数),如下所示:
[~HUAWEI] display cpu-defend ma-defend statistics Slot/Intf Attack-Type Total-Packets Passed-Packets Dropped-Packets -------------------------------------------------------------------------------- 3 MA-Defend 100 20 80 -------------------------------------------------------------------------------- FTP SERVER 100 20 80
服务器对呼入呼出的限制
组网需求
缺省情况下,服务器端接收来自所有接口登录连接请求,系统安全性比较低。为了提高系统安全性,可以通过指定服务器端的源接口、源地址,增加登录受限功能,只有通过指定源接口、源地址才可以登录服务器。
配置思路
- 配置客户端与所要设置的源接口三层互通。
- 为各服务器配置源接口、源地址。
- 如果服务器仅接受从指定源接口、源地址进来的连接,则配置成功。
数据准备
无
telnet server
设置源接口之后,客户端将只能通过该接口登录Telnet服务器。
[~HUAWEI] telnet server-source -i LoopBack 1 Warning: Telnet server source configuration will take effect in the next login. Do you want to continue? [Y/N]:y Info: Succeeded in setting the source interface of the Telnet server to LoopBack1.
[~HUAWEI] telnet ipv6 server-source -a 3::2 Warning: Telnet server source configuration will take effect in the next login. Do you want to continue? [Y/N]:y
SSH server
设置源接口之后,客户端将只能通过该接口登录SSH服务器。
[~HUAWEI] ssh server-source -i LoopBack 1 Warning: SSH server source configuration will take effect in the next login. Do you want to continue? [Y/N]:y Info: Succeeded in setting the source interface of the SSH server to LoopBack1.
[~HUAWEI] ssh ipv6 server-source -a 3::2 Warning: SSH server source configuration will take effect in the next login. Do you want to continue? [Y/N]:y
FTP server
设置源地址之后,客户端将只能通过该地址登录FTP服务器。
[~HUAWEI] ftp server-source -a 1.1.1.1 Info: Succeeded in setting the source address of the FTP server to 1.1.1.1.
[~HUAWEI] ftp ipv6 server-source -a 3::2 Warning: To make the server source configuration take effect, the FTP server will be restarted. Continue? [Y/N]:y
设置源接口之后,客户端将只能通过该接口登录FTP服务器。
[~HUAWEI] ftp server-source -i LoopBack 1 Info: Succeeded in setting the source interface of the FTP server to LoopBack1.
通过MPAC禁止从其他业务口上送管理协议报文
组网需求
为了保证只从某些业务口上接收管理协议报文,可以只放开部分特定业务口接收某些管理协议报文的能力,而禁止其他业务口上送管理协议报文。
配置思路
- 系统视图下,创建MPAC策略视图global,以及interface。
- Global视图配置禁止管理协议上送的rule,interface视图配置允许管理协议上送的rule。
- 将MPAC global策略全局绑定,将interface策略绑定到接口GE0/3/1以及管理网口GE0/0/0。
- 查看配置结果以及丢弃报文计数。
- 系统视图下,创建MPAC策略视图global,以及interface
[~HUAWEI] service-security policy ipv4 global [*HUAWEI-service-sec-global] commit [*HUAWEI-service-sec-global] quit [~HUAWEI] service-security policy ipv4 interface [*HUAWEI-service-sec-interface] commit [*HUAWEI-service-sec-global] quit
- global视图配置禁止上送ftp、snmp、ssh、telnet、tftp管理协议的rule,interface视图配置允许上送ftp、snmp、ssh、telnet、tftp管理协议的rule
[*HUAWEI-service-sec-global] rule deny protocol ftp [*HUAWEI-service-sec-global] rule deny protocol snmp [*HUAWEI-service-sec-global] rule deny protocol ssh [*HUAWEI-service-sec-global] rule deny protocol telnet [*HUAWEI-service-sec-global] rule deny protocol tftp [*HUAWEI-service-sec-global] commit [~HUAWEI-service-sec-global] quit [*HUAWEI-service-sec-interface] rule permit protocol ftp [*HUAWEI-service-sec-interface] rule permit protocol snmp [*HUAWEI-service-sec-interface] rule permit protocol ssh [*HUAWEI-service-sec-interface] rule permit protocol telnet [*HUAWEI-service-sec-interface] rule permit protocol tftp [*HUAWEI-service-sec-interface] commit [~HUAWEI-service-sec-interface] quit
- 将interface策略绑定到接口GE0/3/1以及管理网口GE0/0/0,将MPAC global策略全局绑定。
[~HUAWEI] interface GigabitEthernet 0/0/0 [*HUAWEI-GigabitEthernet0/0/0] service-security binding ipv4 interface [*HUAWEI-GigabitEthernet0/0/0] commit [~HUAWEI-GigabitEthernet0/0/0] quit [~HUAWEI] interface GigabitEthernet 0/3/1 [*HUAWEI-GigabitEthernet0/3/1] service-security binding ipv4 interface [*HUAWEI-GigabitEthernet0/3/1] commit [~HUAWEI-GigabitEthernet0/3/1] quit [*HUAWEI] service-security global-binding ipv4 global [*HUAWEI] commit
- 查看配置结果
[~HUAWEI] display service-security binding ipv4 Configured : Global Policy Name: global Interface : GigabitEthernet0/0/0 Policy Name: interface Interface : GigabitEthernet0/3/1 Policy Name: interface [~HUAWEI] display service-security policy ipv4 Policy Name : global Step : 5 rule 5 deny protocol ftp rule 10 deny protocol snmp rule 15 deny protocol ssh rule 20 deny protocol tftp rule 25 deny protocol telnet Policy Name : interface Step : 5 rule 5 permit protocol ftp rule 10 permit protocol snmp rule 15 permit protocol ssh rule 20 permit protocol tftp rule 25 permit protocol telnet
- 查看是否所有业务口均不能上送管理协议,管理协议均被丢弃(可以查看统计计数),如下所示:
[~HUAWEI] display service-security statistics ipv4 Policy Name : global Step : 5 rule 5 deny protocol ftp (9 times matched) rule 10 deny protocol snmp (0 times matched) rule 15 deny protocol ssh (0 times matched) rule 20 deny protocol tftp (0 times matched) rule 25 deny protocol telnet (20 times matched) Policy Name : interface Step : 5 rule 5 permit protocol ftp (100 times matched) rule 10 permit protocol snmp (0 times matched) rule 15 permit protocol ssh (0 times matched) rule 20 permit protocol tftp (0 times matched) rule 25 permit protocol telnet (652 times matched)