免费资源网 – https://freexyz.cn/
1.起动一个ubuntu容器,我是用的docker compose启动的,compose的配置文件为ipsec-strongswan.yml
services: ipsec-strongswan: image: ubuntu:22.04 container_name: ipsec-strongswan cap_add: – NET_ADMIN – SYS_ADMIN – SYS_MODULE command: “tail -f /dev/null” # 示例:保持容器运行,但不会做任何实际工作 volumes: – /opt/services/ipsec-strongswan/ipsec.conf:/etc/ipsec.conf – /opt/services/ipsec-strongswan/ipsec.secrets:/etc/ipsec.secrets – /opt/services/ipsec-strongswan/USERTrust_RSA_Certification_Authority.pem:/etc/ipsec.d/cacerts/USERTrust_RSA_Certification_Authority.pem – /opt/services/ipsec-strongswan/charon-logging.conf:/etc/strongswan.d/charon-logging.conf – /opt/services/ipsec-strongswan/log:/var/log/strongswan #端口是给3proxy用的 ports: – 1180:1080 networks: default: name: sill sudo docker compose -f ipsec-strongswan.yml up -d2.进入容器内
sudo docker exec -it ipsec-strongswan /bin/bash3.开始安装
apt-get update apt-get install strongswan libcharon-extra-plugins再安装一些常用的软件
apt-get install vim iputils-ping curl mtr我的配置已经在compose文件里加载了,所以不配了。直接启动
# 启动ipsec ipsec restart # 连接connection uk2 ipsec up uk2连接成功的话显示connection ‘uk2’ established successfully
查看状态 ipsec statusall停止连接
ipsec down uk2停止ipsec
ipsec stop以下是一些其他命令:
查看网络ip addr show 简写为 ip a s查看docker服务的网络
sudo docker inspect -f {{.Name}}: {{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}} nginx jenkins rmqnamesrv mysql rmqbroker rocketmq-console redis6379 redis6380 redis6381 sentinel26379 sentinel26380 sentinel26381 ipsec-strongswan查看主机路由
ip route show附 安装3proxy
sudo docker cp /home/ubuntu/Downloads/3proxy-0.9.4.x86_64.deb ipsec-strongswan:/usr/local参考资料
© 版权声明
THE END
暂无评论内容