华为5700设置某一端口组播屏蔽

本实例中以屏蔽 GigabitEthernet0/0/6 的UDP为例,亲测通过。

[Quidway]
[Quidway]acl 3000      
[Quidway-acl-adv-3000]rule 5 deny udp
[Quidway-acl-adv-3000]quit
[Quidway]
Oct  1 2008 07:54:02-05:13 Quidway DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 3, the change loop count is 0, and the maximum number of records is 4095.int gi
[Quidway]int GigabitEthernet 0/0/6
[Quidway-GigabitEthernet0/0/6]traffic-filter outbound acl 3000          //使该端口GigabitEthernet0/0/6不向外传输UDP;
[Quidway-GigabitEthernet0/0/6]traffic-filter inbound acl 3000            //使该端口GigabitEthernet0/0/6不向内传输UDP,与上一命令可以二选一;
[Quidway-GigabitEthernet0/0/6]quit
[Quidway]
Oct  1 2008 07:54:52-05:13 Quidway DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25.191.3.1 configurations have been changed. The current change number is 4, the change loop count is 0, and the maximum number of records is 4095.
[Quidway]quit
<Quidway>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Oct  1 2008 07:55:13-05:13 Quidway %%01CFM/4/SAVE(l)[2]:The user chose Y when deciding whether to save the configuration to the device.
Warning: AutoConfig will stop in the next phase for the manual intervention.
Now saving the current configuration to the slot 0.
Save the configuration successfully.

注:红色部分为需要输入;
描述不清楚的地方希望各位直言指正。
华为交换机屏蔽特定IP地址,可以通过配置ACL(访问控制列表)来实现。ACL可以基于源IP地址、目的IP地址、协议类型等条件对流量进行过滤,从而实现对特定IP地址屏蔽[^1]。 ### 配置步骤 1. **创建ACL规则** 使用`acl`命令创建一个基本或高级ACL。例如,创建一个基本ACL来屏蔽特定的源IP地址: ```bash acl number 2000 rule 5 deny source 192.168.1.100 0.0.0.0 rule 10 permit source any ``` 上述配置中,`rule 5 deny source 192.168.1.100 0.0.0.0`表示拒绝源IP为`192.168.1.100`的数据包,`rule 10 permit source any`表示允许其他所有流量通过[^1]。 2. **将ACL应用到接** 在需要应用ACL的接上使用`packet-filter`命令绑定ACL规则。例如,在接`GigabitEthernet0/0/1`上应用ACL 2000: ```bash interface GigabitEthernet0/0/1 packet-filter 2000 inbound ``` 上述配置将ACL 2000应用到接的入方向,实现对特定IP地址屏蔽[^1]。 3. **保存配置** 完成配置后,使用`save`命令保存配置,确保设备重启后策略仍然生效: ```bash save ``` ### 高级ACL配置(可选) 如果需要更精细的控制,比如屏蔽特定协议或端口,可以使用高级ACL。例如,屏蔽来自`192.168.1.100`的TCP流量: ```bash acl number 3000 rule 5 deny tcp source 192.168.1.100 0.0.0.0 destination any rule 10 permit ip source any destination any ``` 然后同样将该ACL应用到目标接: ```bash interface GigabitEthernet0/0/1 packet-filter 3000 inbound ``` ### 注意事项 - **ACL匹配顺序**:ACL规则的匹配顺序是按照规则编号从小到大依次匹配,因此规则编号的设置需要合理,确保优先匹配需要拒绝的流量[^1]。 - **方向选择**:根据实际需求选择ACL应用的方向(`inbound`或`outbound`),确保流量控制符合预期。 - **测试与验证**:配置完成后,建议使用`ping`或`tracert`等工具验证ACL是否生效,并通过`display acl`和`display packet-filter`命令查看配置状态和匹配情况[^1]。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值