Skip to content

Commit ea86a75

Browse files
committed
add documentation for static externals
Signed-off-by: Emanuele Di Pascale <emanuele@githedgehog.com>
1 parent 5d2e048 commit ea86a75

5 files changed

Lines changed: 131 additions & 54 deletions

File tree

docs/user-guide/connections.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ Internet, to other networks, or to some other systems such as DHCP, NTP, LMA, or
213213

214214
### StaticExternal
215215

216+
!!! note
217+
`StaticExternal` connections are deprecated; please consider using [static Externals](external.md#static-externals) instead.
218+
216219
`StaticExternal` connections provide a simple way to connect things like DHCP servers directly to the Fabric by connecting
217220
them to specific switch ports.
218221

@@ -249,8 +252,9 @@ spec:
249252

250253
### External
251254

252-
Connection to external systems, such as edge/provider routers using BGP peering and configuring Inbound/Outbound
253-
communities as well as granularly controlling what gets advertised and which routes are accepted.
255+
Connection to [external systems](external.md). These could be edge/provider routers using BGP peering
256+
and Inbound/Outbound communities for dynamic learning of reachable prefixes, or simpler edge devices
257+
connected to the Fabric using static routes.
254258

255259
```yaml
256260
apiVersion: wiring.githedgehog.com/v1beta1

docs/user-guide/dhcp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,4 +266,4 @@ spec:
266266
```
267267

268268
!!! note "External DHCP Server Access"
269-
The external DHCP server must be reachable from the fabric. Use a [StaticExternal connection](connections.md#staticexternal) to provide connectivity to the DHCP server.
269+
The external DHCP server must be reachable from the fabric. Use [static Externals](external.md#static-externals) to provide connectivity to the DHCP server.

docs/user-guide/external.md

Lines changed: 114 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# External Peering
22

3-
Hedgehog Fabric uses the Border Leaf concept to exchange VPC routes outside the Fabric and provide L3 connectivity. The
4-
`External Peering` feature allows you to set up an external peering endpoint and to enforce several policies between
5-
internal and external endpoints.
3+
A Border Leaf can be used to exchange VPC routes with external systems. The `External Peering` feature in Hedgehog Fabric
4+
allows users to set up an external peering endpoint and to enforce policies between internal and external endpoints.
5+
Alternatively, the Hedgehog Gateway can be used to provide connectivity via an endpoint directly connected to a Border Leaf.
66

77
!!! note
88
Hedgehog Fabric does not operate Edge side devices.
@@ -16,26 +16,35 @@ Border Leaves (or Borders) can connect to several Edge devices.
1616
!!! note
1717
External Peering is only available on the switch devices that are capable for sub-interfaces.
1818

19-
### Connect Border Leaf to Edge device
19+
Hedgehog Fabric supports both BGP-speaking and static externals.
2020

21-
In order to distinguish VPC traffic, an Edge device should be able to:
21+
### Connect a Border Leaf to an Edge device
2222

23+
To separate VPC traffic, the Edge device is typically connected to a Border Leaf using a VLAN.
24+
Additionally, if using the BGP speaker model for external peering, the Edge device should also be capable of:
2325

24-
- Set up BGP IPv4 to advertise and receive routes from the Fabric
25-
- Connect to a Fabric Border Leaf over VLAN
26-
- Be able to mark egress routes towards the Fabric with BGP Communities
27-
- Be able to filter ingress routes from the Fabric by BGP Communities
26+
- Setting up BGP IPv4 to advertise and receive routes from the Fabric
27+
- Marking egress routes towards the Fabric with BGP Communities
28+
- Filtering ingress routes from the Fabric by BGP Communities
2829

2930
All other filtering and processing of L3 Routed Fabric traffic should be done on the Edge devices.
3031

3132
### Control Plane
3233

33-
The Fabric shares VPC routes with Edge devices via BGP. Peering is done over VLAN in IPv4 Unicast AFI/SAFI.
34+
For BGP externals, the Hedgehog Fabric shares VPC routes with Edge devices via BGP; peering is done over VLAN in IPv4 Unicast AFI/SAFI.
35+
36+
For static externals, static routes for the listed prefixes are installed in a VRF associated with the external
37+
in the border leaf. These routes can be exposed to VPCs either via route leaking on the border leaf itself or
38+
via the Hedgehog Gateway, which adds support for more advanced features such as source NAT. When using the Gateway,
39+
Proxy ARP is configured on the border leaf to emulate a direct connection between the external and the Gateway.
3440

3541
### Data Plane
3642

37-
VPC L3 routable traffic will be tagged with VLAN and sent to Edge device. Later processing of VPC traffic
38-
(NAT, PBR, etc) should happen on Edge devices.
43+
For BGP and non-proxied static externals, VPC L3 routable traffic will be tagged with VLAN at a Border Leaf and sent to the Edge device.
44+
Later processing of VPC traffic (NAT, PBR, etc) should happen on Edge devices.
45+
46+
For proxied static externals, traffic will first go through the Gateway, where it will be NATed using one of the assigned IPs.
47+
It will then be forwarded to a Border Leaf, where it will be VLAN tagged and forwarded to the Edge device.
3948

4049
### VPC access to Edge device
4150

@@ -44,13 +53,35 @@ the VPC can export to Edge devices and import from the Edge devices.
4453

4554
## API and implementation
4655

47-
### External
56+
### Connection
57+
58+
A `Connection` of type `external` is used to identify the switch port on Border Leaf that is cabled with an Edge device.
59+
60+
```yaml
61+
apiVersion: wiring.githedgehog.com/v1beta1
62+
kind: Connection
63+
metadata:
64+
name: # specified or generated
65+
spec:
66+
external:
67+
link:
68+
switch:
69+
port: ds3000/E1/1
70+
```
4871
49-
General configuration starts with the specification of `External` objects. Each object of `External` type can represent
50-
a set of Edge devices, or a single BGP instance on Edge device, or any other united Edge entities that can be described
51-
with the following configuration:
72+
A `Connection` object can be used with both BGP-speaking and static `Externals`.
5273

53-
- Name of `External`
74+
### BGP-speaking Externals
75+
76+
General configuration starts with the specification of `External` objects. In this section we will introduce the
77+
BGP-speaking externals and their attachments.
78+
79+
#### BGP-speaking External object
80+
81+
Each object of `External` type can represent a set of Edge devices, or a single BGP instance on Edge device, or
82+
any other united Edge entities that can be described with the following configuration:
83+
84+
- Name of the `External`
5485
- Inbound routes marked with the dedicated BGP community
5586
- Outbound routes marked with the dedicated community
5687

@@ -67,25 +98,9 @@ spec:
6798
outboundCommunity: # BGP Standard Community required to be assigned on prefixes advertised from Fabric
6899
```
69100

70-
### Connection
71-
72-
A `Connection` of type `external` is used to identify the switch port on Border leaf that is cabled with an Edge device.
101+
#### BGP-speaking External Attachment object
73102

74-
```yaml
75-
apiVersion: wiring.githedgehog.com/v1beta1
76-
kind: Connection
77-
metadata:
78-
name: # specified or generated
79-
spec:
80-
external:
81-
link:
82-
switch:
83-
port: ds3000/E1/1
84-
```
85-
86-
### External Attachment
87-
88-
`External Attachment` defines BGP Peering and traffic connectivity between a Border leaf and `External`. Attachments are
103+
An `External Attachment` defines BGP Peering and traffic connectivity between a Border Leaf and `External`. Attachments are
89104
bound to a `Connection` with type `external` and they specify an optional `vlan` that will be used to segregate
90105
particular Edge peering.
91106

@@ -107,10 +122,67 @@ spec:
107122

108123
Several `External Attachment` can be configured for the same `Connection` but for different `vlan`.
109124

125+
### Static Externals
126+
127+
If the edge device cannot run BGP and the reachable prefixes are known in advance, static externals can be used instead.
128+
As far as the Edge device is concerned, traffic from the Fabric should come from a directly connected
129+
device or set of devices on the same subnet as itself.
130+
131+
#### Static External object
132+
133+
A static `External` uses the same base CRD of the BGP-speaking case, but it does away with
134+
BGP communities. However, the `External` should provide a list of prefixes that are reachable
135+
via itself, as there is no routing protocol to dynamically learn them from.
136+
137+
Like its BGP-speaking counterpart, a static `External` should be bound to an IPv4 namespace to avoid prefix overlaps.
138+
139+
```yaml
140+
apiVersion: vpc.githedgehog.com/v1beta1
141+
kind: External
142+
metadata:
143+
name: ###
144+
spec:
145+
ipv4Namespace: # VPC IP Namespace
146+
static:
147+
prefixes:
148+
- # one or more prefixes that are reachable via the Edge device
149+
```
150+
151+
#### Static External Attachment object
152+
153+
The same `External Attachment` object we saw previously is used for static externals; like for `Externals`, fields specific
154+
to BGP-speaking attachments will be left empty, and some additional configuration is required. Specifically, we need:
155+
156+
- the remote IP address of the external, which is used as next hop for traffic forwarded to the Edge device;
157+
- an optional VLAN to segregate traffic on the external connection, or `0` for untagged traffic;
158+
- a `proxy` flag, which should be set to `true` if the user intends to peer VPCs with the external using the Hedgehog Gateway;
159+
- the IP address to be configured on the border leaf side of the link, when the `proxy` flag is not set; it should be empty otherwise.
160+
161+
```yaml
162+
apiVersion: vpc.githedgehog.com/v1beta1
163+
kind: ExternalAttachment
164+
metadata:
165+
name: ###
166+
spec:
167+
connection: # Name of the Connection with type external
168+
external: # Name of the External this attachment refers to
169+
static:
170+
remoteIP: # IP address of the Edge device port connected to the Border Leaf
171+
vlan: # VLAN (optional) ID to tag control and data traffic, use 0 for untagged
172+
proxy: # Flag to enable proxy-ARP, used in conjunction with Gateway peering
173+
ip: # IP address (with prefix length) to be configured on the switch when not using Proxy mode, empty otherwise
174+
```
175+
110176
### External VPC Peering
111177

112-
To allow a specific VPC to have access to Edge devices, bind the VPC to a specific `External` object. To do so, define
113-
an `External Peering` object.
178+
To allow a specific VPC to have access to prefixes reachable via an Edge device, bind the VPC to the corresponding
179+
`External` by creating an `External Peering` object.
180+
181+
!!! note
182+
External VPC Peering via this Fabric object is only supported for BGP-speaking externals or
183+
static externals without proxy ARP. For the proxied static external use case, or whenever NAT
184+
is required to access the target prefixes, Gateway peering should be used instead: see
185+
[Gateway Peering for External Connections](gateway.md#gateway-peering-for-external-connections).
114186

115187
```yaml
116188
apiVersion: vpc.githedgehog.com/v1beta1
@@ -134,7 +206,7 @@ spec:
134206
equal to 32, effectively permitting all prefixes within the specified one. Use `0.0.0.0/0` for any route, including the
135207
default route.
136208

137-
This example allows _any_ IPv4 prefix that came from `External`:
209+
The following example allows _any_ IPv4 prefix learned from the `External`:
138210

139211
```yaml
140212
spec:
@@ -145,7 +217,7 @@ spec:
145217
- prefix: 0.0.0.0/0 # Any route will be allowed including default route
146218
```
147219

148-
This example allows all prefixes that match the default route, with any prefix length:
220+
The following example only allows routes in the `77.0.0.0/8` prefix, with any prefix length:
149221

150222
```yaml
151223
spec:
@@ -158,13 +230,13 @@ spec:
158230

159231
## Examples
160232

161-
This example shows how to peer with the `External` object with name `HedgeEdge`, given a Fabric VPC with name `vpc-1` on
233+
This example shows how to peer with the BGP-speaking `External` object with name `HedgeEdge`, given a Fabric VPC with name `vpc-1` on
162234
the Border Leaf `switchBorder` that has a cable connecting it to an Edge device
163235
on the port `E1/2`. Specifying `vpc-1` is required to receive any prefixes advertised from the `External`.
164236

165237
### Fabric API configuration
166238

167-
#### External
239+
#### BGP-speaking External
168240

169241
```console
170242
# kubectl fabric external create --name hedgeedge --ipns default --in 65102:5000 --out 5000:65102
@@ -207,7 +279,7 @@ spec:
207279
port: switchBorder/E1/2
208280
```
209281

210-
#### ExternalAttachment
282+
#### BGP-speaking ExternalAttachment
211283

212284
Specified in `wiring` diagram
213285

docs/user-guide/vpcs.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ spec:
4848
4949
thrird-party-dhcp: # Another subnet
5050
dhcp:
51-
relay: 10.99.0.100/24 # Use third-party DHCP server (DHCP relay configuration), access to it could be enabled using StaticExternal connection
51+
relay: 10.99.0.100/24 # Use third-party DHCP server (DHCP relay configuration), access to it could be enabled using a static External
5252
subnet: "10.10.2.0/24"
5353
vlan: 1002
5454
@@ -279,5 +279,3 @@ user@server ~$ ip route
279279
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
280280
10.10.0.1 dev enp2s1.1000 proto dhcp scope link src 10.10.0.4 metric 1024
281281
```
282-
283-

docs/vlab/virt-externals.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
VLAB also supports virtual [externals](../user-guide/external.md). These are implemented using
44
a virtual machine running [FRR](https://frrouting.org/), which is automatically configured
5-
from the topology information to behave like one or more BGP instances advertising a default
6-
route towards the internet (assuming the host running the VLAB is connected to the internet).
5+
from the topology information. In the case of BGP-speaking externals, this means running one or
6+
more BGP instances advertising a default route towards the internet (assuming the host running
7+
the VLAB is connected to the internet). For static externals, there will be just a direct connection
8+
to an endpoint connected to the internet, with the appropriate static routes configured on the
9+
endpoint to ensure that forwarding will work correctly.
710

8-
Here we will explain how to generate a topology with a virtual external, and how to test it
11+
Here we will explain how to generate a topology with a BGP-speaking virtual external, and how to test it
912
using either Fabric or Gateway external peerings.
1013

1114
## Creating the topology
@@ -22,7 +25,7 @@ a mesh one.
2225
This limitation does not apply to physical switches.
2326

2427
The example below shows how to initialize and generate a spine-leaf topology with two
25-
ESLAG leaves, one orphan leaf with a virtual external attached to it, and a gateway
28+
ESLAG leaves, one orphan leaf with a virtual BGP-speaking external attached to it, and a gateway
2629
attached to the two spines:
2730

2831
```
@@ -31,7 +34,7 @@ ubuntu@docs:~/hhfab$ ./hhfab init -f --dev --gw
3134
09:27:35 INF Generated initial config
3235
09:27:35 INF Adjust configs (incl. credentials, modes, subnets, etc.) file=fab.yaml
3336
09:27:35 INF Include wiring (fabric/gateway) files (.yaml) or adjust imported ones dir=include
34-
ubuntu@docs:~/hhfab$ ./hhfab vlab gen --mclag-leafs-count=0 --eslag-leaf-groups=2 --orphan-leafs-count=1 --externals=1 --external-orphan-connections=1
37+
ubuntu@docs:~/hhfab$ ./hhfab vlab gen --mclag-leafs-count=0 --eslag-leaf-groups=2 --orphan-leafs-count=1 --externals-bgp=1 --external-orphan-connections=1
3538
09:28:36 INF Hedgehog Fabricator version=v0.43.1
3639
09:28:36 INF Building VLAB wiring diagram fabricMode=spine-leaf
3740
09:28:36 INF >>> spinesCount=2 fabricLinksCount=2 meshLinksCount=0
@@ -40,7 +43,7 @@ ubuntu@docs:~/hhfab$ ./hhfab vlab gen --mclag-leafs-count=0 --eslag-leaf-groups=
4043
09:28:36 INF >>> mclagLeafsCount=0 mclagSessionLinks=0 mclagPeerLinks=0
4144
09:28:36 INF >>> orphanLeafsCount=1
4245
09:28:36 INF >>> mclagServers=0 eslagServers=2 unbundledServers=1 bundledServers=1
43-
09:28:36 INF >>> externalCount=1 externalMclagConnCount=0 externalEslagConnCount=0 externalOrphanConnCount=1
46+
09:28:36 INF >>> externalBGPCount=1 externalStaticCount=0 externalMclagConnCount=0 externalEslagConnCount=0 externalOrphanConnCount=1
4447
09:28:36 INF Generated wiring file name=vlab.generated.yaml
4548
ubuntu@docs:~/hhfab$ ./hhfab vlab up -f -m=manual -r=wait
4649
09:31:53 INF Hedgehog Fabricator version=v0.43.1

0 commit comments

Comments
 (0)