首先,我们需要定义一个高级访问控制列表(ACL)来阻止特定的网络端口,这些端口常常被病毒利用来传播。以下是一些常见的病毒传播端口及其对应的阻止规则:
```html acl name anti_worm advanced rule 0 deny udp destination-port eq TFTP rule 1 deny tcp destination-port eq 135 rule 2 deny udp destination-port eq 135 rule 3 deny udp destination-port eq 137 rule 4 deny udp destination-port eq 138 rule 5 deny tcp destination-port eq 139 rule 6 deny udp destination-port eq netBIOS-ssn rule 7 deny tcp destination-port eq 445 rule 8 deny udp destination-port eq 445 rule 9 deny tcp destination-port eq 539 rule 10 deny udp destination-port eq 539 rule 11 deny tcp destination-port eq 593 rule 12 deny udp destination-port eq 593 rule 13 deny udp destination-port eq 1434 rule 14 deny tcp destination-port eq 4444 ```
此外,我们还应该阻止ICMP流量,因为ICMP经常被用于网络攻击和病毒传播。以下是阻止所有ICMP流量的规则:
```html acl name anti_icmp advanced rule 0 deny icmp ```
接下来,我们需要将这些规则以“not-carefor-interface”方式全局下发到交换机的各个芯片上。这意味着这些规则将应用于芯片上的所有端口,而不仅仅是单个端口。以下是如何将这些规则应用到一个具体的示例中:
```html int e1/0/1 packet-filter inbound ip-group anti_worm not-care-for-interface packet-filter inbound ip-group anti_icmp not-care-for-interface
int e2/0/1 packet-filter inbound ip-group anti_worm not-care-for-interface packet-filter inbound ip-group anti_icmp not-care-for-interface
int e2/0/48 packet-filter inbound ip-group anti_worm not-care-for-interface packet-filter inbound ip-group anti_icmp not-care-for-interface ```
需要注意的是,`not-carefor-interface`参数的作用是将规则应用于整个芯片,而不仅仅是在指定的端口。对于FT48单板,它包含两个芯片,每个芯片控制24个端口。因此,在任意端口应用带此参数的规则,都会在整个芯片上生效。
对于其他单板,由于它们只包含一个芯片,因此规则应用方式相同,但适用范围略有不同。
通过上述配置,我们可以有效地阻止病毒通过特定端口传播,同时减少不必要的ICMP流量,从而提高网络的整体安全性。虽然这只是一个基本的防病毒配置模板,但它为网络管理员提供了一个起点,可以根据具体需求进行调整和完善,确保网络环境的稳定和安全。现在网络病毒肆意横行,给网络的正常应用带来了很大的隐患,下面给出Quidway S6500系列交换机防病毒配置的一个模版,仅供大家参考:
acl name anti_worm advanced
rule 0 deny udp destination-port eq tftp
rule 1 deny tcp destination-port eq 135
>rule 2 deny udp destination-port eq 135
rule 3 deny udp destination-port eq 137
rule 4 deny udp destination-port eq 138
rule 5 deny tcp destination-port eq 139
rule 6 deny udp destination-port eq netbios-ssn
rule 7 deny tcp destination-port eq 445
rule 8 deny udp destination-port eq 445
rule 9 deny tcp destination-port eq 539
rule 10 deny udp destination-port eq 539
rule 11 deny tcp destination-port eq 593
rule 12 deny udp destination-port eq 593
rule 13 deny udp destination-port eq 1434
rule 14 deny tcp destination-port eq 4444
acl name anti_icmp advanced
rule 0 deny icmp
将以上规则以not-carefor-interface方式在芯片上全局下发,如:
int e1/0/1
packet-filter inbound ip-group anti_worm not-care-for-interface
packet-filter inbound ip-group anti_icmp not-care-for-interface
int e2/0/1
packet-filter inbound ip-group anti_worm not-care-for-interface
packet-filter inbound ip-group anti_icmp not-care-for-interface
int e2/0/48
packet-filter inbound ip-group anti_worm not-care-for-interface
packet-filter inbound ip-group anti_icmp not-care-for-interface
注:
1、 not-carefor-interface参数表示的意思是该规则在整个芯片下发,而不仅仅是在这个端口下发,对于FT48单板来说,一个有两个芯片,前24个端口为一个芯片,后24个端口为一个芯片,在芯片的任何一个端口带该参数下发的规则都在整个芯片上生效。
2、 其他单板为一块芯片。