Open The Ports

image-20210422225145548

Install Docker

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache && yum update -y && yum upgrade -y

# https://docs.docker.com/engine/install/centos/
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine \
&& yum install -y yum-utils git \
&& yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo \
&& yum-config-manager --enable docker-ce-nightly \
&& yum install docker-ce docker-ce-cli containerd.io \
&& systemctl start docker && systemctl enable docker.service

V2raya

1
2
3
4
5
6
7
docker run -d \
--privileged \
--network=host \
--name v2raya \
-v /etc/resolv.conf:/etc/resolv.conf \
-v /etc/v2raya:/etc/v2raya \
mzz2017/v2raya

image-20210422230549349

image-20210422230555912

Ipsec-vpn-server

zsh

1
2
3
4
5
6
7
8
9
10
11
yum install zsh -y

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

git clone https://github.com/zsh-users/zsh-autosuggestions.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

sed -i "s/plugins=(git)/plugins=(git zsh-syntax-highlighting zsh-autosuggestions)/g" ~/.zshrc

source ~/.zshrc
1
2
3
4
5
6
7
8
docker run \
--name ipsec-vpn-server \
--restart=always \
-v ikev2-vpn-data:/etc/ipsec.d \
-p 500:500/udp \
-p 4500:4500/udp \
-d --privileged \
hwdsl2/ipsec-vpn-server
1
docker logs ipsec-vpn-server

image-20210422232007695

image-20210422232028136

1
2
docker cp ipsec-vpn-server:/etc/ipsec.d/vpnclient.p12 .
docker cp /etc/ipsec.d/vpnclient.mobileconfig .

Windows

1
2
3
4
5
6
# 管理员打开 ,暂时不展示  密码是上面图片标出的那个 IMPORTANT PASSWORD
certutil -f -importpfx "" NoExport

powershell -command "Add-VpnConnection -ServerAddress '你的 VPN 服务器 IP(或者域名)' -Name 'My IKEv2 VPN' -TunnelType IKEv2 -AuthenticationMethod MachineCertificate -EncryptionLevel Required -PassThru"

powershell -command "Set-VpnConnectionIPsecConfiguration -ConnectionName 'My IKEv2 VPN' -AuthenticationTransformConstants GCMAES128 -CipherTransformConstants GCMAES128 -EncryptionMethod AES256 -IntegrityCheckMethod SHA256 -PfsGroup None -DHGroup Group14 -PassThru -Force"

Mac os

1
2
docker cp ipsec-vpn-server:/etc/ipsec.d/vpnclient.mobileconfig .
# 双击导入即可

Android

1
关键字段 Username | Password | Ipsec psk

IMG_0276

IMG_0275

XRSec has the right to modify and interpret this article. If you want to reprint or disseminate this article, you must ensure the integrity of this article, including all contents such as copyright notice. Without the permission of the author, the content of this article shall not be modified or increased or decreased arbitrarily, and it shall not be used for commercial purposes in any way