Skip to content

Commit b0b6755

Browse files
committed
document hostBGP subnets and container
Signed-off-by: Emanuele Di Pascale <emanuele@githedgehog.com>
1 parent 5d2e048 commit b0b6755

2 files changed

Lines changed: 67 additions & 2 deletions

File tree

docs/user-guide/host-settings.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,48 @@ kubectl fabric vpc attach --vpc-subnet vpc-2/default --connection server-1--leaf
9595

9696
[bonding]: https://www.kernel.org/doc/html/latest/networking/bonding.html
9797

98+
## HostBGP container
99+
100+
If using [HostBGP subnets](vpcs.md#hostbgp-subnets), BGP should be running on the host server and
101+
an appropriate configuration should be applied. To facilitate these steps, Hedgehog provides a
102+
docker container which automatically starts [FRR](https://docs.frrouting.org/en/latest/) with
103+
a valid configuration to join the Fabric.
104+
105+
As a first step, users should download the docker image from our registry:
106+
```bash
107+
docker pull ghcr.io/githedgehog/host-bgp:v0.1.1
108+
```
109+
110+
The container should then be run with host networking (so that FRR can communicate with the leaves
111+
using the host's interfaces) and in privileged mode. Additionally, a few input parameters are required:
112+
113+
- an optional ASN to use for BGP - if not specified the container will use ASN 64999;
114+
- a comma-separated list of interfaces over which to establish unnumbered BGP sessions with leaves;
115+
- a space-separated list of Virtual IPs (or VIPs) to be advertised to the leaves; these should have
116+
a prefix length of /32 and be part of the subnet the host is attaching to.
117+
118+
As an example, the command might look something like this:
119+
```bash
120+
docker run --network=host --privileged --rm --detach --name hostbgp ghcr.io/githedgehog/host-bgp:v0.1.1 enp2s1,enp2s2 10.100.34.5/32
121+
```
122+
123+
With the above command, BGP sessions would be created on interfaces `enp2s1` and `enp2s2`,
124+
using ASN 64999 (the default), the address `10.100.34.5/32` will be configured on the loopback of
125+
the host server and it will be advertised to the leaves.
126+
127+
To further modify the configuration or to troubleshoot the state of the system, an
128+
expert user can invoke the FRR CLI using the following command:
129+
```bash
130+
docker exec -it hostbgp vtysh
131+
```
132+
133+
To stop the container, just run the following command:
134+
```bash
135+
docker stop -t 1 hostbgp
136+
```
137+
138+
Note that stopping the docker container does not currently remove the VIPs from the loopback.
139+
If needed, they can be removed manually, for example using iproute2:
140+
```bash
141+
sudo ip address delete dev lo <VIP>
142+
```

docs/user-guide/vpcs.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ spec:
5656
subnet: 10.10.100.0/24
5757
vlan: 1100
5858
59+
bgp-on-host: # Another subnet with hosts peering with leaves via BGP
60+
subnet: 10.10.50.0/25
61+
hostBGP: true
62+
5963
permit: # Defines which subnets of the current VPC can communicate to each other, applied on top of subnets "isolated" flag (doesn't affect VPC peering)
6064
- [subnet-1, subnet-2, subnet-3] # 1, 2 and 3 subnets can communicate to each other
6165
- [subnet-4, subnet-5] # Possible to define multiple lists
@@ -108,6 +112,24 @@ packet:
108112
Fabric and will be in `VrfV<VPC-name>` format, for example `VrfVvpc-1` for a VPC named `vpc-1` in the Fabric API.
109113
* _CircuitID_ (suboption 1) identifies the VLAN which, together with the VRF (VPC) name, maps to a specific VPC subnet.
110114

115+
### HostBGP subnets
116+
117+
At times, it is useful to have BGP running directly on the host and peering with the Fabric: one such case is
118+
to support active-active multi-homed servers, or simply to have redundancy when other techniques such
119+
as MCLAG or ESLAG are not available, for example because of hardware limitations.
120+
121+
Consider this scenario: `server-1` is connected to two different Fabric switches `sw-1` and `sw-2`, and attached to
122+
`vpc-1/subnet-1` on both of them. This subnet is configured as `hostBGP`; the switches will be configured to peer with
123+
`server-1` using unnumbered BGP (IPv4 unicast address family), only importing /32 prefixes in the subnet of the VPC and
124+
exporting routes learned from other VPC peers. Similarly, BGP is running on `server-1`, unnumbered BGP sessions are
125+
established with each leaf, and one or more Virtual IPs (VIPs) in the VPC subnet are advertised. With this setup, the
126+
host is part of the VPC and can be reached via one of the advertised VIPs from either link to the Fabric.
127+
128+
It is important to keep in mind that Hedgehog Fabric does not directly operate the host servers attached to it;
129+
running subnets in HostBGP mode requires running a routing suite and configuring it accordingly. To facilitate this
130+
process, however, we do provide a container image which can autogenerate a valid configuration, given some input parameters.
131+
For more details, see [the related section in the Host Settings page](host-settings.md#hostbgp-container).
132+
111133
## VPCAttachment
112134

113135
A VPCAttachment represents a specific VPC subnet assignment to the `Connection` object which means a binding between an
@@ -279,5 +301,3 @@ user@server ~$ ip route
279301
10.10.0.1/24 via 10.10.0.1 dev enp2s1.1000 proto dhcp src 10.10.0.4 metric 1024 # Route for VPC subnet gateway
280302
10.10.0.1 dev enp2s1.1000 proto dhcp scope link src 10.10.0.4 metric 1024
281303
```
282-
283-

0 commit comments

Comments
 (0)