uRPF测试

简介:
1.测试拓扑

 
2.基本配置

R1:
interface FastEthernet0/0
 ip address 202.100.1.1 255.255.255.0
 no shut
!
interface FastEthernet0/1
 ip address 192.168.1.1 255.255.255.0
 no shut
!
ip route 0.0.0.0 0.0.0.0 202.100.1.3
ip route 192.168.0.0 255.255.0.0 192.168.1.2

R2:
interface Loopback0
 ip address 192.168.2.2 255.255.255.0
!
interface Loopback1
 ip address 2.2.2.2 255.255.255.0
!
interface FastEthernet0/0
 ip address 192.168.1.2 255.255.255.0
 no shut
!
ip route 0.0.0.0 0.0.0.0 192.168.1.1

R3:
interface Loopback0
 ip address 192.168.2.2 255.255.255.0
!
interface Loopback1
 ip address 3.3.3.3 255.255.255.0
!
interface FastEthernet0/0
 ip address 202.100.1.3 255.255.255.0
 no shut
!
ip route 0.0.0.0 0.0.0.0 202.100.1.1

3.uRPF的宽松模式
A.确认IP CEF打开
B.如下配置,因为R1有到192.168.0.0的路由,所以R3#ping 192.168.1.2 source 192.168.2.2,在R2上debug ip icmp能看到包。
interface FastEthernet0/0
 ip verify unicast source reachable-via any
但是,R3#ping 192.168.1.2 source 3.3.3.3,无法ping通,因为R1上没有去往3.3.3.3的路由
C.如果允许默认路由的话,,R3#ping 192.168.1.2 source 3.3.3.3,能够通
R1(config)#int f0/0
 R1(config-if)#ip verify unicast source reachable-via any allow-default 
D.如果希望自己能ping通自己,需要添加 allow-self-ping关键字

4.uRPF的严谨模式
A.如果采用严谨模式,因为192.168.0.0/16网段地址接口在f0/0,所以R3#ping 192.168.1.2 source 192.168.2.2,在R2上debug ip icmp抓不到包。
interface FastEthernet0/0
 ip verify unicast source reachable-via rx allow-default allow-self-ping
通过上面配置可以防止来做公网,且源地址为内网地址的数据包的攻击,
另一方面,R2#ping 3.3.3.3 source 2.2.2.2,数据包虽然能到达R3,但是返回来时被R1拒绝了,因为R1没有去往2.2.2.2的路由。

如果R1上面有到内网所有网段的路由,那么通过如下方式可以禁止内网伪造数据包出公网,从而避免充当肉鸡和堵塞互联网出口:
R1(config)#int f0/1

R1(config-if)#ip verify unicast source reachable-via rx  allow-self-ping 





本文转自 碧云天 51CTO博客,原文链接:http://blog.51cto.com/333234/1045776,如需转载请自行联系原作者

相关文章
|
2月前
|
人工智能 Java 测试技术
耐力测试
耐力测试
|
安全 数据挖掘 Java
如何进行有效的探索测试?
如何进行有效的探索测试?
|
测试技术 定位技术 开发者
从测试看需求
从测试看需求
85 0
从测试看需求
|
NoSQL 测试技术 Redis
|
监控 测试技术
测试-亚英1021
测试-亚英1021
78 0
|
程序员
这是个测试
这是个土味情话的标签,我用程序写的诗,写给我朋友的诗,写给未来的诗。
1007 0
|
测试技术 Python