当前位置:网站首页>华为防火墙
华为防火墙
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
边栏推荐
- Visual Studio配置OpenCV之后,提示:#include<opencv2/opencv.hpp>无法打开源文件
- C语言初级—从键盘接收一个整形并逆序输出
- [ROS]ROS常用工具介绍(待续)
- c语言三子棋详解!!! (电脑智能下棋)(附上完整代码)
- [ROS](02)创建&编译ROS软件包Package
- 深度学习框架pytorch快速开发与实战chapter4
- A little thought about password encryption
- Flask contexts, blueprints and Flask-RESTful
- 【ROS】编译软件包packages遇到进度缓慢或卡死,使用swap
- 云GPU(恒源云)训练的具体操作流程
猜你喜欢
随机推荐
static关键字3种作用,简单粗暴对比,好理解
verilog学习|《Verilog数字系统设计教程》夏宇闻 第三版思考题答案(第十二章)
VS Code无法安装插件之Unable to install because, the extension '' compatible with current version
Introduction and use of Haystack
原码、补码、反码
[ROS](04)package.xml详解
Programming Specifications - LiteOS
Chapter6 visualization (don't want to see the version)
paddle window10环境下使用conda安装
Unit 12 associated serialization
【VCU】详解S19文件(S-record)
How does Apache, the world's largest open source foundation, work?
ToF相机从Camera2 API中获取DEPTH16格式深度图
初识c语言指针
Unit 11 Serializers
run yolov5
Verilog学习 系列
数据的表示方法和转换(二进制、八进制、十进制、十六进制)
Using the cloud GPU + pycharm training model to realize automatic background run programs, save training results, the server automatically power off
Basic operations of 8583 sequential stack









CMakeLists.txt详解](/img/34/577c729f06748f625ca0c223496d48.png)