{"id":16139396,"url":"https://github.com/networkop/cloudroutesync","last_synced_at":"2025-07-17T18:04:08.304Z","repository":{"id":228833418,"uuid":"301168581","full_name":"networkop/cloudroutesync","owner":"networkop","description":"Sync netlink routes with your cloud routing table","archived":false,"fork":false,"pushed_at":"2020-10-13T17:35:44.000Z","size":9269,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-12T23:45:06.517Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/networkop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-10-04T16:00:34.000Z","updated_at":"2023-06-03T16:38:00.000Z","dependencies_parsed_at":"2024-03-20T18:04:40.374Z","dependency_job_id":"b6e98d8b-326b-46d9-a989-4f9f6491f9c4","html_url":"https://github.com/networkop/cloudroutesync","commit_stats":null,"previous_names":["networkop/cloudroutesync"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Fcloudroutesync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Fcloudroutesync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Fcloudroutesync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/networkop%2Fcloudroutesync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/networkop","download_url":"https://codeload.github.com/networkop/cloudroutesync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247526675,"owners_count":20953141,"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":[],"created_at":"2024-10-09T23:48:55.982Z","updated_at":"2025-04-06T17:43:16.656Z","avatar_url":"https://github.com/networkop.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cloudroutesync\nAn add-on for cloud-hosted routers that reads local routes via [rtnetlink](https://man7.org/linux/man-pages/man7/rtnetlink.7.html) and synchronizes them with a cloud routing table.\n\n![](./image.png)\n\nThe main use cases are:\n\n* Overlay-free self-managed Kuberentes clusters in the cloud - you can run BGP to establish reachability between PodCIDRs (e.g. KubeRouter, Calico)\n* Multi/Hybrid cloud - sync local route table with subnets configured in a different environments (on-prem, another cloud).\n\n\u003e Note: The application relies on another routing daemon to program local netlink routes. This can be [FRR](http://docs.frrouting.org/en/latest/), [Quagga](https://www.nongnu.org/quagga/docs/quagga.html), [Bird](https://bird.network.cz/) or any other routing software suite.\n\n## Currently Supported Clouds\n\n* AWS\n* Azure\n* GCP*\n* Openstack (maybe)\n\n\u003e Due to limitations of GCP's networking stack, the only supported mode is syncronization of routes received from outside of the local subnet. These routes will be set with nextHop of the router VM running cloudroutesync.\n\n## Prerequisites\n\nThe application must be running on a cloud VM with enough IAM permissions to create/update cloud route table.\n\nFor example, in AWS this would require:\n\n* Create/Delete RouteTable\n* Associate/Deassociate RouteTables \n* Create/Delete Routes\n* Create/Delete Tags\n* Describe NetworkInterfaces and Instances\n\nIn addition to that, any VM that needs to send packets not natively known to the cloud SDN, need to have IP source check disabled.\n\nSee Terraform [directory](./terraform) for examples for:\n\n* [AWS](./terraform/aws/main.tf)\n* [Azure](./terraform/azure/main.tf)\n* [GCP](./terraform/gcp/main.tf)\n\n## Installation\n\nTo build a binary:\n\n```\ngo get -v github.com/networkop/cloudroutesync\n```\n\nAlternatively, it is available as a docker image at `networkop/cloudroutesync`.\n\n## Usage\n\n```\nUsage of ./cloudroutesync:\n  -cleanup\n    \tcleanup any created objects\n  -cloud string\n    \tpublic cloud providers [azure|aws|gcp]\n  -debug\n    \tenable debug logging\n  -event\n    \tenable event-based sync (default is periodic, controlled by 'sync')\n  -netlink int\n    \tnetlink polling interval in seconds (default 10)\n  -sync int\n    \tcloud routing table sync interval in seconds (default 10)\n```\n\nIt can run in two modes:\n\n* Event-driven mode - cloud route table is only updated whenever there was a change detected in the netlink routing table. This mode is enabled with a `-event` flag.\n\n* Periodic mode (default) - cloud route table is synced periodically based on the interval defined in the `-sync` flag.\n\n## Demo\n\nDemonstration can be done using any of the supported providers from the terraform [directory](./terraform).\nHere we'll use AWS as an example.\n\n1. Spin up a test environment with two VMs\n\n```\ncd ./terraform/aws\nterraform init \u0026\u0026 terraform apply -auto-approve\n\n```\n\n3. SSH into both VMs and bring up the demo application.\n\nRouter VM will run both the FRR and the `cloudroutesync`:\n\n```\nrouter_ip=$(terraform output -json | jq -r '.public_address_router.value[0]')\nssh ubuntu@$router_ip\nubuntu@ip-10-0-1-31:~$ sudo CLOUD=aws docker-compose up -d\n```\n\nSecond, non-router VM will run only the FRR container:\n\n```\nvm_ip=$(terraform output -json | jq -r '.public_address_vm.value[0]')\nssh ubuntu@$vm_ip\nubuntu@ip-10-0-1-195:~$ sudo docker-compose up -d frr\n```\n\n3. From a non-router VM and configure a BGP peering towards the cloud router (replace 10.0.1.31 with the private IP of the router VM)\n\n```\nubuntu@ip-10-0-1-195:~$ sudo docker-compose exec frr vtysh\nconf\nrouter bgp \nneighbor 10.0.1.31 peer-group PEERS\n```\n\n4. From the same VM configure a new loopback IP and redistribute it into BGP\n\n```\ninterface lo\nip address 198.51.100.100/32\n!\nrouter bgp \nredistribute connected\n```\n\n\n5. From a non-router VM start a ping towards router VM sourced from the new interface (replace 10.0.1.31 with the private IP of the router VM)\n\n```\nubuntu@ip-10-0-1-195:~$ ping 10.0.1.31 -I 198.51.100.100\n```\n\n6. From a router VM observe the logs of the `cloudroutesync` service:\n\n```\nubuntu@ip-10-0-1-31:~$ sudo docker-compose logs crs\ncrs_1  | time=\"2020-10-12T21:11:08Z\" level=info msg=\"Starting Virtual Cloud Router\"\ncrs_1  | time=\"2020-10-12T21:11:08Z\" level=info msg=\"Running on AWS\"\ncrs_1  | time=\"2020-10-12T21:11:08Z\" level=info msg=\"Checking routing table\"\ncrs_1  | time=\"2020-10-12T21:11:19Z\" level=info msg=\"Checking routing table\"\ncrs_1  | time=\"2020-10-12T21:11:29Z\" level=info msg=\"Checking routing table\"\ncrs_1  | time=\"2020-10-12T21:11:39Z\" level=info msg=\"Checking routing table\"\ncrs_1  | time=\"2020-10-12T21:11:39Z\" level=info msg=\"Route change detected\"\ncrs_1  | time=\"2020-10-12T21:11:39Z\" level=info msg=\"Creating route 198.51.100.100/32 in rtb-007864623346bee20\"\ncrs_1  | time=\"2020-10-12T21:11:49Z\" level=info msg=\"Checking routing table\"\n```\n\n7. Observe how route table gets populated with the new prefix.\n\nThe ping from step #5 should now receive responses.\n\n\n8. At the end of the test, to cleanup any leftover state like route tables and their association run:\n\n```\ncloudroutesync -cloud aws cleanup\nINFO[0000] Starting Virtual Cloud Router                \nINFO[0000] Running on AWS                               \nINFO[0000] Deleting own route table      \n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworkop%2Fcloudroutesync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetworkop%2Fcloudroutesync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetworkop%2Fcloudroutesync/lists"}