-
Notifications
You must be signed in to change notification settings - Fork 30
Run IPOP with Docker
Vahid Daneshmand edited this page Feb 10, 2020
·
1 revision
Description | |
---|---|
Tested on | Ubuntu 18.04 x64 |
Time | ~ 5 Minutes |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt-get update -y
sudo apt-get install -y openvswitch-switch \
python3 python3-pip python3-venv \
apt-transport-https \
ca-certificates \
curl git \
software-properties-common \
containerd.io \
docker-ce-cli \
docker-ce
groupadd -f docker
sudo usermod -a -G docker $USER
docker network create dkrnet
The example below will assume you have the following folders created:
/home/$USER/ipop/config
/home/$USER/ipop/log/drk001
And that a valid IPOP configuration file is stored in:
/home/$USER/ipop/config/config-001.json
docker run -d -v /home/$USER/ipop/config/config-001.json:/etc/opt/ipop-vpn/config.json -v /home/$USER/ipop/log/drk001:/var/log/ipop-vpn/ -v --rm --privileged --name ipop-dkr001 --network dkrnet ipopproject/ipop-vpn:1.0 /sbin/init
You should then be able to log in to the container and check it obtained an IPOP virtual network address (naturally, your Docker container ID and IP addresses will be different from what you see below):
docker exec -it ipop-dkr001 /bin/bash
root@5d79c6188d03:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ipopbr1010001: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1410 qdisc noqueue state UP group default qlen 1000
link/ether 12:93:82:c2:91:e9 brd ff:ff:ff:ff:ff:ff
inet 10.10.10.20/24 scope global ipopbr1010001
valid_lft forever preferred_lft forever
3: tnl87d62f4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1410 qdisc fq_codel master ipopbr1010001 state UNKNOWN group default qlen 1000
link/ether 1a:dc:5e:32:aa:ac brd ff:ff:ff:ff:ff:ff
4: tnl79e5473: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1410 qdisc fq_codel master ipopbr1010001 state UNKNOWN group default qlen 1000
link/ether 12:93:82:c2:91:e9 brd ff:ff:ff:ff:ff:ff
14: eth0@if15: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 02:42:ac:12:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 172.18.0.2/16 brd 172.18.255.255 scope global eth0
valid_lft forever preferred_lft forever
root@5d79c6188d03:~# ping 10.10.10.10
PING 10.10.10.10 (10.10.10.10) 56(84) bytes of data.
64 bytes from 10.10.10.10: icmp_seq=2 ttl=64 time=41.3 ms
64 bytes from 10.10.10.10: icmp_seq=3 ttl=64 time=43.6 ms
64 bytes from 10.10.10.10: icmp_seq=4 ttl=64 time=45.4 ms