Open The Ports

image-20210422225145548

Install Docker

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

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

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
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
docker logs ipsec-vpn-server

image-20210422232007695

image-20210422232028136

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

Windows

# 管理员打开 ,暂时不展示  密码是上面图片标出的那个 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

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

Android

关键字段 Username | Password | Ipsec psk

IMG_0276

IMG_0275