| #!/bin/bash |
| |
| iptables -L > /dev/null |
| ip6tables -L > /dev/null |
| |
| docker inspect vcpe > /dev/null 2>&1 |
| if [ "$?" == 1 ] |
| then |
| docker run -d --name=vcpe --privileged=true --net=none -v /etc/dnsmasq.d/servers.conf:/etc/dnsmasq.d/servers.conf 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 |
| docker exec vcpe ifconfig eth1 >> /dev/null || pipework eth3 -i eth1 vcpe 192.168.0.1/24 @{{ vlan_ids[0] }} |
| |
| # Now can start up dnsmasq |
| docker exec vcpe service dnsmasq start |
| |
| # Attach to container |
| docker start -a vcpe |