当前位置:网站首页>华为防火墙
华为防火墙
2022-08-02 14:04:00 【H2223】
aspf(防火墙双通道)
主要用于ftp主动模式,当ftp处于主动模式时,来回的端口号是不同的,由双方服务器协商产生,这时候就需要双通道将协商的端口号告知防火墙。
QQ的文字流量与语音流量有不同的传输通道,这时也需要双通道。
配置:
r1:trust
r2:untrust
首先在r2上开启ftp服务
aaa
local-user 123 password cipher 123
local-user 123 privilege level 15
local-user 123 ftp-directory flash:
local-user 123 service-type ftp
local-user admin password cipher 123
local-user admin service-type http
在防火墙上设置策略:
security-policy
rule name 1
source-zone trust
destination-zone local
destination-zone untrust
service ftp
service icmp
action permit
在防火墙上将区域划入接口:
firewall zone trust
set priority 85
add interface GigabitEthernet1/0/0
firewall zone untrust
set priority 5
add interface GigabitEthernet1/0/1
设置静态路由后就可以开始ftp:
r1:
ftp 100.1.1.2
passive //开启主动模式
cd dhcp
get dhcp-duid.txt
[USG6000V1]dis firewall session table
2022-04-01 07:04:01.510
Current Total Sessions : 3
ftp-data VPN: public --> public 10.1.1.2:51159 --> 100.1.1.2:50735
netbios-datagram VPN: public --> public 10.1.1.100:138 --> 10.1.1.255:138
ftp VPN: public --> public 10.1.1.2:49474 +-> 100.1.1.2:21
成功!
自定义aspf
上述aspf遇到未定义的应用就无法使用,也容易被黑客利用
通过修改端口可以保证服务的可用性,安全性
配置:
[USG6000V1]ip service-set port2121 type object
[USG6000V1-object-service-set-port2121]service protocol tcp source-port 0 to 655
35 destination-port 2121 // 设置源目端口
[USG6000V1]security-policy
[USG6000V1-policy-security-rule-1]service port2121 //将手动配置的端口加入到安全策略中
r1:
<trust>ftp 100.1.1.2 2121
Trying 100.1.1.2 ...
Press CTRL+K to abort
Connected to 100.1.1.2.
220 FTP service ready.
User(100.1.1.2:(none)):123
331 Password required for 123.
Enter password:
230 User logged in.
[trust-ftp]dir
但发现并不成功
原因:Aspf并没有监听2121端口,不能为2121端口建立通道
acl number 3000
rule 1 permit tcp destination 100.1.1.2 0 destination-port eq 2121
USG6000V1]firewall interzone trust untrust
detect ftp
detect user-defined 3000 inbound
detect user-defined 3000 outbound //修改Aspf的监听端口
但还是不行
[trust-ftp]dir
227 Entering Passive Mode (100,1,1,2,195,91).
端口识别
[USG6000V1]acl 2000
[USG6000V1-acl-basic-2000]rule permit source 100.1.1.2 0
[USG6000V1]port-mapping ftp port 2121 acl 2000
在r1上:
<trust>ftp 100.1.1.2 2121
Trying 100.1.1.2 ...
Press CTRL+K to abort
Connected to 100.1.1.2.
220 FTP service ready.
User(100.1.1.2:(none)):123
331 Password required for 123.
Enter password:
230 User logged in.
[trust-ftp]dir
200 Port command okay.
150 Opening ASCII mode data connection for *.
drwxrwxrwx 1 noone nogroup 0 Apr 01 09:59 dhcp
-rwxrwxrwx 1 noone nogroup 121802 May 26 2014 portalpage.zip
-rwxrwxrwx 1 noone nogroup 2263 Apr 01 09:59 statemach.efs
-rwxrwxrwx 1 noone nogroup 828482 May 26 2014 sslvpn.zip
drwxrwxrwx 1 noone nogroup 0 Apr 01 09:59 .
-rwxrwxrwx 1 noone nogroup 691 Apr 01 09:59 vrpcfg.zip
226 Transfer complete.
FTP: 394 byte(s) received in 0.200 second(s) 1.97Kbyte(s)/sec.
初步成功了
接下来在主动模式下get一个文件试试
[trust-ftp]cd dhcp
[trust-ftp]get dhcp-duid.txt
在防火墙上看看通道是否建立
[USG6000V1]dis firewall session table
2022-04-01 10:09:05.300
Current Total Sessions : 2
FTP VPN: public --> public 10.1.1.2:50628 +-> 100.1.1.2:2121
ftp-data VPN: public --> public 10.1.1.2:50911 --> 100.1.1.2:50004
边栏推荐
- verilog学习|《Verilog数字系统设计教程》夏宇闻 第三版思考题答案(第十一章)
- 宝塔搭建DM企业建站系统源码实测
- [ROS] (01) Create ROS workspace
- verilog学习|《Verilog数字系统设计教程》夏宇闻 第三版思考题答案(第九章)
- 使用云GPU+pycharm训练模型实现后台跑程序、自动保存训练结果、服务器自动关机
- C语言——断言assert的使用
- Introduction and use of Haystack
- Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id ‘c
- Using the cloud GPU + pycharm training model to realize automatic background run programs, save training results, the server automatically power off
- C语言——一级指针初识
猜你喜欢
随机推荐
Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id ‘c
Unit 7 ORM table relationships and operations
C语言日记 3 常量
What's wrong with running yolov5 (1) p, r, map are all 0
[ROS] Compiling packages packages encounters slow progress or stuck, use swap
(ROS) (03) CMakeLists. TXT, rounding
drf serializer - Serializer
paddleocr window10 first experience
[ROS] (06) ROS Communication - Topic Communication
Unit 15 Paging, Filtering
MobileNet ShuffleNet & yolov5 replace backbone
深度学习框架pytorch快速开发与实战chapter3
[ROS] (05) ROS Communication - Node, Nodes & Master
Deep learning framework pytorch rapid development and actual combat chapter4
The specific operation process of cloud GPU (Hengyuan cloud) training
MongoDB安装流程心得:
uniCloud 未能获取当前用户信息:30205 | 当前用户为匿名身份
C语言初级—用一角,两角,五角和一元组成3.5元有多少种组合方法
8581 Linear linked list inversion
C语言日记 4 变量