防火墙透明代理配置心得

2009-05-13 02:00:04来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折


防火墙透明代理配置心得
  
  
   
  
   
     
单位100M光纤接入互联网,文章中网卡为ed0[202.182.96.2],内网ed2的地址为200.200.1.0/24,其中200.200.1.33是一台web服务器。
要完成的任务是,使所有的互联网微机可以访问200.200.1.33,所有的内网主机可以访问互联网。
规则暂时不考虑,网上相关的文章也很多。
  程序代码:DL# cat ipnat.rules
map ed0 200.200.1.0/24 -> 202.182.96.2/32 portmap tcp/udp 1000:6000
map ed0 200.200.1.0/24 -> 202.182.96.2/32 proxy port ftp ftp/tcp
map ed0 200.200.1.0/24 -> 202.182.96.2/32
rdr ed0 0.0.0.0/0 port 80 -> 200.200.1.33 port 80 tcp
DL# cat ipf.rules
pass in quick on lo0 all
pass out quick  on lo0 all
pass in from any to any
pass out from any to any
ls
DL# cat rc.conf
defaultrouter="218.22.205.1"
hostname="DL.net"
network_interfaces="ed0 ed2 lo0"
ifconfig_ed0="inet 202.182.96.2  netmask 255.255.255.248"
ifconfig_ed2="inet 200.200.1.180  netmask 255.255.255.0"
sendmail_enable="NONE"
inetd_enable="NO"
kern_securelevel_enable="NO"
linux_enable="YES"
nfs_reserved_port_only="NO"
sshd_enable="YES"
usbd_enable="NO"
gateway_enable="YES"
#######################IPFILTER###########
ipfilter_enable="YES"
ipfilter_program="/sbin/ipf"
ipfilter_rules="/etc/ipf.rules"
ipfilter_flags=""
ipnat_enable="YES"
ipnat_program="/sbin/ipnat"
ipnat_rules="/etc/ipnat.rules"
ipnat_flags=""
######################IPFW#################
#firewall_enable="YES"
#firewall_script="/etc/rc.firewall"
#firewall_type="open"
#firewall_quiet="NO"
#firewall_logging_enable="YES"
#natd_enable="YES"
#natd_interface="ed0"
#natd_flags="-config /etc/natd.conf"
DL# cd /usr/src/sys/i386/conf/
DL# cat DL
machine         i386
cpu             I686_CPU
ident           DL
maxusers        0
options         MATH_EMULATE            #Support for x87 emulation
options         INET                    #InterNETworking
options         FFS                     #Berkeley Fast Filesystem
options         FFS_ROOT                #FFS usable as root device [keep this!]

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:FreeBSD服务器的安装与优化(1)

下一篇:FreeBSD核心入门 作者:(倭)大木敦雄 译:Liangvy