I tested this with gentoo, and docker with --experimental.
OVH vrack is a virtual rack for your dedicated server. You can get a whole ip subnet from ovh, which you can map to any of the host inside the vrack.
The dedicated server has second network device (eth1,eno2,…) which is connected to the vrack.
- Setup eth1/eno2 with a private network ip
# ip addr add 10.0.x.x/16 dev eth1
1.1 Set link up
# ip link eth1 up
- First you need to create a docker network based on your ip-subnet
# docker network create -d ipvlan --subnet=176.xxx.xxx.48/28 --gateway=176.xxx.xxx.62 -o parent=eth1 avrack
- Then you can start a container with an ip from this subnet
# docker run -d --name web --net=avrack --ip=176.xxx.xx.61 larsks/simpleweb
- Now you can reach the host from outsite at 176.xxx.xx.61
# curl 176.xxx.xx.61
version: "2"
services:
frontend:
container_name: frontend
image: larsks/simpleweb
networks:
avrack:
ipv4_address: 176.xxx.xxx.61
networks:
avrack:
external: true
- Create a config on every node, with only one ip in the range
# docker network create --config-only --subnet=135.xxx.xx.xx/27 --gateway=135.xxx.xx.xx --ip-range 135.xxxx.xxx.65/32 -o parent=eno2 vrack65
- Create a global swarm network
#docker network create -d ipvlan --scope swarm --config-from vrack65 avrack65 --attachable
-
Use the new network in the docker-compose.yml-Stack
-
Repeat for every ip you need from the subnet.