hwdsl2/setup-ipsec-vpn

How to generate .mobileconfig file

motikolorado opened this issue · 2 comments

There is no explanation in the IKEv2 readme on how to generate the .mobileconfig file to send to IOS or any device to connect to the VPN. docs/ikev2-howto.md Please how do i generate this file in a remote server environment like fly.io where i don't have access to the terminal. I deploy with this Dockerfile:

FROM ubuntu:latest

RUN apt-get update && \
    apt-get install -y wget

RUN wget https://get.vpnsetup.net -O vpn.sh

ENV VPN_IPSEC_PSK 'xxxxxxxxxxxxxxxxxxxx'
ENV VPN_USER 'xxxxxxxxxxxxxxxxxxxx'
ENV VPN_PASSWORD 'xxxxxxxxxxxxxxxxxxxx'

EXPOSE 500/udp 4500/udp

CMD VPN_IPSEC_PSK=$VPN_IPSEC_PSK VPN_USER=$VPN_USER VPN_PASSWORD=$VPN_PASSWORD bash vpn.sh && \
    tail -f /dev/null

I am deploying the vpn to fly.io but IPSEC is not working and i can only connect with IKEv2. But i don't have the .mobileconfig file to connect on my IPhone and MacOS.
Please explain how to get the .mobileconfig file and probably how to deploy properly to fly.io

Screenshot 2023-12-14 at 6 59 04 PM

@motikolorado I believe if you have run the ikev2 setup script the connection profiles are already generated for you. All you have to do is to find a way to transfer them onto your target client devices.

As I can see in your screenshot the mobileconfig file is located under /root directory in your instance's file system.

@motikolorado Hello! The fly.io environment is not currently supported in this project.

For the VPN to work, you might need to forward UDP ports 500 and 4500 to the container in fly.io settings. For the .mobileconfig file, if allowed by fly.io, you can mount a folder on the fly.io instance into the Docker container, then in the Dockerfile, copy the generated /root/vpnclient.mobileconfig to the mounted folder so that it's available on the host. After that, copy the file from fly.io instance to your local machine. You can find some info by searching "fly.io copy file from container".

There's also a pre-built Docker image you can refer to.