等保和分保网络配置尤其是基本要求大部分是相同的,主要差别体现在分保网络中是不允许出现DHCP、NAT转换的,在分保网络中设备不允许基于接口或者全局下获取IP地址,必须设置静态IP并且需要配置“端口 IP MAC”,下面我就罗列一些常用的网络配置以供参考下面都以华为设备为例,现在小编就来说说关于交换机五种配置模式命令?下面内容希望能帮助到你,我们来一起看看吧!

交换机五种配置模式命令(等保与分保网络中交换机常见配置汇总)

交换机五种配置模式命令

等保和分保网络配置尤其是基本要求大部分是相同的,主要差别体现在分保网络中是不允许出现DHCP、NAT转换的,在分保网络中设备不允许基于接口或者全局下获取IP地址,必须设置静态IP并且需要配置“端口 IP MAC”,下面我就罗列一些常用的网络配置以供参考。下面都以华为设备为例。

1.配置Console用户界面

配置Console用户界面的用户优先级、验证方式和验证密码。

[Huawei] user-interface console 0

[Huawei-ui-console0] user privilege level 15

[Huawei-ui-console0] authentication-mode password

[Huawei-ui-console0] set authentication password cipher

[Huawei-ui-console0] quit

验证方式也可设置AAA认证

user-interface console 0

authentication-mode aaa

quit

aaa

local-user user-name password irreversible-cipher password,配置本地用户名和密码。 说明:配置的密码长度不能超过16位。

local-user user-name service-type terminal,配置本地用户的接入类型为Console用户。

quit

2.配置VTY用户界面(示例如下)

配置VTY用户界面的最大个数为8,有呼入呼出限制,实现限制某一IP地址或地址段的用户登录设备,需要配置终端属性和用户优先级,并配置VTY用户界面的验证方式和验证密码。

  1. 配置VTY用户界面的最大个数

[Huawei] user-interface maximum-vty 8

配置VTY用户界面的呼入呼出限制类型

[Huawei] ACL 2000

[Huawei-acl-basic-2000] rule deny source 10.1.1.1 0

[Huawei-acl-basic-2000] rule permit source any

[Huawei-acl-basic-2000] quit

[Huawei] user-interface vty 0 7

[Huawei-ui-vty0-7] acl 2000 inbound

配置VTY用户界面的终端属性

[Huawei-ui-vty0-7] shell

[Huawei-ui-vty0-7] idle-timeout 30

[Huawei-ui-vty0-7] screen-length 30

[Huawei-ui-vty0-7] history-command max-size 20

配置VTY用户界面的用户优先级

[Huawei-ui-vty0-7] user privilege level 2

配置VTY用户界面的用户验证方式为密码验证

[Huawei-ui-vty0-7] authentication-mode password

[Huawei-ui-vty0-7] set authentication password cipher

Enter Password(<8-128>):

Confirm Password:

[Huawei-ui-vty0-7] quit

3.配置用户通过ssh登录设备

sysname SSH Server # acl number 2001 rule 5 permit source 10.137.217.10 0 rule 10 permit source 10.137.217.20 0 rule 15 deny source 10.137.217.30 0 # rsa peer-public-key rsakey001 public-key-code begin 30820107 02820100 DD89041A 5E30AA97 6F384B5D B366A704 8C0E7906 EC6B088B B9567D75 914B5B4E A7B2E519 38D1184B 863A38BA 7E0F0DBE 5C5AE4CA 55B192B5 31AC48B0 7D21E362 E3F2A58C 04C443CF 51CF5113 6B5B9E81 2AB1B712 50EB24A4 AE5083A1 DB18ECE2 395C9BB8 06E8F00B E24FB516 95878440 3B617F8A AAB1F8C6 DE8C3CF0 9E4D237D 1C17BF4A AF09C474 C083AF17 CD307533 96B32232 C57FF0B1 99197102 F1033B81 AA6D4744 520F2368 5FAF7204 BA4B6E61 5EF22414 E64E2A33 1EEB7F18 8D980596 DBFD300C 947A5ABA 879DC4F8 48B76951 3C35CDB5 2B291702 B77693F7 9910EE52 87F25297 7F985E5F 186C9493 F267804E 7F5F9D52 87350A0A 4F49881B F6AB7C1B 0201 25 public-key-code end peer-public-key end # aaa local-user client001 password irreversible-cipher %@%@*~Br";[g6Pv5Zf>$~{hY N!`{$<[Y{;l02P)B,EBz\1FN!c %@%@ local-user client001 privilege level 3 local-user client001 service-type ssh local-user client002 password irreversible-cipher %@%@HW=5%Mr;:2)/RX$FnU1HLO%-TBMp4wn%;~\#%iAut}_~O%0L%@%@ local-user client002 privilege level 3 local-user client002 service-type ssh # ssh user client002 assign rsa-key rsakey001 ssh user client002 authentication-type rsa stelnet server enable # user-interface vty 0 4 acl 2001 inbound authentication-mode aaa protocol inbound ssh

4.配置告警管理

  1. 配置snmpv3用户和网管主机

snmp-agent

snmp-agent sys-info version v3

snmp-agent mib-view linkdown include linkDown

snmp-agent group v3 huawei privacy notify-view linkdown

snmp-agent usm-user v3 user authentication-mode md5

snmp-agent usm-user v3 user privacy-mode aes128

snmp-agent target-host trap-paramsname params v3 securityname huawei privacy

snmp-agent target-host trap-hostname nms address 10.1.1.1 udp-port 162 trap-paramsname params

snmp-agent trap enable feature-name IFNET trap-name linkDown

delay-suppression enable使能告警延迟上报功能

5.配置接口安全和基于VLAN的MAC地址学习限制

Vlan batch 100 200 interface Ethernet2/0/1 port link-type trunk port trunk allow-pass vlan 100 port-security enable port-security protect-action protect port-security mac-address sticky port-security max-mac-num 4 vlan 200 mac-limit maximum 500 # interface Ethernet2/0/2 port link-type trunk port trunk allow-pass vlan 100 200 interface Ethernet2/0/3 port link-type trunk port trunk allow-pass vlan 200

6.ACL配置

应用高级ACL配置流分类示例

time-range satime 08:00 to 17:30 working-day # vlan batch 10 20 30 100 # acl number 3002 rule 5 deny ip source 10.164.2.0 0.0.0.255 destination 10.164.9.9 0 time-range satime acl number 3003 rule 5 deny ip source 10.164.3.0 0.0.0.255 destination 10.164.9.9 0 time-range satime traffic classifier c_market operator or if-match acl 3002 traffic classifier c_rd operator or if-match acl 3003 traffic behavior b_market deny traffic behavior b_rd deny traffic policy p_market classifier c_market behavior b_market traffic policy p_rd classifier c_rd behavior b_rd interface Vlanif10 ip address 10.164.1.1 255.255.255.0 interface Vlanif20 ip address 10.164.2.1 255.255.255.0 interface Vlanif30 ip address 10.164.3.1 255.255.255.0 interface Vlanif100 ip address 10.164.9.1 255.255.255.0 interface Ethernet2/0/0 port link-type access port default vlan 10 interface Ethernet2/0/1 port link-type access port default vlan 20 traffic-policy p_market inbound interface Ethernet2/0/2 port link-type access port default vlan 30 traffic-policy p_rd inbound interface Ethernet2/0/3 port link-type access port default vlan 100应用二层ACL配置流分类示例

7.应用二层ACL配置流分类示例

acl number 4000 rule 5 deny destination-mac 0260-e207-0002 source-mac 00e0-f201-0101 # traffic classifier tc1 operator or if-match acl 4000 # traffic behavior tb1 deny # traffic policy tp1 classifier tc1 behavior tb1 # interface GigabitEthernet2/0/0 traffic-policy tp1 inbound

8.攻击防范配置

anti-attack fragment car cir 15000 使能畸形报文攻击防范功能,避免畸形报文攻击。 anti-attack tcp-syn car cir 15000 使能分片报文攻击防范功能,避免分片报文攻击。 anti-attack icmp-flood car cir 15000 使能泛洪攻击防范功能,避免泛洪攻击。 interface Ethernet2/0/0接口下配置流量抑制 unicast-suppression packets 12600未知单播报文以包模式进行流量抑制 multicast-suppression packets 25200组播报文以包模式进行流量抑制 broadcast-suppression packets 12600广播报文以包模式进行流量抑制

9.配置arp安全综合功能

arp-miss speed-limit source-ip maximum 20 arp learning strict 配置ARP表项严格学习功能 arp-miss speed-limit source-ip 10.3.3.1 maximum 40 配置根据源IP地址进行ARP Miss消息限速 arp speed-limit source-ip 10.2.2.1 maximum 10 配置根据源IP地址进行ARP限速 arp speed-limit source-mac 0001-0001-0001 maximum 10 配置根据源MAC地址进行ARP限速 arp anti-attack entry-check fixed-mac enable 配置ARP表项固化功能

10.配置本地镜像端口

observe-port interface Ethernet2/0/2 //配置本地观察端口

interface Ethernet2/0/0 mirror to observe-port inbound //将Ethernet2/0/0配置为本地镜像端口,并指定对端口入方向的报文进行镜像。

interface Ethernet2/0/1 mirror to observe-port inbound //将Ethernet2/0/1配置为本地镜像端口,并指定对端口入方向的报文进行镜像。

,