|
1 | 1 | # evpn-connector |
2 | 2 |
|
3 | | -The main task of this daemon is to interact with the gobgp and ovs to provide a connection using the EVPN protocol |
| 3 | +[](https://www.python.org/downloads/) |
| 4 | +[](LICENSE) |
| 5 | + |
| 6 | +A service for automating the management distributed switch or router based on EVPN standards |
| 7 | + |
| 8 | + |
| 9 | +## Key Features |
| 10 | + |
| 11 | +* **EVPN Standards Support:** |
| 12 | + * RFC 7432: BGP MPLS-Based Ethernet VPN |
| 13 | + * RFC 8365: Network Virtualization Overlay |
| 14 | + * RFC 7988: Ingress Replication Tunnels in Multicast VPN |
| 15 | + * RFC 9135: Integrated Routing and Bridging in Ethernet VPN |
| 16 | + * RFC 9136: IP Prefix Advertisement in Ethernet VPN |
| 17 | +* **Hardware Integration:** Interaction with the hardware switch and routers via EVPN |
| 18 | +* **GoBGP Integration:** Interaction with the gobgpd daemon to pull or push EVPN annouces |
| 19 | +* **OpenvSwitch Management:** Direct management of bridges and flows within the OpenvSwitch system |
| 20 | +* **Reconciliation Loop Design:** Built on a closed-loop control architecture to ensure fault tolerance and reduce the impact of external factors |
| 21 | +* **Configurability:** Flexible setup via INI daemon configuration files and JSON clients configuration files |
| 22 | + |
| 23 | +## Documentation |
| 24 | +The details of the EVPN's operation and evpn-connector daemon workflow are described in the [presentation](https://vkvideo.ru/video-164978780_456239752) (in Russian only). |
| 25 | + |
| 26 | +## Installation & Quick Start |
| 27 | + |
| 28 | +### Prerequisites |
| 29 | + |
| 30 | +* **Python 3.8 |
| 31 | +* **System Dependencies:** |
| 32 | + * `gobgp` (for interaction via BGP within the EVPN control plane) |
| 33 | + * `openvswitch-switch` (for interaction via VXLAN within the EVPN data plane) |
| 34 | +* **Permissions:** Requires `root` privileges for interaction with OpenvSwitch |
| 35 | + |
| 36 | + |
| 37 | +1. **Install dependencies:** |
| 38 | + |
| 39 | + On Ubuntu/Debian: |
| 40 | + ```bash |
| 41 | + sudo apt update |
| 42 | + sudo apt install openvswitch-switch openvswitch-common gobgpd |
| 43 | + ``` |
| 44 | + On CentOS/RHEL: |
| 45 | + ```bash |
| 46 | + sudo yum install gobgp openvswitch |
| 47 | + # or for newer versions: |
| 48 | + # sudo dnf install gobgp openvswitch |
| 49 | + ``` |
| 50 | +2. **(Optional) Install latest GoBGP from binary release:** |
| 51 | + ```bash |
| 52 | + wget https://github.com/osrg/gobgp/releases/download/v3.34.0/gobgp_3.34.0_linux_amd64.tar.gz |
| 53 | + mkdir gobgp |
| 54 | + tar -xf gobgp_3.34.0_linux_amd64.tar.gz -C gobgp/ |
| 55 | + ``` |
| 56 | +3. **(Recommended) Create a virtual environment:** |
| 57 | + Recommended installation gobgp versions >= v3.34 |
| 58 | + ```bash |
| 59 | + python3 -m venv evpn |
| 60 | + source evpn/bin/activate |
| 61 | + pip install --upgrade pip setuptools |
| 62 | + ``` |
| 63 | +4. **Install evpn-connector:** |
| 64 | + ```bash |
| 65 | + pip install evpn-connector |
| 66 | + ``` |
| 67 | +### Configuration |
| 68 | + |
| 69 | +Before the first run, you need to create a configuration file. |
| 70 | + |
| 71 | +1. **GoBGP config:** Copy the example configuration file and adapt it to your environment. |
| 72 | + ```bash |
| 73 | + cp etc/gobgpd/gobgp.conf.sample /etc/gobgpd/gobgp.conf |
| 74 | + ``` |
| 75 | + It is necessary to configure gobgp so that all nodes can exchange announces with afi-safi **"l2evpn-evpn"** |
| 76 | + |
| 77 | +2. **evpn-connector config:** Copy the example configuration file and adapt it to your environment. |
| 78 | + ```bash |
| 79 | + mkdir /etc/evpn_connector/ |
| 80 | + cp etc/evpn_connector/logging.yaml /etc/evpn_connector/logging.yaml |
| 81 | + cp etc/evpn_connector/evpn_connector.cfg.sample /etc/evpn_connector/evpn_connector.conf |
| 82 | + ``` |
| 83 | +3. **Edit `/etc/evpn_connector/evpn_connector.conf`:** Specify the necessary parameters: |
| 84 | + * `[gobgp] section`: Settings for connecting to the GoBGP daemon |
| 85 | + * `[gobgp] source_ip`: Source IP address for all VXLAN packets |
| 86 | + * `[ovs] section`: Settings for OpenvSwitch dataplane parameters |
| 87 | + * `[ovs] switch_name`: Name of switch created in OvS |
| 88 | + * `[daemon] section`: Settings for evpn_connector daemon |
| 89 | + * `[daemon] configs_dir`: Path to client configs |
| 90 | + |
| 91 | +4. **Client configs:** Create clients configs. Example config: |
| 92 | + * For L2 connectivity |
| 93 | + ```json |
| 94 | + { |
| 95 | + "cfg_type": "l2", // Config type for L2 connectivity use "l2" |
| 96 | + "mac": "36:e7:a5:7e:0c:81", // MAC address of client |
| 97 | + "ip": "10.0.0.1", // IP address of client |
| 98 | + "vni": 10, // VXLAN segment identifier |
| 99 | + "ofport": 1000, // OpenFlow port number in current OpenvSwitch switch |
| 100 | + "type": "flat", // OpenvSwitch port type. May be "flat" and "vlan" |
| 101 | + "tag": 0, // OpenvSwitch port segment identifier. Ignored on "flat" |
| 102 | + "imp_rt": ["65000:10"], // List of imported BGP Route Targets |
| 103 | + "exp_rt": ["65000:10"] // List of exported BGP Route Targets |
| 104 | + } |
| 105 | + ``` |
| 106 | + * For L3 connectivity |
| 107 | + ```json |
| 108 | + { |
| 109 | + "cfg_type": "l3", // Config type for L3 connectivity use "l3" |
| 110 | + "mac": "36:e7:a5:7e:0c:81", // MAC address of client |
| 111 | + "routes": ["10.0.0.1/32"], // List of CIDR prefixes for this client |
| 112 | + "vni": 10, // VXLAN segment identifier |
| 113 | + "ofport": 1000, // OpenFlow port number in current OpenvSwitch switch |
| 114 | + "type": "flat", // OpenvSwitch port type. May be "flat" and "vlan" |
| 115 | + "tag": 0, // OpenvSwitch port segment identifier. Ignored on "flat" |
| 116 | + "imp_rt": ["65000:10"], // List of imported BGP Route Targets |
| 117 | + "exp_rt": ["65000:10"] // List of exported BGP Route Targets |
| 118 | + } |
| 119 | + ``` |
| 120 | + Need create json config for all clients in **configs_dir** |
| 121 | + ```bash |
| 122 | + mkdir /var/lib/evpn_connector/client_configs/ |
| 123 | + vim /var/lib/evpn_connector/client_configs/vm1.json |
| 124 | + ``` |
| 125 | +### Running the Service |
| 126 | + |
| 127 | +Start the service by specifying the path to your configuration file: |
| 128 | + |
| 129 | +1. **Run GoBGP:** |
| 130 | + ```bash |
| 131 | + sudo gobgpd -f /etc/gobgpd/gobgp.conf |
| 132 | + ``` |
| 133 | +2. **Run evpn-connector** |
| 134 | + ```bash |
| 135 | + source evpn/bin/activate |
| 136 | + evpn-connector --config-file ~/evpn/config/evpn_connector.cfg --daemon-configs_dir "/var/lib/evpn_connector/client_configs/" |
| 137 | + ``` |
0 commit comments