配置URPF功能示例(CE12800)
组网需求
如图15-6所示,Switch通过10GE1/0/1接口与ISP(Internet Service Provider)的路由器连接,10GE2/0/1接口下接用户网络。管理员希望Switch能够防范源地址欺骗攻击,避免非法用户利用合理的服务请求占用过多的服务资源,造成合法用户无法得到服务的响应而无法正常通信。
配置思路
配置Switch用户侧接口10GE2/0/1加入VLAN (Virtual Local Area Network),并在VLANIF接口下配置URPF功能,使设备可以防范用户侧的源地址欺骗攻击。
本例的组网中是路由对称的环境,这种情况下一般使用严格检查模式。
操作步骤
- 配置URPF检查模式
<HUAWEI> system-view [~HUAWEI] sysname Switch [*HUAWEI] commit [~Switch] ip urpf strict
- 配置接口加入VLAN,并配置VLANIF接口的IP地址。
[*Switch] vlan batch 10 [*Switch] interface 10ge 2/0/1 [*Switch-10GE2/0/1] port link-type access [*Switch-10GE2/0/1] port default vlan 10 [*Switch-10GE2/0/1] quit [*Switch] interface vlanif 10 [*Switch-Vlanif10] ip address 10.164.1.1 255.255.255.0 [*Switch-Vlanif10] quit
- 使能接口的URPF功能
[*Switch] interface vlanif 10 [*Switch-Vlanif10] ip urpf enable [*Switch-Vlanif10] commit [~Switch-Vlanif10] quit
- 验证配置结果
在系统视图下执行命令display this查看URPF配置。
[~Switch] display this # ip urpf strict # vlan batch 10 #