# VPN_net_patch **Repository Path**: zhaoxu_12121/vpn_net_patch ## Basic Information - **Project Name**: VPN_net_patch - **Description**: netmaneger_base和netmaneger_ext仓VPN相关patch - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2024-11-15 - **Last Updated**: 2024-12-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # VPN_net_patch ## 介绍 - ​net_ext_5.0.patch为netmanager_etx的补丁文件 - net_bsae_5.0.patch为netmanager_base的补丁文件 # 三方库相关 ## 三方库的下载 ```shell # 下载三方库 到根目录的third_party,改名称为strongswan git clone https://gitee.com/cooperation-team-7885/third_party_strongswan.git ``` ## 三方库修改编译 ```shell # 修改1 third_party/strongswan/strongswan_config.gni common_cflags = [ "-Wno-ignored-attributes" # 添加项 ] # 修改2 third_party/strongswan/src/libstrongswan/utils/utils.h #define _GNU_SOURCE #注释掉该重复定义 # 添加到编译子系统中 vendor/hys/oriole/config.json "subsystem" : "thirdparty", "components" [ ... { "component": "strongswan", "features": [] } ] ``` # 框架层相关 ## 框架层patch使用 ### 1.下载本patch库到coundation/communication ### 2.进入对应的仓目录 ```shell cd foundation/communication/netmanager_base cd foundation/communication/netmanager_ext ``` ### 3.手动打patch命令 ```shell # 首先参数验证patch正确性,如不报错则没问题,命令: git apply xx.patch --check # 然后执行patch命令: git apply xx.patch ``` 不报错再执行patch ![alt text](image.png) ## 框架层相关修改和编译 ```shell 1. 参考连接:https://gitee.com/openharmony/vendor_hihope/pulls/1255/files 2. 修改参考,路径rk3568更改为oriole如 rk3568/etc/param/product_rk3568.para 位置对应为 vendor/hardmony/oriole/etc/para/product_oriole.para 其中: # product_oriole.para 只需要三种协议 # support IKEV2_IPSEC_MSCHAPv2 = 1,IKEV2_IPSEC_PSK,IKEV2_IPSEC_RSA, # L2TP_IPSEC_PSK,L2TP_IPSEC_RSA,IPSEC_XAUTH_PSK,IPSEC_XAUTH_RSA,IPSEC_HYBRID_RSA const.product.supportVpn=1,2,3 # oriole/config.json 只需要添加需要的三方库 { "component": "strongswan", "features": [] } ``` # 配置文件整改和新增 使用ipsec restart 和ipsec up home 进行连接需要配置 需整改添加ipsec.conf和ipsec.secrets.conf等文件 流程如下: ![alt text](image-1.png) [框架层代码代码在dayu200进行部分修改,可作为参考](./dayu200_add_voncinfig.patch)