论坛风格切换切换到宽版
  • 536阅读
  • 8回复

[问题求助]问一个iptables的问题 [复制链接]

上一主题 下一主题
离线seani.
 
发帖
1850
C币
-61324
威望
314
贡献值
1
银元
0
铜钱
4059
人人网人气币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-05-01
出现如下错误
1.g.if (6.64 KB)     外汇
下载次数:6
2004-07-14 20:.10    美容

http://upload.bbs.csuboy.com/Mon_1004/126_7137_dc2e460da56a30a.gif[/img]投资

评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
离线trefoil.
发帖
1962
C币
-199277
威望
397
贡献值
1
银元
-1
铜钱
4497
人人网人气币
0
只看该作者 沙发  发表于: 2010-04-13
check your firewall script,
add --log-prefix "packet logged:" to iptables commands

and restart the service

离线labman.
发帖
2090
C币
-235599
威望
350
贡献值
1
银元
-3
铜钱
4524
人人网人气币
0
只看该作者 板凳  发表于: 2010-04-13


QUOTE:原帖由 "yunqing" 发表:
check your firewall script,
add --log-prefix "packet logged:" to iptables commands

and restart the service



问题是我的 --log-prefix后面有说明

给你看看我的部分防火墙代码
1.gif (14.21 KB)
下载次数:3
2004-07-14 21:25



离线chinablue.
发帖
2151
C币
-235260
威望
390
贡献值
1
银元
-3
铜钱
4734
人人网人气币
0
只看该作者 地板  发表于: 2010-04-13
be sure the value of $LOG_LEVEL is set before this segment of code.

离线frt0502.
发帖
2022
C币
-132196
威望
355
贡献值
1
银元
-2
铜钱
4484
人人网人气币
0
只看该作者 4楼 发表于: 2010-04-13
[quote]原帖由 "yunqing"]be sure the value of $LOG_LEVEL is set before this segment of code.[/quote 发表:



谢谢,确实是LOG_LEVEL没有赋值,刚才那个LOG的问题解决了,现在又出现如下问题拉
1.gif (6.39 KB)
下载次数:6
2004-07-14 22:06



离线ebengbu.
发帖
2059
C币
-60701
威望
375
贡献值
2
银元
-1
铜钱
4670
人人网人气币
0
只看该作者 5楼 发表于: 2010-04-13
two points:
1.check the interface 'eth0' really exists
sudo /sbin/ifconfig

2. the interface parameter should follow '-i' switch in iptables command, like this:

iptables -A INPUT -i eth0 ...

发帖
1936
C币
-61137
威望
330
贡献值
1
银元
0
铜钱
4251
人人网人气币
0
只看该作者 6楼 发表于: 2010-04-13


QUOTE:原帖由 "yunqing" 发表:
two points:
1.check the interface 'eth0' really exists
sudo /sbin/ifconfig

2. the interface parameter should follow '-i' switch in iptables command, like this:

iptables -A INPUT -i eth0 ...



ifconfig能找到eth0网络接口,所以第一个不是原因了。

第2个,我有些用的是-O参数,而不是-i,因为是出口,如下图所示,是不是这个原因呢?
1.gif (4.89 KB)
下载次数:6
2004-07-14 23:51



离线laa110.
发帖
2019
C币
-152388
威望
394
贡献值
1
银元
-2
铜钱
4669
人人网人气币
0
只看该作者 7楼 发表于: 2010-04-13
I imagine you're using linux box as a nat/firewall server. So for the first line, you need to specify the input inface where to receive icmp packet and then output inteface from which the packet leaves.

Try this:

iptables -A ALLOW_ICMP -i input_interface -o $EXTERNEL_INTERFACE ....

where input_interface is the internal ethernet card (I suppose).

发帖
2130
C币
-60329
威望
399
贡献值
1
银元
-1
铜钱
4691
人人网人气币
0
只看该作者 8楼 发表于: 2010-04-13
[quote]原帖由 "yunqing"]I imagine you're using linux box as a nat/firewall server. So for the first line, you need to specify the input inface where to receive icmp packet and then output inteface from which the packet leave..........[/quote 发表:



不是的,我这里没用nat功能,我只有一块网卡,所以说出口和进口都是external_interface了。

难道-i和-o参数不能接相同的网络接口吗?
快速回复
限100 字节
批量上传需要先选择文件,再选择上传
 
上一个 下一个