geri-m / vcable

Virtual Cable is a IoT platform for bridging the Ethernet Port of Raspberry PIs to create a virtual network link between two device.
http://www.vcable.org
MIT License
2 stars 0 forks source link

VCable - Virtual Cable

Virtual Cable is a IoT platform for bridging the Ethernet Port of Raspberry PIs to create a virtual network link between two device.

For bridging we are using OpenVPN and Bridge Control.

Testing

1) Virtual Box For Testing you can use Ubuntu Minimal in a Virtual Box Environment, if you don't run on Linux.

2) Add Packages On Ubuntu install the OpenSSH Server and Python (as we will use Ansible in a second step.)

3) Setup Port forwarding Setup access of the Guest OS using Nat and Port-Forwarding.

4) Setup the Host using Ansible

ansible-playbook -i inventory.yml --extra-vars "ansible_user=<SSH_USER> ansible_password=<SSH_PWD> ansible_become_pass=<ROOT_PWD>" ci.yml -vvvv

If you are on OSX you will require sshpass which is not part of the brew universe. You can find the sources here.

Setting up the OpenVPN Containers for Testing

OpenVPN as Container Image with enabled Management Console.

For Test Purpose we use this docker image (git).

In order to run the container with the enabled management interface, we add a custom config, namely the management interface config. Using no password for the Server CA is okay for testing purpose.

The vars file enables us to use batch mode, which does not require interaction during setup (as long as there are no previous) certs.

docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u udp://localhost -e 'management 0.0.0.0 7505'
docker run -v $OVPN_DATA:/etc/openvpn -v /tmp/vars:/usr/local/bin/vars --rm -it kylemanna/openvpn ovpn_initpki nopass

Run the server container as daemon

docker run -d -v $OVPN_DATA:/etc/openvpn -p 1194:1194/udp -p 7505:7505 --cap-add=NET_ADMIN kylemanna/openvpn

Gen Keys for a client

docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn easyrsa build-client-full client_1 nopass

Generate the Config for a client.

docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_getclient client_1 > $OVPN_DATA/client_1.ovpn

Run the Client with this Config in a Container

docker run -v $OVPN_DATA:/etc/openvpn -v /dev/net/tun:/dev/net/tun --network=host --rm --cap-add=NET_ADMIN kylemanna/openvpn openvpn --config /etc/openvpn/client_1.ovpn

Hardware in Use

The hardware we are using is a Raspberry PI with a custom shield. The shield holds an Ericsson LTE Modem, an NFC Interface with an NXP PN531, two switches and five additional LEDs.

Shield PCB

Daughter Board for Raspberry PI

Pictures of VCable Prototype Version 1

VCable Prototype Version 1 VCable Prototype Version 1 VCable Prototype Version 1

Pictures of VCable Prototype Version 2

VCable Housing Prototype VCable Housing Prototype