# Laboratorio de la semana 3, pasos 1 a 3: un switch (bridge de Linux) y cuatro hosts.
# Las MAC de los hosts son fijas para que la salida coincida con los apuntes. Se
# desactiva IPv6 en la red de datos para que solo se vea el tráfico que provocamos.
name: w03-lan
mgmt:
  network: redes-w03-lan
  ipv4-subnet: 172.90.3.0/26
  ipv6-subnet: 3fff:172:90:3:a::/80
topology:
  defaults:
    kind: linux
    image: redes-router
    sysctls:
      net.ipv6.conf.all.disable_ipv6: 1
      net.ipv6.conf.default.disable_ipv6: 1
    binds:
      - ../build/arp_probe:/usr/local/bin/arp_probe:ro
  nodes:
    sw1:
      exec:
        - ip link add br0 type bridge
        - sysctl -q -w net.ipv6.conf.br0.disable_ipv6=1
        - ip link set eth1 master br0
        - ip link set eth2 master br0
        - ip link set eth3 master br0
        - ip link set eth4 master br0
        - ip link set br0 up
    h1:
      exec: ["ip addr add 10.203.0.1/24 dev eth1"]
    h2:
      exec: ["ip addr add 10.203.0.2/24 dev eth1"]
    h3:
      exec: ["ip addr add 10.203.0.3/24 dev eth1"]
    h4:
      exec: ["ip addr add 10.203.0.4/24 dev eth1"]
  links:
    - type: veth
      endpoints:
        - {node: sw1, interface: eth1}
        - {node: h1, interface: eth1, mac: "02:00:00:00:00:01"}
    - type: veth
      endpoints:
        - {node: sw1, interface: eth2}
        - {node: h2, interface: eth1, mac: "02:00:00:00:00:02"}
    - type: veth
      endpoints:
        - {node: sw1, interface: eth3}
        - {node: h3, interface: eth1, mac: "02:00:00:00:00:03"}
    - type: veth
      endpoints:
        - {node: sw1, interface: eth4}
        - {node: h4, interface: eth1, mac: "02:00:00:00:00:04"}
