f1020防火墙端口映射,外网111.123.19.70 内网172.17.60.101 端口22,请问如何实现映射,需要写acl吗?策略又是如何设置呢
(0)
最佳答案
您好,参考
目录
本案例适用于软件平台为Comware V7系列防火墙:F100-X-G2、F1000-X-G2、F100-WiNet、F1000-AK、F10X0等
注:本案例是在F100-C-G2的Version 7.1.064, Release 9510P08版本上进行配置和验证的。
防火墙部署在互联网出口,内网有一台OA服务器192.168.1.88通过防火墙发布了8081端口到外网,内网用户使用192.168.1.88加端口号8081可以正常访问服务器,目前需要实现外用用户通过公网地址202.1.1.100加端口号8081访问OA服务器
#在外网口GigabitEthernet1/0/1上配置内部服务器映射:允许外网用户通过公网地址202.1.1.100、端口8081访问内部服务器192.168.1.88的8081端口
<H3C> system-view
[H3C] interface GigabitEthernet1/0/1
[H3C-GigabitEthernet1/0/1]ip add 202.1.1.100 255.255.255.248
[H3C-GigabitEthernet1/0/1]nat server protocol tcp global 202.1.1.100 8081 inside 192.168.1.88 8081
[H3C-GigabitEthernet1/0/1] quit
防火墙目前版本存在两套安全策略,请在放通安全策略前确认设备运行那种类型的安全策略?以下配置任选其一。
#创建地址对象组,地址对象组名称为OA服务器
[H3C]object-group ip address OA服务器
[H3C-obj-grp-ip-OA服务器]network host address 192.168.1.88
[H3C-obj-grp-ip-OA服务器]quit
#创建服务对象组,服务对象组名称为8081端口,目的端口8081
[H3C]object-group service 8081端口
[H3C-obj-grp-service-8081端口]service tcp destination eq 8081
[H3C-obj-grp-service-8081端口]quit
#创建IPv4对象策略,策略名称为0A服务器
[H3C]object-policy ip OA服务器
[H3C-object-policy-ip-OA服务器]rule 0 pass destination-ip 0A服务器 service 8081端口
#创建安全策略,源安全域为Untrust目的安全域为Trust,放通外网访问OA服务器的8081端口
[H3C]zone-pair security source Untrust destination Trust
[H3C-zone-pair-security-Untrust-Trust]object-policy apply ip OA服务器
[H3C-zone-pair-security-Untrust-Trust]quit
[H3C]display cu | in security-policy
security-policy ip
创建安全策略并放通源安全域为Untrust目的安全域为Trust,放通外网访问OA服务器的8081端口策略;
#创建地址对象组,地址对象组名称为OA服务器
[H3C]object-group ip address OA服务器
[H3C-obj-grp-ip-OA服务器]network host address 192.168.1.88
[H3C-obj-grp-ip-OA服务器]quit
#创建服务对象组,服务对象组名称为8081端口,目的端口8081
[H3C]object-group service 8081端口
[H3C-obj-grp-service-8081端口]service tcp destination eq 8081
[H3C-obj-grp-service-8081端口]quit
创建安全策略并放通local到trust和trust到local的安全策略。
[H3C]security-policy ip
[H3C-security-policy-ip]rule 10 name test
[H3C-security-policy-ip-10-test]action pass
[H3C-security-policy-ip-10-test]source-zone Untrust
[H3C-security-policy-ip-10-test]destination-zone Trust
[H3C-security-policy-ip-10-test]destination-ip OA服务器
[H3C-security-policy-ip-10-test]service 8081端口
[H3C-security-policy-ip-10-test]quit
(0)
暂无评论
可以使用nat server将内部服务器映射到外网。
以下是配置案例,请参考:
组网说明:
本案例采用H3C HCL模拟器的F1060来模拟NAT server典型组网配置,内网和外网在网络拓扑图中已经有了明确的标识,FW1作为内网的出口设备,不仅保护内网的安全,也提供地址转换的服务。内网申请了202.1.100.2-202.1.100.3这两个公网地址,其中202.1.100.2用于FW1与外网互联使用。202.1.100.3用于给内网的WEB服务器转换并对外网提供WEB服务。由于模拟器及物理机的局限性,因此采用H3C HCL模拟器的S5820交换机开启WEB功能模拟成WEB服务器。
1、按照网络拓扑图正确配置IP地址
2、Web_server开启WEB功能,并创建相应账户及赋予权限
3、FW1配置NAT地址转换,并配置默认路由指向外网
4、FW1配置nat server,并发布内网的WEB服务器
Web_server:
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysname web_server
[web_server]int gi 1/0/1
[web_server-GigabitEthernet1/0/1]port link-mode route
[web_server-GigabitEthernet1/0/1]des <connect to FW1>
[web_server-GigabitEthernet1/0/1]ip address 10.0.0.2 30
[web_server-GigabitEthernet1/0/1]quit
[web_server]ip route-static 0.0.0.0 0.0.0.0 10.0.0.1
[web_server]ip http enable
[web_server]ip https enable
[web_server]local-user admin
New local user added.
[web_server-luser-manage-admin]password simple admin
[web_server-luser-manage-admin]service-type http https
[web_server-luser-manage-admin]authorization-attribute user-role network-admin
[web_server-luser-manage-admin]quit
[web_server]
ISP:
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysname ISP
[ISP]int gi 0/1
[ISP-GigabitEthernet0/1]ip address 202.103.224.254 24
[ISP-GigabitEthernet0/1]quit
[ISP]int gi 0/0
[ISP-GigabitEthernet0/0]des <connect to FW1>
[ISP-GigabitEthernet0/0]ip address 202.1.100.1 28
[ISP-GigabitEthernet0/0]quit
FW1:
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]sysname FW1
[FW1]acl basic 2001
[FW1-acl-ipv4-basic-2001]rule 0 permit source any
[FW1-acl-ipv4-basic-2001]quit
[FW1]
[FW1]zone-pair security source trust destination untrust
[FW1-zone-pair-security-Trust-Untrust]packet-filter 2001
[FW1-zone-pair-security-Trust-Untrust]quit
[FW1]
[FW1]zone-pair security source untrust destination trust
[FW1-zone-pair-security-Untrust-Trust]packet-filter 2001
[FW1-zone-pair-security-Untrust-Trust]quit
[FW1]
[FW1]zone-pair security source trust destination local
[FW1-zone-pair-security-Trust-Local]packet-filter 2001
[FW1-zone-pair-security-Trust-Local]quit
[FW1]
[FW1]zone-pair security source local destination trust
[FW1-zone-pair-security-Local-Trust]packet-filter 2001
[FW1-zone-pair-security-Local-Trust]quit
[FW1]
[FW1]zone-pair security source untrust destination local
[FW1-zone-pair-security-Untrust-Local]packet-filter 2001
[FW1-zone-pair-security-Untrust-Local]quit
[FW1]
[FW1]zone-pair security source local destination untrust
[FW1-zone-pair-security-Local-Untrust]packet-filter 2001
[FW1-zone-pair-security-Local-Untrust]quit
[FW1]int gi 1/0/3
[FW1-GigabitEthernet1/0/3]des <connect to web_server>
[FW1-GigabitEthernet1/0/3]ip address 10.0.0.1 30
[FW1-GigabitEthernet1/0/3]quit
[FW1]security-zone name Trust
[FW1-security-zone-Trust]import interface GigabitEthernet 1/0/3
[FW1-security-zone-Trust]quit
FW1 NAT及NAT server关键配置点:
[FW1]acl basic 2000
[FW1-acl-ipv4-basic-2000]rule 0 permit source any
[FW1-acl-ipv4-basic-2000]quit
[FW1]int gi 1/0/4
[FW1-GigabitEthernet1/0/4]des <connect to ISP>
[FW1-GigabitEthernet1/0/4]ip address 202.1.100.2 28
[FW1-GigabitEthernet1/0/4]nat outbound 2000
[FW1-GigabitEthernet1/0/4]nat server protocol tcp global 202.1.100.3 80 inside 10.0.0.2 80
[FW1-GigabitEthernet1/0/4]nat server protocol tcp global 202.1.100.3 443 inside 10.0.0.2 443
[FW1-GigabitEthernet1/0/4]quit
[FW1]ip route-static 0.0.0.0 0.0.0.0 202.1.100.1
[FW1]security-zone name Untrust
[FW1-security-zone-Untrust]import interface GigabitEthernet 1/0/4
[FW1-security-zone-Untrust]quit
物理机填写IP地址:
物理机打开浏览器,输入网址:https://202.1.100.3 ,可以登陆到web服务器
输入用户名、密码,点击登录:
登陆成功:
查看FW1 NAT的显示信息:
[FW1]dis nat session verbose
Slot 1:
Total sessions found: 0
[FW1]dis nat session verbose
Slot 1:
Initiator:
Source IP/port: 202.103.224.68/50855
Destination IP/port: 202.1.100.3/443
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/4
Source security zone: Untrust
Responder:
Source IP/port: 10.0.0.2/443
Destination IP/port: 202.103.224.68/50855
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/3
Source security zone: Trust
State: TCP_ESTABLISHED
Application: HTTPS
Rule ID: 0
Rule name:
Start time: 2020-03-07 10:34:53 TTL: 596s
Initiator->Responder: 0 packets 0 bytes
Responder->Initiator: 0 packets 0 bytes
Initiator:
Source IP/port: 202.103.224.68/50853
Destination IP/port: 202.1.100.3/443
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/4
Source security zone: Untrust
Responder:
Source IP/port: 10.0.0.2/443
Destination IP/port: 202.103.224.68/50853
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/3
Source security zone: Trust
State: TCP_ESTABLISHED
Application: HTTPS
Rule ID: 0
Rule name:
Start time: 2020-03-07 10:34:52 TTL: 596s
Initiator->Responder: 0 packets 0 bytes
Responder->Initiator: 0 packets 0 bytes
Initiator:
Source IP/port: 202.103.224.68/50860
Destination IP/port: 202.1.100.3/443
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/4
Source security zone: Untrust
Responder:
Source IP/port: 10.0.0.2/443
Destination IP/port: 202.103.224.68/50860
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/3
Source security zone: Trust
State: TCP_ESTABLISHED
Application: HTTPS
Rule ID: 0
Rule name:
Start time: 2020-03-07 10:34:53 TTL: 596s
Initiator->Responder: 0 packets 0 bytes
Responder->Initiator: 0 packets 0 bytes
Initiator:
Source IP/port: 202.103.224.68/50852
Destination IP/port: 202.1.100.3/443
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/4
Source security zone: Untrust
Responder:
Source IP/port: 10.0.0.2/443
Destination IP/port: 202.103.224.68/50852
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/3
Source security zone: Trust
State: TCP_ESTABLISHED
Application: HTTPS
Rule ID: 0
Rule name:
Start time: 2020-03-07 10:34:52 TTL: 596s
Initiator->Responder: 0 packets 0 bytes
Responder->Initiator: 0 packets 0 bytes
Initiator:
Source IP/port: 202.103.224.68/50861
Destination IP/port: 202.1.100.3/443
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/4
Source security zone: Untrust
Responder:
Source IP/port: 10.0.0.2/443
Destination IP/port: 202.103.224.68/50861
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/3
Source security zone: Trust
State: TCP_ESTABLISHED
Application: HTTPS
Rule ID: 0
Rule name:
Start time: 2020-03-07 10:34:53 TTL: 597s
Initiator->Responder: 0 packets 0 bytes
Responder->Initiator: 0 packets 0 bytes
Initiator:
Source IP/port: 202.103.224.68/50859
Destination IP/port: 202.1.100.3/443
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/4
Source security zone: Untrust
Responder:
Source IP/port: 10.0.0.2/443
Destination IP/port: 202.103.224.68/50859
DS-Lite tunnel peer: -
VPN instance/VLAN ID/Inline ID: -/-/-
Protocol: TCP(6)
Inbound interface: GigabitEthernet1/0/3
Source security zone: Trust
State: TCP_ESTABLISHED
Application: HTTPS
Rule ID: 0
Rule name:
Start time: 2020-03-07 10:34:53 TTL: 597s
Initiator->Responder: 0 packets 0 bytes
Responder->Initiator: 0 packets 0 bytes
Total sessions found: 6
[FW1]
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论