免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: platinum

DHCP 的讨论(iptables 对其无效?) [复制链接]

论坛徽章:
0
发表于 2005-07-15 09:30 |显示全部楼层

DHCP 的讨论(iptables 对其无效?)

localhost DHCPDISCOVER ->; ff:ff:ff:ff:ff:ff
dhcp server ->; localhost DHCPOFFER
localhost DHCPREQUEST ->; ff:ff:ff:ff:ff:ff
dhcp server ->; localhost DHCPACK

这个是 DHCP 的运作过程
   Normally, DHCP servers and BOOTP relay agents attempt to deliver
   DHCPOFFER, DHCPACK and DHCPNAK messages directly to the client using
   uicast delivery.  The IP destination address (in the IP header) is
   set to the DHCP 'yiaddr' address and the link-layer destination
   address is set to the DHCP 'chaddr' address.  Unfortunately, some
   client implementations are unable to receive such unicast IP
   datagrams until the implementation has been configured with a valid
   IP address (leading to a deadlock in which the client's IP address
   cannot be delivered until the client has been configured with an IP
   address).

论坛徽章:
0
发表于 2005-07-15 13:24 |显示全部楼层

DHCP 的讨论(iptables 对其无效?)

169.254.0.0     *               255.255.0.0     U     0      0        0 eth0
这是DHCP用的网段把?

论坛徽章:
0
发表于 2005-07-15 13:27 |显示全部楼层

DHCP 的讨论(iptables 对其无效?)

原帖由 "wheel" 发表:
169.254.0.0     *               255.255.0.0     U     0      0        0 eth0
这是DHCP用的网段把?


这是Automatic Private IP Addressing (APIPA) 段

论坛徽章:
0
发表于 2005-07-15 14:55 |显示全部楼层

DHCP 的讨论(iptables 对其无效?)

原帖由 "waker" 发表:

iptables -A bootp_packets -p UDP -s 0/0 --source-port 68 -j DROP


如果我没记错0/32就可以了。

论坛徽章:
0
发表于 2005-07-15 15:03 |显示全部楼层

DHCP 的讨论(iptables 对其无效?)

原帖由 "cnadl" 发表:


[quote]原帖由 "waker" 发表:


iptables -A bootp_packets -p UDP -s 0/0 --source-port 68 -j DROP  


如果我没记错0/32就可以了。[/quote]
这是什么东西啊?

论坛徽章:
0
发表于 2005-07-15 15:09 |显示全部楼层

DHCP 的讨论(iptables 对其无效?)

原帖由 "platinum" 发表:

这是什么东西啊?


0.0.0.0/255.255.255.255

dhcp有用到这个ip,我忘记是client的源地址还是目的地址了。

论坛徽章:
0
发表于 2005-07-15 15:16 |显示全部楼层

DHCP 的讨论(iptables 对其无效?)

试验一:
INPUT、OUTPUT 都 DROP 了,不比 0.0.0.0/255.255.255.255 的方法好嘛?

试验二:
PREROUTING 都 DROP 了,不必 0.0.0.0/255.255.255.255 的方法好嘛?

我的匹配方式比上面的要宽松,都没有匹配到,难道比我更严格的匹配方式就可以匹配上?不可能。。。。

论坛徽章:
0
发表于 2005-07-22 11:25 |显示全部楼层

DHCP 的讨论(iptables 对其无效?)

-sU    UDP scans: This method is used  to  determine  which  UDP  (User
              Datagram Protocol, RFC 76 ports are open on a host.  The tech-
              nique is to send 0 byte UDP packets to each port on  the  target
              machine.   If  we receive an ICMP port unreachable message, then
              the port is closed.  If a UDP response is received to the  probe
              (unusual),  the port is open.  If we get no response at all, the
              state is "open|filtered", meaning that the port is  either  open
              or packet filters are blocking the communication.  Versions scan
              (-sV) can be used to help differentiate  the  truly  open  ports
              from the filtered ones.
关于UDP端口的扫描,这个是nmap的一段man,可以看看,UDP也是可以扫描的,只是通过icmp的辅助来识别,而且我的映象中比较慢来着。


另外,开启ntop服务,可以很容易的找到网内机子所提供的服务,找到dhcp服务器不是问题。


而且这么多的帖子看下来,我没明白是NAT提供dhcp还是另外一台机子提供dhcp。也就是一直没明白这个试验的拓扑是怎样的。

论坛徽章:
0
发表于 2005-07-22 12:08 |显示全部楼层

DHCP 的讨论(iptables 对其无效?)

能不能做个试验,看看除dhcp以外,其它的协议在防火墙drop的情况下能不能被dump出来,例如ping
主要想测试一下tcpdump的工作方式是直接从网卡接收数据包还是经过iptables过滤后在从kernel接收数据包
如果是通过驱动直接从网卡接收数据包,iptables当然不起作用啦

论坛徽章:
0
发表于 2005-07-22 12:19 |显示全部楼层

DHCP 的讨论(iptables 对其无效?)

tcpdump 是直接从网卡设备上读取数据的,即使禁止了 ping,client 无法 ping 通,但依然可以抓到包

“如果是通过驱动直接从网卡接收数据包,iptables当然不起作用啦”但这又能证明什么呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP