blob: 8ae66ee05b2e205ab47babc22110f4d18a0e7dc7 [file] [log] [blame]
#!/bin/bash
iptables -L > /dev/null
ip6tables -L > /dev/null
docker inspect vcpe > /dev/null 2>&1
if [ "$?" == 1 ]
then
docker pull andybavier/docker-vcpe
docker run -d --name=vcpe --privileged=true --net=none -v /etc/dnsmasq.d:/etc/dnsmasq.d andybavier/docker-vcpe
else
docker start vcpe
fi
# Set up networking via pipework
docker exec vcpe ifconfig eth0 >> /dev/null || pipework eth4 -i eth0 vcpe {{ wan_ip }}/17@192.168.128.1 {{ wan_mac }}
docker exec vcpe ifconfig eth1 >> /dev/null || pipework eth3 -i eth1 vcpe 192.168.0.1/24 @{{ vlan_ids[0] }}
docker exec vcpe ifconfig eth2 >> /dev/null || pipework eth0 -i eth2 vcpe {{ hpc_client_ip }}/24
# Now can start up dnsmasq
docker exec vcpe service dnsmasq start
# Attach to container
docker start -a vcpe