LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1940|回复: 20

freebsd5.2做防火墙速度很慢

[复制链接]
发表于 2003-12-9 12:08:11 | 显示全部楼层 |阅读模式
我的对外网卡为ed0,对内网卡为ed1
我重编了内核,加入
options IPFIREWALL
options IPDIVERT
去掉
#cpu            I486_CPU
#cpu            I586_CPU
在/etc/rc.conf文件中设置
gateway_enable="YES"
firewall_enable="YES"
firewall_type="/etc/firewall.conf"
natd_enable="YES"
natd_interface="ed0"
编写文件/etc/firewall.conf为
add divert natd from any to any via ed0
add allow all from any to any
结果可以使内网的机器上网,但速度很慢,做路由的机器一直显示:
192.168.0.33 is on ed1 ,but got reply from ed0
202.117.83.230 is on ed0 ,but got reply from ed1
之类的信息。
昨天只有内网的一台机器上网时。速度很快,今天多台机器上网时,速度就很慢了。不知道是什么原因,望高手指教!
发表于 2003-12-9 12:11:16 | 显示全部楼层
是否跟MAXUSERS有关?
 楼主| 发表于 2003-12-9 13:20:09 | 显示全部楼层
freebsd 5.2的内核设置文件GENERIC和参考文件NOTES没有MAXUSERS选项
发表于 2003-12-9 16:28:16 | 显示全部楼层
I saw some similars messages from the net, someone suggest to disable it with:
sysctl net.link.ether.inet.log_arp_wrong_iface=0

and they said:
FreeBSD handles two or more NICS on one subnet.
You just can't configure them with same netmask or have them behave identically.  Only one can be default gateway

Perharps that's the key of your question, could you please show us: netstat -rn, it might be a routing trouble..

otherwise there is a soft through ports/net/trafshow, just install it, and try to use trafshow to view "on live" all the network traffic, hope this can help.
 楼主| 发表于 2003-12-9 17:52:38 | 显示全部楼层
the command "netstat -rn" shows:

Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            202.117.86.129     UGSc        3   158127    ed0
127.0.0.1          127.0.0.1          UH          0        0    lo0
192.168.0          link#2             UC          6        0    ed1
192.168.0.54       00:e0:4c:f4:e2:f1  UHLW        0        4    ed1   1189
192.168.0.106      52:54:ab:3a:a1:de  UHLW        0        0    ed1   1187
192.168.0.108      00:e0:4c:f3:fd:36  UHLW        0        0    ed1   1152
192.168.0.188      00:e0:4c:e1:b4:69  UHLW        0        0    ed1   1164
192.168.0.200      00:10:5c:da:bc:91  UHLW        0        0    ed1   1173
192.168.0.255      ff:ff:ff:ff:ff:ff  UHLWb       0      134    ed1
202.117.86         link#1             UC          3        0    ed0
202.117.86.129     00:06:52:dc:b4:09  UHLW        2        0    ed0   1046
202.117.86.154     00:c0:4f:72:b8:4e  UHLW        0        4    ed0   1120
202.117.86.198     52:54:ab:13:5d:49  UHLW        0       14    ed0   1114

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::/96                             ::1                           UGRSc       lo0
::1                               ::1                           UH          lo0
::ffff:0.0.0.0/96                 ::1                           UGRSc       lo0
fe80::/10                         ::1                           UGRSc       lo0
fe80::%ed0/64                     link#1                        UC          ed0
fe80::5054:abff:fe37:9788%ed0     52:54:ab:37:97:88             UHL         lo0
fe80::%ed1/64                     link#2                        UC          ed1
fe80::5054:abff:fe2e:af32%ed1     52:54:ab:2e:af:32             UHL         lo0
fe80::%lo0/64                     fe80::1%lo0                   Uc          lo0
fe80::1%lo0                       link#4                        UHL         lo0
ff01::/32                         ::1                           U           lo0
ff02::/16                         ::1                           UGRS        lo0
ff02::%ed0/32                     link#1                        UC          ed0
ff02::%ed1/32                     link#2                        UC          ed1
ff02::%lo0/32                     ::1                           UC          lo0
 楼主| 发表于 2003-12-9 17:54:02 | 显示全部楼层
1
发表于 2003-12-9 18:34:50 | 显示全部楼层
strange, it seems be a good config. what's your netmask for "202.117.83.x" ? please tell us more with your config, and use Quote to show your reply to prevent smily ...
 楼主| 发表于 2003-12-9 21:08:53 | 显示全部楼层
最初由 werix 发表
strange, it seems be a good config. what's your netmask for "202.117.83.x" ? please tell us more with your config, and use Quote to show your reply to prevent smily ...


don't know your meaning. 202.117.83.x is an ip coming  from outside .
发表于 2003-12-9 21:23:29 | 显示全部楼层
right, you message:
202.117.83.230 is on ed0 ,but got reply from ed1
but the output of netstat was:
default 202.117.86.129 UGSc 3 158127 ed0

So I asked you what's the netmask for this subnet. (It should be correct, otherwise it'll not running...)

Could you please check here ? http://www.linuxsir.cn/forum.php?mod=viewthread&tid=78201

 楼主| 发表于 2003-12-10 02:04:59 | 显示全部楼层
I have fixed the problem!
my file /etc/firewall.conf was actually:

add divert natd from 192.168.0.0/24  to any via ed0
add divert natd from any to 192.168.0.0/24  via ed0
add allow all from any to any

the first and second lines have  something  wrong!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表