免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1383 | 回复: 1
打印 上一主题 下一主题

ipfilter防火墙的问题,我还缺什么 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-11-13 11:19 |只看该作者 |倒序浏览
网络环境:
小区宽带,IP 10.16.97.3/255.255.255.240 gateway 10.16.97.1 DNS 202.102.128.68
freebsd5.1 网卡 fxp0(内网:192.168.0.1/255.255.255.0) rl0(internet:10.16.97.3/255.255.255.240)
------------------------------------------------

ifconfig -a
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST>; mtu 1500
        inet6 fe80::2e0:4cff:fe22:2c1%rl0 prefixlen 64 scopeid 0x1
        inet 10.16.97.3 netmask 0xfffffff0 broadcast 10.16.97.15
        ether 00:e0:4c:22:02:c1
        media: Ethernet autoselect (100baseTX <full-duplex>
        status: active
fxp0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST>; mtu 1500
        inet6 fe80::290:27ff:feb2:5b0d%fxp0 prefixlen 64 scopeid 0x2
        inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
        ether 00:90:27:b2:5b:0d
        media: Ethernet autoselect (100baseTX <full-duplex>
        status: active
lp0: flags=8810<OINTOPOINT,SIMPLEX,MULTICAST>; mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST>; mtu 16384
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
        inet 127.0.0.1 netmask 0xff000000
rc.conf

# -- sysinstall generated deltas -- # Wed Nov 12 23:38:15 2003
# Created: Wed Nov 12 23:38:15 2003
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
defaultrouter="10.16.97.1"
gateway_enable="YES"
hostname="natserver"
ifconfig_rl0="inet 10.16.97.3  netmask 255.255.255.240"
ifconfig_fxp0="inet 192.168.0.1 netmask 255.255.255.0"
inetd_enable="YES"
kern_securelevel_enable="NO"
moused_enable="YES"
sendmail_enable="NO"
sshd_enable="YES"
usbd_enable="YES"
ipfilter_enable="YES"
ipnat_enable="YES"
ipf -F a
ipf -f /etc/ipf.rules
ipnat -C
ipnat -f /etc/ipnat.rules

hosts
127.0.0.1                localhost
10.16.97.3                natserver
10.16.97.3                natserver.

ipnat.rules
map rl0 192.168.0.0/24 ->; 10.16.97.3/28 portmap tcp/udp 10000:30000
map rl0 192.168.0.0/24 ->; 10.16.97.3/28

ipf.rules
block in log quick all with short
block in log quick all with ipopts
pass out on fxp0 all
pass in on fxp0 all
pass out quick on lo0 all
pass in quick on lo0 all
block in on rl0 all
block out on rl0 all
pass out log on rl0 proto tcp/udp from any to any keep state
pass out log on rl0 proto icmp all keep state

netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            10.16.97.1         UGSc        3      252    rl0
10.16.97/28        link#1             UC          1        0    rl0
10.16.97.1         00:e0:52:d5:5e:00  UHLW        4        0    rl0   1099
127.0.0.1          127.0.0.1          UH          0      375    lo0
192.168.0          link#2             UC          0        0   fxp0

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::1                               ::1                           UH          lo0
fe80::%rl0/64                     link#1                        UC          rl0
fe80::2e0:4cff:fe22:2c1%rl0       00:e0:4c:22:02:c1             UHL         lo0
fe80::%fxp0/64                    link#2                        UC         fxp0
fe80::290:27ff:feb2:5b0d%fxp0     00:90:27:b2:5b:0d             UHL         lo0
fe80::%lo0/64                     fe80::1%lo0                   Uc          lo0
fe80::1%lo0                       link#4                        UHL         lo0
ff01::/32                         ::1                           U           lo0
ff02::%rl0/32                     link#1                        UC          rl0
ff02::%fxp0/32                    link#2                        UC         fxp0
ff02::%lo0/32                     ::1                           UC          lo0
问题是内网用户无法访问internet。

论坛徽章:
0
2 [报告]
发表于 2003-11-13 11:31 |只看该作者

ipfilter防火墙的问题,我还缺什么

ipf.rules:
%%%%%%%%%%%%%%
block in quick all with short
block in quick all with ipopts
pass in quick on lo0 all
pass out quick on lo0 all

block in quick on dc0 all head 100
block out quick on dc0 all head 150

block in log quick on rl0 all head 200
block out quick on rl0 all head 250

############
pass in quick proto all from 192.168.0.0/24 to any flays S/SAFP keep state group 100
pass out quick proto any from any to any keep state group 250

block in quick all
block out quick all

%%%%%%%%%%%%%%%%%%%%%
ipnat.rules:
%%%%%%%%%%%%%%%%%%%%%%%
map dco 192.168.0.0/24 ->; 10.36.48.200/32 port map tcp/udp 10000:65000
map dc0 192.168.0.0/24 ->; 10.36.48.200/32

%%%%%%%%%%%%%%%%%%%%%%%%%
我的没有问题!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP