81 lines
2.4 KiB
YAML
81 lines
2.4 KiB
YAML
# Versions of Docker Compose >= 3 do not support IPv6. How regressive...
|
|
version: "2.3"
|
|
# Create a new L2 network for the routers to peer over.
|
|
# The gateways are fictitious and are not used.
|
|
networks:
|
|
bgp:
|
|
enable_ipv6: true
|
|
driver: bridge
|
|
ipam:
|
|
config:
|
|
- subnet: 192.168.179.0/24
|
|
gateway: 192.168.179.254
|
|
- subnet: fd00::/64
|
|
gateway: fd00::ffff
|
|
# Create two routers to peer with each other.
|
|
services:
|
|
AS1:
|
|
build: .
|
|
image: bgpdemo/bird
|
|
container_name: AS1
|
|
# NET_ADMIN required to add IP addresses to interfaces within the container.
|
|
cap_add:
|
|
- NET_ADMIN
|
|
# Docker likes to spam ICMP redirects which breaks the fancy routing we just configured. Ignore them!
|
|
sysctls:
|
|
net.ipv4.conf.eth0.accept_redirects: 0
|
|
net.ipv6.conf.eth0.accept_redirects: 0
|
|
volumes:
|
|
- type: bind
|
|
source: ./AS1
|
|
target: /demo
|
|
# Expose the BGP port so you can mess with it. :-)
|
|
ports:
|
|
- "17901:179/tcp"
|
|
networks:
|
|
bgp:
|
|
# The addresses AS2 will peer with.
|
|
ipv4_address: 192.168.179.1
|
|
ipv6_address: fd00::1
|
|
AS2:
|
|
image: bgpdemo/bird
|
|
depends_on:
|
|
- AS1
|
|
container_name: AS2
|
|
cap_add:
|
|
- NET_ADMIN
|
|
sysctls:
|
|
net.ipv4.conf.eth0.accept_redirects: 0
|
|
net.ipv6.conf.eth0.accept_redirects: 0
|
|
volumes:
|
|
- type: bind
|
|
source: ./AS2
|
|
target: /demo
|
|
ports:
|
|
- "17902:179/tcp"
|
|
networks:
|
|
bgp:
|
|
# The addresses AS1 will peer with.
|
|
ipv4_address: 192.168.179.2
|
|
ipv6_address: fd00::2
|
|
AS3:
|
|
image: bgpdemo/bird
|
|
depends_on:
|
|
- AS1
|
|
container_name: AS2
|
|
cap_add:
|
|
- NET_ADMIN
|
|
sysctls:
|
|
net.ipv4.conf.eth0.accept_redirects: 0
|
|
net.ipv6.conf.eth0.accept_redirects: 0
|
|
volumes:
|
|
- type: bind
|
|
source: ./AS2
|
|
target: /demo
|
|
ports:
|
|
- "17902:179/tcp"
|
|
networks:
|
|
bgp:
|
|
# The addresses AS1 will peer with.
|
|
ipv4_address: 192.168.179.2
|
|
ipv6_address: fd00::2 |