Connecting a Virtual Machine

The following steps were created with a Vagrant virtual machine.
The steps for setting up a server are very similar.

Start the Vagrant VM

  1. Clone the enftun repositoy from https://github.com/xaptum/enftun
  2. If desired, update the Vagrantfile to use your favorite debian flavor.
    This guide was written using bento/debian-9.11

  3. Start vagrant
    vagrant up

Create a certificate using ENFCLI

If using vagrant, create the files in the same directory where Vagrantfile resides.

  1. enfcli --host https://demo.xaptum.io --user xap@demo
  2. iam create-endpoint-key --key-out-file=enf0.key.pem --public-key-out-file=enf0.pubkey.pem
  3. iam create-endpoint-with-address --address=2607:8f80:8080:9::2 --public-key-in-file=enf0.pubkey.pem
    The chosen IP address must be in the desired /64 network.
    In this case, the network is one of Xaptum’s demo networks.

  4. iam create-endpoint-cert --cert-out-file=enf0.crt.pem --identity=2607:8f80:8080:9::2 --key-in-file=enf0.key.pem
  5. exit

Transfer keys to the VM

vagrant VM should be running.

  1. vagrant rsync
    This step may be unnecessary because vagrant may do this automatically.
    The files from the host machine’s directory will be visible in /vagrant/ on the VM

Install ENFTUN on the VM (or server)

  1. Connect to the VM or log into the server.
    vagrant ssh

  2. To install the ENFTUN, follow the directions in the ENFTUN README file in: https://github.com/xaptum/enftun/blob/master/README.md , but don’t start it yet.

    • Installing from the debian package is easiest.
    • It is least error-prone if you install using systemd. It isn’t necessary to configure systemd to start enf0 at boot.

Configure the ENFTUN

  1. sudo cp /usr/share/doc/enftun/example/server.conf /etc/enftun/enf0.conf
  2. sudo vi /etc/enftun/enf0.conf
    • Most of the settings can be left commented out, as they are the defaults.
    • Uncomment the line beginning with hosts = and remove the IPv6 address
    • save and exit
  3. sudo mkdir -p /etc/enftun/enf0
  4. sudo cp /vagrant/enf0.crt.pem /etc/enftun/enf0
  5. sudo cp /vagrant/enf0.key.pem /etc/enftun/enf0

Start enftun

  1. sudo systemctl start enftun@enf0

Test the connection

At this point, you should be able to ping a machine on the same ENF subnet.

  • ping 2607:8f80:8080:9::1
    PING 2607:8f80:8080:9::1(2607:8f80:8080:9::1) 56 data bytes
    64 bytes from 2607:8f80:8080:9::1: icmp_seq=1 ttl=58 time=33.7 ms
    64 bytes from 2607:8f80:8080:9::1: icmp_seq=2 ttl=58 time=28.7 ms
    64 bytes from 2607:8f80:8080:9::1: icmp_seq=3 ttl=58 time=31.5 ms
    ...
    

Didn't find what you were looking for?

Contact us and we’ll get back to you as soon as possible.

Contact Us