A、B在内网,C在,A信任B, C想访问A上的数据.... 于是它修改了自己的源IP地址,告诉A自己是B... 并加入源路由信息,记下了来时的路径,这样A按数据来的路返回给了C.... 如果 no 了 ip source-route ,A发出的包会自己去寻找B,这样,C还是得不到想要的。 源路由是被默认开启的
2、no ip redirects的功能
路由器A和路由器B在同一个网段中。现在有PC的网关设置为A的地址 192.18.3.1.
在发送数据过程中可能会出现发往 192.168.2.X 网段的数据。这样数据包会先到A的接口再流向B。
ip redirects 可以使用ICMP 包。告知PC 以后发往192.168.2.X 的数据直接发给B。而不需要通过自己。
no ip redirects 是关闭这项功能。特别是在HSRP中。主要是为了避免让客户端使用真实的MAC地址通讯。
3、no ip directed-broadcast
广播分两种:255.255.255.255,称为全广播,由于会被路由器禁止传输,所以也叫本地网络广播。另一种是所有的主机为都为1的广播,例如:192.168.1.255/24,这种广播路由器默认是可以转发的。ip directed-broadcast 或者是no ip directed-broadcast ,就是允许或者禁止这种广播的转发。
默认情况下,router不转发目的地址255.255.255.255的广播,但是转发子网内广播,比如192.168.1.255。
为什么要关闭这个功能,举例说明:routerA连接一个,内网中有500台主机(ip为172.16.0.0/24),如果有一个Hack发出一个Ping包,目的IP为172.16.255.255,而源IP地址是另外一个主机的IP地址,如果router将这个数据包转发进内网,会发生什么?——内网的500台主机都会向那个可怜的主机返回的Ping的响应。
4、Proxy ARP
How Does Proxy ARP Work? Proxy ARP 是如何工作的?
Below is an example of how proxy ARP works: 下面这个例子说明了Proxy ARP 是如何工作的
Network Diagram
图表
The Host A (172.16.10.100) on Subnet A needs to send packets to Host D (172.16.20.200) on Subnet B. As shown in the diagram above, Host A has a /16 subnet mask. What this means is that Host A believes that it is directly connected to all of network 172.16.0.0. When Host A needs to communicate with any devices it believes are directly connected, it will send an ARP request to the destination. Therefore, when
Host A needs to send a packet to Host D, Host A believes that Host D is directly connected, so it sends an ARP request to Host D.
这个主机A要发送数据包到主机D。图表显示主机A使用的是16位掩码。主机A相信目的网段是直接连接在172.16.0.0上的。于是主机A直接发送一个ARP请求给目的站点。
To reach Host D (172.16.20.200), Host A needs the MAC address of Host D. Therefore, Host A broadcasts an ARP request on Subnet A, as below: 主机A 需要得到主机D的MAC地址,所以主机A广播ARP请求:
Sender's MAC Address Sender's IP Address Target MAC Address Target IP Address 00-00-0c-94-36-aa 172.16.10.100 00-00-00-00-00-00 172.16.20.200
In above ARP request, Host A (172.16.10.100) is requesting that Host D (172.16.20.200) send its MAC address. The above ARP request packet is then encapsulated in an Ethernet frame with Host A's MAC address as the source address and a broadcast (FFFF.FFFF.FFFF) as the destination address. Since the ARP request is a broadcast, it reaches all the nodes in the Subnet A, including the router's e0 interface, but does not reach Host D. The broadcast will not reach Host D because routers, by default, do not forward broadcasts.
ARP请求里主机A将自己的MAC地址作为源地址 FFFF.FFFF.FFFF 做为目的地址进行广播。但是路由器的E0 口默认不支持转发广播。所以主机D不能响应这个ARP请求。
Since the router knows that the target address (172.16.20.200) is on another subnet and can reach Host D, it will reply with its own MAC address to Host A. 路由器知道主机D在其他子网,于是用自己的MAC地址来应答A
Sender's MAC Address Sender's IP Address Target MAC Address Target IP Address 00-00-0c-94-36-ab 172.16.20.200 00-00-0c-94-36-aa 172.16.10.100
Above is the Proxy ARP reply that the router sends to Host A. The proxy ARP reply packet is encapsulated in an Ethernet frame with router's MAC address as the source address and Host A's MAC address as the destination address. The ARP replies are always unicast to the original requester.
路由器用自己接口的MAC地址作为源地址回复ARP应答给主机A。这个ARP应答总是利用单播来回复。
On receiving this ARP reply, Host A updates its ARP table as below: 主机A收到ARP请求后更新自己的MAC地址表
IP Address 172.16.20.200
From now on Host A will forward all the packets that it wants to reach 172.16.20.200 (Host D) to the MAC address 00-00-0c-94-36-ab (router). Since the router knows how to reach Host D, the router forwards the packet to Host D. The ARP cache on the hosts in Subnet A is populated with the MAC address of the router for all the hosts on Subnet B. Hence, all packets destined to Subnet B are sent to the router. The router forwards those packets to the hosts in Subnet B.
现在主机A如果发送数据包给主机D就将数据发送给MAC 00-00-0c-94-36-ab.由路由器转发给主机D。所以目的地址为子网B的数据都发送给路由器。子网A内所有主机ARP地址表显示去往子网B主机的MAC地址全是路由器接口的MAC地址。这个路由器转发其他数据包到子网B。
The ARP cache of Host A is given below: 这个主机A的ARP 地址表
MAC Address 00-00-0c-94-36-ab IP Address 172.16.20.200 172.16.20.100 172.16.10.99 172.16.10.200 MAC Address 00-00-0c-94-36-ab 00-00-0c-94-36-ab 00-00-0c-94-36-ab 00-00-0c-94-36-bb Note: Multiple IP addresses are mapped to a single MAC address (the router's MAC address), indicating that proxy ARP is in use.
多个IP地址被映射到一个MAC地址。标志这在路由器上使用了 proxy-arp。
The Cisco router's interface should be configured to accept and respond to proxy ARP. This is enabled by default. Proxy ARP can be disabled on a per interface basis with the interface configuration command no ip proxy-arp, as shown below: cisco 交换机应该配置为能够支持proxy arp。而且它默认是被开启的。如果需要关闭可以使用 no ip proxy-arp 在接口模式下关闭。 Router# configure terminal
Enter configuration commands, one per line. End with CNTL/Z. Router(config)# interface ethernet 0 Router(config-if)# no ip proxy-arp Router(config-if)# ^Z Router#
To enable proxy ARP on an interface, use the ip proxy-arp interface configuration command.
在接口上使用 ip proxy-arp 命令启用 proxy-arp
proxy ARP有哪些优点?
最主要的一个优点就是能够在不影响其他router的路由表的情况下在网络上添加一个
新的router,这样使得子网的变化对主机是透明的. proxy ARP应该使用在主机没有配置默认网关或没有任何路由策略的网络上
proxy ARP带来的哪些负面影响? 1.增加了某一网段上ARP流量
2.主机需要更大的ARP table来处理IP地址到MAC地址的映射 3.安全问题,比如ARP欺骗(spoofing) 4.不会为不使用ARP来解析地址的网络工作 5.不能够概括和推广网络拓扑
5、ip filter-options all
Enables filtering of packets with IP options on an interface. IP options filtering is disabled by default. The no version disables filtering of packets with IP options. 当一个报文进入端口时,系统将自动判断该报文是否含ip 非法可选项,如果含有,则该报文将被过滤掉。系统默认情况下该功能是关闭的。
6、no ip unreachables
默认情况下,如果做ACL后被ACL deny的ICMP包会返回一个unreachable结果,如果你不想让用户看到unreachable的结果,可以在接口上用no ip unreach命令,这样用户就只会看到ping timeout。
7、ip ignore-df-bit
当一个packets报文进入端口时,ip报文包头如果存在标示为不能被拆包的字节时,系统
仍然会继续进行拆包操作。默认情况下该功能是关闭的。
8、ip sa-validate
urpf 是单播反向路径查找unicast reverse path forwarding 的简称。其主要功能是防止基于源地址欺骗的网络攻击行为。之所以称为逆向,是针对正常的路由查找而言的。一般情况下路由器接收到报文,获取报文的目的地址,针对目的地址查找路由。如果找到了进行正常的转发,否则丢弃该报文。
urpf通过获取报文的源地址和入接口,以源地址为目的地址,在转发表中查找源地址对应的接口是否与入接口匹配。如果不匹配认为源地址是伪装的,丢弃该报文。通过这种方式urpf就能有效地防范网络中通过修改源地址而进行的恶意攻击行为的发生。图22.1-1为一种简单的网络模型。
图22.1-1 源地址伪造1
在s1 上伪造源地址为2.2.2.1 的报文向服务器s2 发起请求,s2 响应请求时将向真正的“2.2.2.1”即s3 发送报文。这种非法报文对s2 和s3 都造成了攻击。
攻击者使用随机改变源地址的方法发起攻击。在本例子中,源地址使用一些保留的非全局的ip 地址,因此不可达。其实即使是一个合法的ip 地址,只要是不可达的也可以用来发起攻击。
另一种情况如图22.1-2所示:攻击者可以伪造一个源地址,该地址是另一个合法网络的地址并且在全局路由表中存在。例如,攻击者伪造一个源地址使得被攻击者认为攻击来自于伪造的源地址,但实际上该源地址是完全无辜的,并且有时候网络管理员会因此而关闭所有来自源地址的数据流,这样正好使得攻击者的拒绝服务攻击成功实现。
图22.1-2 源地址伪造2
更复杂的情形是tcp syn 洪泛攻击将使得syn-ack数据包发送到完全与攻击无关的许多主机,而这些主机就成了牺牲者。这使得攻击者可以同时去欺骗一个或者多个系统。 同样也可以采用udp 和icmp 洪泛攻击。
所有这些攻击都会严重的降低系统性能,甚至使得系统崩溃。urpf 就是为了防范这种攻击而使用的一种技术。
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- xiaozhentang.com 版权所有 湘ICP备2023022495号-4
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务