使用 URPF 来阻止IP地址欺骗( IP Address Spoofing)

简介:

【实验说明】
上一个实验是《使用ACL 来预防IP地址欺骗》,但是配置起来相对复杂,本实验我们将使用URPF(Unicast Reverse Path Forwarding)来轻松实现预防部分IP地址欺骗,URPF的知识请查看《Unicast RPF,单播逆向转发》 文章


 
【实验拓扑】

I OS:c2691-advsecurityk9-mz.124-11.T2.bin

 

【实验配置步骤】

  • 配置上图网络为 IP service 中的“Common Configuration”
  • 本实验将启用uRPF检查,但配置特定网络免受检查
  • 所有的尝试欺骗都记录日志
  • 在R5上创建Loopback1接口,IP地址为150.1.55.55/24,创建loopback2接口,IP地址为150.1.155.155/24
  • 不通告上面两个loopback地址到路由协议
  • 禁止R4上的BGP,以阻止其接收默认路由
  • 在R4上创建 access-list 100 允许150.1.55.0/24网络. 拒绝其他并记录日志
  • 在R4上外网口(串口)配置uRPF ,使access-list 100 作为uRPF ACL

 
【实验配置】
R5:
interface Loopback1
ip address 150.1.55.55 255.255.255.0
interface Loopback2
ip address 150.1.155.155 255.255.255.0
R4:
no router bgp 1
access-list 100 permit ip 150.1.55.0 0.0.0.255  any
access-list 100 deny ip any any log
!
int s0/1
ip verify unicast reverse-path 100
!
int s0/0.1
ip verify unicast reverse-path 100

 
Common Configuration 配置

R1:
interface FastEthernet0/0
ip address 10.0.0.1 255.255.255.0
ip route 0.0.0.0 0.0.0.0 10.0.0.4

 
R6:
interface FastEthernet0/0
ip address 10.0.0.6 255.255.255.0
ip route 0.0.0.0 0.0.0.0 10.0.0.4

R4:
interface Loopback0
ip address 150.1.4.4 255.255.255.0
ip ospf network point-to-point
!
interface FastEthernet0/0
ip address 10.0.0.4 255.255.255.0
!
interface Serial0/0
en fram
no sh
!
interface Serial0/0.1 point-to-point
ip address 155.1.0.4 255.255.255.0
frame-relay interface-dlci 405
!
interface Serial0/1
ip address 155.1.45.4 255.255.255.0
clock rate 2000000
!
router ospf 1
router-id 150.1.4.4
network 150.1.4.4 0.0.0.0 area 0
network 155.1.0.4 0.0.0.0 area 0
network 155.1.45.4 0.0.0.0 area 0
!
router bgp 1
bgp router-id 150.1.4.4
neighbor 150.1.5.5 remote-as 2
neighbor 150.1.5.5 ebgp-multihop 255
neighbor 150.1.5.5 update-source Loopback0

R5:
interface Loopback0
ip address 150.1.5.5 255.255.255.0
ip ospf network point-to-point
!
interface Serial0/0
encapsulation frame-relay
!
interface Serial0/0.1 point-to-point
ip address 155.1.0.5 255.255.255.0
frame-relay interface-dlci 504
!
interface Serial0/1
ip address 155.1.45.5 255.255.255.0
clock rate 2000000
!
router ospf 1
router-id 150.1.5.5
network 150.1.5.5 0.0.0.0 area 0
network 155.1.0.5 0.0.0.0 area 0
network 155.1.45.5 0.0.0.0 area 0
!
router bgp 2
bgp router-id 150.1.5.5
neighbor 150.1.4.4 remote-as 1
neighbor 150.1.4.4 ebgp-multihop 255
neighbor 150.1.4.4 update-source Loopback0
neighbor 150.1.4.4 default-originate

【实验验证】
R5#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

 
Gateway of last resort is not set

 
155.1.0.0/24 is subnetted, 2 subnets
C 155.1.0.0 is directly connected, Serial0/0.1
C 155.1.45.0 is directly connected, Serial0/1
150.1.0.0/24 is subnetted, 4 subnets
C 150.1.155.0 is directly connected, Loopback2
C 150.1.5.0 is directly connected, Loopback0
O 150.1.4.0 [110/65] via 155.1.45.4, 00:18:39, Serial0/1
[110/65] via 155.1.0.4, 00:18:39, Serial0/0.1
C 150.1.55.0 is directly connected, Loopback1

 
R5#ping 150.1.4.4

 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.1.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/22/52 ms
R5#ping 150.1.4.4 source loopback1

 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.1.4.4, timeout is 2 seconds:
Packet sent with a source address of 150.1.55.55
.....
R4#show ip access-list
*Mar 1 00:17:57.727: %SYS-5-CONFIG_I: Configured from console by console
R4#show ip access
R4#show ip access-lists
Extended IP access list 100
10 permit ip 150.1.55.0 0.0.0.255 any (5 matches)
20 deny ip any any log

 
R4#show ip int s0/0.1
Serial0/0.1 is up, line protocol is up
Internet address is 155.1.0.4/24
Broadcast address is 255.255.255.255
Address determined by non-volatile memory
MTU is 1500 bytes
Helper address is not set
Directed broadcast forwarding is disabled
Multicast reserved groups joined: 224.0.0.5
Outgoing access list is not set
Inbound access list is not set
Proxy ARP is enabled
Local Proxy ARP is disabled
Security level is default
Split horizon is enabled
ICMP redirects are always sent
ICMP unreachables are always sent
ICMP mask replies are never sent
IP fast switching is enabled
IP fast switching on the same interface is enabled
IP Flow switching is disabled
IP CEF switching is enabled
IP CEF Feature Fast switching turbo vector
IP multicast fast switching is enabled
IP multicast distributed fast switching is disabled
IP route-cache flags are Fast, CEF
Router Discovery is disabled
IP output packet accounting is disabled
IP access violation accounting is disabled
TCP/IP header compression is disabled
RTP/IP header compression is disabled
Policy routing is disabled
Network address translation is disabled
BGP Policy Mapping is disabled
WCCP Redirect outbound is disabled
WCCP Redirect inbound is disabled
WCCP Redirect exclude is disabled
IP verify source reachable-via RX, allow default, ACL 100
0 verification drops
5 suppressed verification drops

 
R5#ping 150.1.4.4 source l2

 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 150.1.4.4, timeout is 2 seconds:
Packet sent with a source address of 150.1.155.155
.....
R4#show ip access 100
Extended IP access list 100
10 permit ip 150.1.55.0 0.0.0.255 any (5 matches)
20 deny ip any any log (5 matches)

 
R4#
*Mar 1 00:24:14.719: %SEC-6-IPACCESSLOGDP: list 100 denied icmp 150.1.155.155 -> 150.1.4.4 (0/0), 4 packets

 
R4#show ip int s0/0.1
Serial0/0.1 is up, line protocol is up
Internet address is 155.1.0.4/24
Broadcast address is 255.255.255.255
Address determined by non-volatile memory
MTU is 1500 bytes
Helper address is not set
Directed broadcast forwarding is disabled
Multicast reserved groups joined: 224.0.0.5
Outgoing access list is not set
Inbound access list is not set
Proxy ARP is enabled
Local Proxy ARP is disabled
Security level is default
Split horizon is enabled
ICMP redirects are always sent
ICMP unreachables are always sent
ICMP mask replies are never sent
IP fast switching is enabled
IP fast switching on the same interface is enabled
IP Flow switching is disabled
IP CEF switching is enabled
IP CEF Feature Fast switching turbo vector
IP multicast fast switching is enabled
IP multicast distributed fast switching is disabled
IP route-cache flags are Fast, CEF
Router Discovery is disabled
IP output packet accounting is disabled
IP access violation accounting is disabled
TCP/IP header compression is disabled
RTP/IP header compression is disabled
Policy routing is disabled
Network address translation is disabled
BGP Policy Mapping is disabled
WCCP Redirect outbound is disabled
WCCP Redirect inbound is disabled
WCCP Redirect exclude is disabled
IP verify source reachable-via RX, allow default, ACL 100
5 verification drops
5 suppressed verification drops

本文转自zcm8483 51CTO博客,原文链接:http://blog.51cto.com/haolun/991664

相关文章
|
机器学习/深度学习 人工智能 算法
阿里公开自研AI集群细节:64个GPU,百万分类训练速度提升4倍
从节点架构到网络架构,再到通信算法,阿里巴巴把自研的高性能AI集群技术细节写成了论文,并对外公布。
阿里公开自研AI集群细节:64个GPU,百万分类训练速度提升4倍
|
存储 移动开发 开发框架
使用UniApp实现视频数组自动下载与播放功能:一步步指导
使用UniApp实现视频数组自动下载与播放功能:一步步指导
461 0
|
JSON 搜索推荐 Go
ZincSearch搜索引擎中文文档及在Go语言中代码实现
ZincSearch官网及开发文档均为英文,对非英语用户不够友好。GoFly全栈开发社区将官方文档翻译成中文,并增加实战经验和代码,便于新手使用。本文档涵盖ZincSearch在Go语言中的实现,包括封装工具库、操作接口、统一组件调用及业务代码示例。官方文档https://zincsearch-docs.zinc.dev;中文文档https://doc.goflys.cn/docview?id=41。
436 0
|
11月前
|
运维 网络安全 数据安全/隐私保护
Nextcloud一键部署:快速搭建如企业钉钉或飞书的团队协作平台
Nextcloud Hub 是一款来自德国的完全开源的云上托管内容协作平台。团队内成员可以通过移动、桌面和 Web 界面访问、共享和编辑文档,聊天和参与视频通话以及管理邮件、日历和项目。目前,Nextcloud的产品定位是在保障数据安全下的完整协作平台,功能类似国内的企业钉钉或飞书。Nextcloud官网:[https://nextcloud.com/](https://nextcloud.com/) 。
Nextcloud一键部署:快速搭建如企业钉钉或飞书的团队协作平台
|
Windows
windows调整pagefile.sys,hiberfil.sys 大小
windows调整pagefile.sys,hiberfil.sys 大小
710 1
|
机器学习/深度学习 人工智能 自然语言处理
《AI大模型助力客户对话分析》解决方案个人体验评测
【10月更文挑战第11天】随着人工智能技术的发展,越来越多的企业开始利用AI来优化客户服务。最近我有幸体验了《AI大模型助力客户对话分析》这一解决方案,并尝试将其部署到我的业务环境中。本文将从方案的实践原理、实施方法、部署过程以及示例代码的实用性等方面进行详细评测。
179 1
|
Java API 数据库
详细介绍如何使用Spring Boot简化Java Web开发过程。
Spring Boot简化Java Web开发,以轻量级、易用及高度可定制著称。通过预设模板和默认配置,开发者可迅速搭建Spring应用。本文通过创建RESTful API示例介绍其快速开发流程:从环境准备、代码编写到项目运行及集成数据库等技术,展现Spring Boot如何使Java Web开发变得更高效、简洁。
264 1
|
存储 安全 API
GitHub代码删了也无用,任何人仍可永久访问?!微软:这不是Bug而是有意设计...
开源安全公司Truffle Security发现,GitHub上的数据删除可能只是表面现象,实际上被删的数据仍可被访问。这一发现震惊了开源社区。研究人员引入了“跨分叉对象引用”(CFOR)这一概念,描述了如何通过已删除或私有fork访问敏感数据。即便存储库被删除,提交的数据仍可通过fork存取,甚至私有存储库的数据也可能被公开访问。尽管GitHub回应称这是有意为之的设计,但对于许多用户来说,这打破了对数据隐私的基本期望。此发现不仅影响GitHub用户,还可能波及其他版本控制系统。
360 4
|
安全 JavaScript 前端开发
自动化测试的魔法:如何用Python编写你的第一个测试脚本
【8月更文挑战第31天】 在软件的世界里,质量是王道。而自动化测试,就像是维护这个王国的骑士,确保我们的软件产品坚不可摧。本文将引导你进入自动化测试的奇妙世界,教你如何使用Python这把强大的魔法杖,编写出能够守护你代码安全的第一道防护咒语。让我们一起开启这场魔法之旅吧!
|
安全 应用服务中间件 网络安全
遭遇DDOS攻击忍气吞声?立刻报警!首都网警重拳出击,犯罪分子无所遁形
公元2024年2月24日18时许,笔者的个人网站突然遭遇不明身份者的DDOS攻击,且攻击流量已超过阿里云DDos基础防护的黑洞阈值,服务器的所有公网访问已被屏蔽,由于之前早已通过Nginx屏蔽了所有国外IP,在咨询了阿里云客服之后,阿里网安的老同事帮助分析日志并进行了溯源,客服建议笔者选择立刻报警处理! 我国《刑法》二百八十六条规定,违反国家规定,对计算机信息系统功能进行删除、修改、增加、干扰,造成计算机信息系统不能正常运行,后果严重的,处五年以下三年以上有期徒刑或者拘役;后果特别严重的,处五年以上有期徒刑。
遭遇DDOS攻击忍气吞声?立刻报警!首都网警重拳出击,犯罪分子无所遁形