{"id":18538674,"url":"https://github.com/katharaframework/networkplugin","last_synced_at":"2025-04-09T17:37:35.529Z","repository":{"id":42466319,"uuid":"237041123","full_name":"KatharaFramework/NetworkPlugin","owner":"KatharaFramework","description":"Docker Network Plugin used by Kathará to create pure L2 networks.","archived":false,"fork":false,"pushed_at":"2025-02-27T15:59:17.000Z","size":128,"stargazers_count":20,"open_issues_count":0,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-24T09:46:56.698Z","etag":null,"topics":["docker","docker-network-plugin","docker-networking","kathara","l2-net","linux-bridge","vde"],"latest_commit_sha":null,"homepage":"https://www.kathara.org/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KatharaFramework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-29T17:23:01.000Z","updated_at":"2025-03-09T11:57:12.000Z","dependencies_parsed_at":"2024-04-08T17:41:27.234Z","dependency_job_id":"4264db97-45f3-4ca9-9de8-dc419b121a29","html_url":"https://github.com/KatharaFramework/NetworkPlugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KatharaFramework%2FNetworkPlugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KatharaFramework%2FNetworkPlugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KatharaFramework%2FNetworkPlugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KatharaFramework%2FNetworkPlugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KatharaFramework","download_url":"https://codeload.github.com/KatharaFramework/NetworkPlugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248078440,"owners_count":21044105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-network-plugin","docker-networking","kathara","l2-net","linux-bridge","vde"],"created_at":"2024-11-06T19:44:40.758Z","updated_at":"2025-04-09T17:37:35.188Z","avatar_url":"https://github.com/KatharaFramework.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kathará Network Plugin\n\nThis repository contains the source code for the Docker Network Plugin used by Kathará.\n\nThe plugin has two different versions, which are divided in the two main folders:\n- [`vde`](/vde/): creates pure L2 LANs using VDE (Virtual Distributed Ethernet) software switches and tap interfaces (which is built using the `kathara/katharanp_vde` tag).\n- [`bridge`](/bridge/) (legacy): creates pure L2 LANs using Linux bridges and veth pairs (which is built using the `kathara/katharanp` tag).\n\n## Build from source\n\nThe plugin is compiled and released for both `amd64` and `arm64` architectures. The tag of the plugin identifies the architecture.\n\nTo build both the plugin versions, type on terminal (in the root of the project):\n```\n$ make all_\u003carch\u003e\n```\n\nWhere `\u003carch\u003e` can be: `amd64` or `arm64`.\n\n**NOTE**: since the `vde` version relies on C code, you can only build the Docker plugin for your target architecture! \n\nYou can also build only a specific version of the plugin by entering its directory, for example:\n```\n$ cd vde \u0026\u0026 make all_\u003carch\u003e\n```\n\nThe build process leverages on Docker, so you don't need any dependencies installed in your machine.\n\n## Use the Plugin without Kathará\n\nIt is possible to leverage on this plugin as a standalone Docker Network Plugin, in order to create pure L2 networks. Please check the `README` of each version (inside the corresponding folder) for specific information.\n\n### Assign MAC Addresses to network interfaces\n\n`katharanp` supports two different ways to assign a MAC Address to a network interface:\n- Pass a specific MAC Address, this can be achieved by leveraging the `kathara.mac_addr` driver option while connecting a container to a network:\n```bash\ndocker network connect --driver-opt kathara.mac_addr=aa:bb:cc:dd:ee:ff l2net container\n```\n- Compute a deterministic MAC Address using the container name and the interface index, this can be done with the `kathara.machine` and `kathara.iface` driver options (they are required together):\n```bash\ndocker network connect --driver-opt kathara.machine=container --driver-opt kathara.iface=1 l2net container\n```\n\nThe formula to compute the MAC address is the following:\n1. Join the two strings, separating the two values by a dash, e.g., `container-1`\n2. Compute the MD5 of the resulting string: `b588c219865f6fe336908e5991216b13`\n3. Take the first 6 hex bytes of the string, starting from the left: `b588c219865f` -\u003e `b5:88:c2:19:86:5f`\n4. Clean the first byte to obtain a locally administered unicast MAC Address: `0xb5 | 0x02 = 0xb7 \u0026 0xfe = 0xb6`\n5. The resulting MAC Address is: `b6:88:c2:19:86:5f`\n\nExample output from the container:\n```bash\nroot@584e403aec5a:/# ifconfig eth1\neth1: flags=4163\u003cUP,BROADCAST,RUNNING,MULTICAST\u003e  mtu 1500\n        ether b6:88:c2:19:86:5f  txqueuelen 1000  (Ethernet)\n        RX packets 8  bytes 736 (736.0 B)\n        RX errors 0  dropped 0  overruns 0  frame 0\n        TX packets 0  bytes 0 (0.0 B)\n        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatharaframework%2Fnetworkplugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkatharaframework%2Fnetworkplugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkatharaframework%2Fnetworkplugin/lists"}