You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
458 B

9 years ago
  1. #!/bin/bash
  2. # Create calico bridge cbr0 if it doesn't exist
  3. ifaces=$(ifconfig -a | sed 's/[ \t].*//;/^\(lo\|\)$/d' |tr '\n' ' ')
  4. if ! [[ "${ifaces}" =~ "cbr0" ]];then
  5. brctl addbr cbr0
  6. ip link set cbr0 up
  7. fi
  8. # Configure calico bridge ip
  9. br_ips=$(ip addr list cbr0 |grep "inet " |cut -d' ' -f6)
  10. if ! [[ "${br_ips}" =~ "{{ br_addr }}/{{ overlay_network_host_prefix }}" ]];then
  11. ip a add {{ br_addr }}/{{ overlay_network_host_prefix }} dev cbr0
  12. fi