PFSense 融合Panabit 企业应用
硬件需求:
1.计算机等级参考pfsense最低规格需求 (CPU-P4 3.0;RAM-2G) 2.网卡4张
3. CROSSOVER线一条
所需软件:
Panabit (流控程序)
http://www.panabit.com/forum/forumdisplay.php?fid=13
Pfsense (软件防火墙)
Step.事前准备 a.)下载所需软件
本次Panabit模板的版本为Panabit V12.07标准版(核心代号「东汉」R3)正式版
Panabit_1207_fb8x.tar.gz
本次Pfsense范本为 2.0.1 RC2
Step.初始Pfsense
a.)确认所有所路卡皆可被pfsense侦测 b.)网卡名称为em0, em1, em2, em3,
em0设定为WAN
em1设定为LAN
注意: 网卡名称会依据网卡的型号而有所不同
c.)LAN端IP设定为172.16.1.254
设定Pfsense:
Step.设定外部管理 a.)
选单System -> Advanced ->Admin Access b.)
Protocol 勾选 HTTPS c.)
TCP Port 输入您自定义的port 范例 1522 d.)
移至最下面 Save e.)
选单 Firewall -> Rules -> WAN 点选最下方+增加增加一条防火墙规则 Action:Pass Interface: WAN Protocol: TCP Source: any
Destination: WAN address
Destination Port Range: From:1522 To:1522 移至最下面 Save
转跳后点选Apply change 结果 ID Proto Source Port Destination Port Gateway Queue Schedule Description * WAN address 1522 * none TCP *
Step.指定特定计算机IP地址 a.)
选单 Services -> DHCP Server -> LAN b.)
点选最下方+增加对应 c.)
MAC address 输入网卡MAC 00:0C:29:1D:9D:FD d.)
IP address 输入要给这张网卡的IP 172.16.1.200 e.)
移至最下面 Save f.)
转跳后点选Apply change
Step.设定Firewall Rules a.)
选单 Firewall -> Rules -> LAN b.)
点选最下方+增加对应 c.)
范例仅开放:网址IP转换(DNS),PING (ICMP),网页浏览 (HTTP) (HTTPS),文件服务器(FTP) 其余全部封锁
---------------------------------------------------------------------- 放行ICMP Action:Pass Interface: LAN Protocol: ICMP
Source: LAN subnet Destination: any 移至最下面 Save
---------------------------------------------------------------------- 放行DNS
Action:Pass Interface: LAN Protocol: TCP/UDP
Source: LAN subnet any Destination: any
Destination Port Range: From:DNS To:DNS 移至最下面 Save
----------------------------------------------------------------------
放行 HTTP (HTTPS ,FTP 设定相同仅需改变Destination Port Range ) Action:Pass Interface: LAN Protocol: TCP
Source: LAN subnet any Destination: any
Destination Port Range: From:HTTP To: HTTP 移至最下面 Save
---------------------------------------------------------------------- 阻挡全部
Action:Block Interface: LAN Protocol: any Source: any
Destination: any
----------------------------------------------------------------------
移至最下面 Save
转跳后点选Apply change 结果: IProto SourcPorDestinatiD e t on > ICMP LAN * * net > TCP/UDLAN * * P net > TCP LAN * * net > TCP LAN * * net > x
注意: 别忘了把预设的全部放行 rule停用
Port * 53 (DNS) 80 (HTTP) 443 (HTTPS) 21 (FTP) * Gateway * * * * Queue Schedule Description none none none none TCP * LAN net * * * * * * * none none > IProtSource LAN net Port * Destination * Port * Gateway * Queue none Schedule Description Default allow LAN to any rule D o *
Step.Boot Manager 修改等待时间 a.) 确认pfsense是否启用 SSH (可于consolas画面选择14. Enable sshd) b.) 透过 Xshell 登入pfsense (预设 Pfsense SSH 为Port :22 )
注意: 登入pfsense的账号要使用root登入,不是amdin,密码即为登入网页的密码
c.) 登入pfsense SSH # boot0cfg -v ad0 (显示目前设置) 结果
# flag start chs type end chs offset size 1 0x80 0: 1: 1 0xa5 351: 14:63 63 41942817
version=2.0 drive=0x80 mask=0xf ticks=182 bell=# (0x23) options=packet,update,nosetdrv volume serial ID 9090-9090 default_selection=F1 (Slice 1)
# boot0cfg -t 18 ad0
(修改Boot Manager时间为1秒,每 18.2 ticks 约1秒 ) # boot0cfg -v ad0 (显示目前设置) 结果
# flag start chs type end chs offset size 1 0x80 0: 1: 1 0xa5 351: 14:63 63 41942817
version=2.0 drive=0x80 mask=0xf ticks=18 bell=# (0x23) options=packet,update,nosetdrv volume serial ID 9090-9090 default_selection=F1 (Slice 1)
禁用freebsd启动菜单
a.) 确认pfsense是否启用 SSH (可于consolas画面选择14. Enable sshd) b.) 透过 Xshell 登入pfsense 预设 port 22
注意: 登入pfsense的账号要使用root登入,不是amdin
c.) 增加一行代码
# ee /boot/loader.conf # beastie_disable=\
(To exit & save press \
安装Panabit: Step 1.上传档案:
a.) 确认pfsense是否启用 SSH (可于consolas画面选择14. Enable sshd) b.) 透过 Xshell 登入pfsense 预设 port 22
注意: 登入pfsense的账号要使用root登入,不是amdin
c.) 将Panabit_1206_fb8x.tar 上传至appz (可自行建立目录)
d.) 透过 Xshell 登入pfsense (预设 Pfsense SSH 为Port :22 )
# cd /appz