1 / 17

Linux IP 防火墙及其原理

Linux IP 防火墙及其原理. IP 防火墙简介. 需求 Internet & Intranet 安全 Internet 应用的扩展 防火墙的作用 限制进入控制点 防止进攻者接近内部 限制内部用户 防火墙的弱点 内部问题. Linux IP Firewall 原理. 本机. De-masq. 转发. 入. 出. masq. 注解 :Masq 是只对传送这个动作和用户自定义的 Chain 有效的处理. input. output. Input , output , forward. forward. Input. output.

lars
Download Presentation

Linux IP 防火墙及其原理

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Linux IP 防火墙及其原理

  2. IP 防火墙简介 • 需求 • Internet & Intranet安全 • Internet 应用的扩展 • 防火墙的作用 • 限制进入控制点 • 防止进攻者接近内部 • 限制内部用户 • 防火墙的弱点 • 内部问题

  3. Linux IP Firewall 原理 本机 De-masq 转发 入 出 masq 注解:Masq是只对传送这个动作和用户自定义的Chain有效的处理 input output

  4. Input , output , forward forward Input output Input output forward 注解:LINUX系统中比较出名的防火墙模式是IPChains,它属于一种数据包过滤防火墙。使用IPChains基本上能够达到较好的保护网络系统免受外界网络的干扰。在系统缺省情况下会有三个内建的Chains:input、output、forward分别处理出入及传送的规则。

  5. IP Masquerade [ NAT ] 注解:NAT(Network Address Translation)即网络地址翻译又名网络地址转换,将内部的原地址192.168.111.5(该地址称为保留地址,不可在互联网上路由的IP地址)转换为目的地址200.200.200.200,以便达到保护内部网络信息的目的。

  6. IP Masquerade (NAT] 原理 伪装 202.112.1.109:60001 192.168.0.2:6012 202.112.1.109:60001 192.168.0.2:6012 外部地址 202.112.199 内部用户 192.168.0.2 192.168.0.1 防火墙 202.112.1.109 注解:防火墙(FireWall)的内口IP地址:192.168.0.1;外口IP地址:202.112.1.109,内部用户准备利用IP地址为:192.168.0.2的主机并且采用6012端口,通过防火墙的NAT功能去访问IP地址为:202.112.1.99的服务器,防火墙最终将用户IP地址转换成202.112.1.109并且将端口转换成6001。

  7. IP Accounting • 2.0.x • 专门的计费链 • 2.2.x • 每条规则一个 • 文件 • /proc/net/ipv4/... • Libipfwc (ipchains) 注解:不同版本的LINUX其实现的机制和IPChains的运行规则是不同,所以请各位在具体应用中要特别注意加以区别。比如在Linux2.4内核中就主要采用IPtables,IPtables新增很多功能,如:内置规则的重新定义,简单化规则管理;采用状态机制(STATEFUL),对规则允许的包在回复时就直接通过不同进行规则匹配;采用IPtables非常轻松实现NAT和重定向功能。

  8. 防火墙规则配置的基本准则 • .一切未被允许的就是禁止的。 • 防火墙应该封锁所有的信息流,然后对希望提供的服务逐项开放。 • 优点 : 实用,安全. • 缺点: 可靠性高于易用性. • .一切未被禁止的就是允许的。 • 防火墙应该转发所有的信息流,然后逐项屏蔽有害的服务。 • 优点:灵活, • 缺点安全可靠性不高

  9. Linux IP 防火墙的规则匹配 • 按规则链来进行匹配 • 使用src,dst,port,ip-opt , 来匹配 • 使用 -j target 来动作 • 从头到尾的匹配方式 • 匹配成功马上停止 • 立刻使用该规则的target [ -j ] • Accept, Deny, reject ,etc.

  10. 规则[build-in Chains] input ,output,forward 目标(targets] Accept Reject Deny MASQ REDIRECT RETURN 操作规则 Add ,Delete , Append. -X, Delete All IP Chains 简介 [1] ipchains 1.3.9

  11. Ipchains 简介 [2] • 规则匹配 • 协议, -p [!] protocol, -p tcp , icmp,udp, all, • 地址 • 源地址 & 端口 -s[!] address [[!] port] • 目的地址&端口 -d[!] address [[!] port] • SYN 位. [!] -y ,第一个tcp请求包 • 网络接口-i [!] name , -i eth0 • 双向, -b

  12. ipchains --- 例子 • 例子 • input 确省拒绝 • ipchains -P input ACCEPT • 不允许192.168.1.1进入防火墙 • ipchains -A input -j DENY -s 192.168.1.1 • 从10.11.11.x来的包要作 NAT • ipchains -A forward -j MASQ -s 10.11.11.0/24

  13. Ipchains 例子 [2] • 允许内部用户访问外部,不允许外部访问内部 • ipchains -A output -y -s 192.168.1.1-i eth0 -j ACCEPT • ipchains -A input -y -j DENY -i eth0 • 不允许内部用户访问12.34.56.78 • ipchains -A input -d 12.34.56.78 -i eth1 -j DENY • 更复杂的例子 • http://gem.ncic.ac.cn/~xhg/ipchains-HOWTOs

  14. 利用Linux IP 防火墙抵挡攻击 • Ping of Death • 发不合法的巨大的icmp包利用TCP stack的漏洞. • 方法, 阻止icmp fragments • Teardrop and Bonk • overlapping fragments • 方法, kernel defragements. • Fragment Bombs • 方法同上. • IP Spoof Protection

  15. 内部地址 不允许外部访问 非军事区Dmz 内/外部可以访问 有外部 IP, 转发 防火墙 firewall 外部地址 内部可以访问 恶意用户 传统的防火墙配置 DMZ 内部用户

  16. 一种新型的防火墙 Http://friewall.ip/ 路径选择表 80-> 10.11.11.3:80 80->10.11.11.2:80 21->10.11.11.5.21 • 虚拟 DMZ • 外部可以访问 • 内部IP • 单一映象 • 外部可以访问 • 内部IP • 优点 • 屏蔽了DMZ的结构 • 内部IP • 可扩展性, Cluster的结构 接受请求 选定 10.11.11.2 10.11.11.2

  17. IP Firewall 内部用户控制 • 防火墙功能 • 计费功能 • ip 级 • user 级 • 管理功能 • 容易使用 • 身份认证 • VPN

More Related