返回列表 回复 发帖

《Linux网络编程》第二版运行第20章防火墙代码出错

我用的系统:CentOS_5.11 内核: 2.6.18-408.e15
我下发“./sipfw -A INPUT -s 127.0.0.1 -p icmp -j DROP”命令后,为什么在目的ip地址会出现一个随机ip地址?“DROP    127.0.0.1       0       137.254.144.211 0       1”
有没大神懂的,告诉小弟一声,万分感谢!!

root@bogon 20]# cd module
[root@bogon module]# insmod sipfw_module.ko
[root@bogon module]# cd ..
[root@bogon 20]# cd app
[root@bogon app]# ./sipfw -A INPUT -s 127.0.0.1 -p icmp -j DROP
==>SIPFW_ParseCommand
==>SIPFW_ParseOpt
<==SIPFW_ParseOpt
==>SIPFW_ParseOpt
<==SIPFW_ParseOpt
==>SIPFW_ParseOpt
<==SIPFW_ParseOpt
==>SIPFW_ParseOpt
<==SIPFW_ParseOpt
<==SIPFW_ParseCommand
==>SIPFW_DisplayOpts
SIPFW_CMD_LIST is 2
command:APPEND
source IP:127.0.0.1
Dest IP:0.0.0.0
sport : 0
dport: 0
proto: 1
ifname:
<==SIPFW_DisplayOpts
==>SIPFW_NLCreate
<==SIPFW_NLCreate
==>SIPFW_NLSend
<==SIPFW_NLSend
==>SIPFW_NLRecv
<==SIPFW_NLRecv
information:SUCCESS
==>SIPFW_NLClose
<==SIPFW_NLClose
[root@bogon app]# ./sipfw -L
==>SIPFW_ParseCommand
<==SIPFW_ParseCommand
==>SIPFW_DisplayOpts
SIPFW_CMD_LIST is 3
command:LIST
source IP:0.0.0.0
Dest IP:0.0.0.0
sport : 0
dport: 0
proto: 4294967295
ifname:
<==SIPFW_DisplayOpts
==>SIPFW_NLCreate
<==SIPFW_NLCreate
==>SIPFW_NLSend
<==SIPFW_NLSend
==>SIPFW_NLRecv
<==SIPFW_NLRecv
==>SIPFW_NLRecvRuleList
==>SIPFW_NLRecv
<==SIPFW_NLRecv
CHAIN INPUT Rules
ACTION  SOURCE  SPORT   DEST            DPORT   PROTO
DROP    127.0.0.1       0       137.254.144.211 0       1
<==SIPFW_NLRecvRuleList
==>SIPFW_NLClose
<==SIPFW_NLClose
[root@bogon app]#
哥们,有《Linux网络编程》书籍的例程代码吗?我的邮箱 350817634@qq.com ,谢谢
返回列表