> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/fpp/2.9/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/fpp/2.9/abf.md).

# ACL-based forwarding

Access Control List (ACL)-based forwarding (ABF) is a limited version of policy-based routing (PBR). It lets you forward a packet based on criteria other than their destination address, such as the source address.

When an ABF resource is bound to an interface, all incoming packets on that interface are evaluated against a set of ACL rules:
- Packets matching the ACL criteria are forwarded according to the specifications in the ABF object.
- Packets that do not match are routed using the standard routing process.

## VPPABF Custom Resources

To define ACL rules for ABF, use the [VPPABF Custom Resource](https://docs.cennso.com/components/fpp/2.9/crs.md#vppabf-objects) (CR).

It consists of three arrays:
  - **rules**
  - **bindings**
  - **forwarding**

VPPABF also contains a **required** label `fpp-manager.cennso.com/plumbing-instance` that must point to a VPP pod.

The minimal VPPABF example looks as follows:

```yaml
apiVersion: fpp-manager.cennso.com/v1alpha1
kind: VPPABF
metadata:
  name: test
  namespace: fpp
  labels:
    fpp-manager.cennso.com/plumbing-instance: cgw
spec:
  bindings:
    - ifName: srv
      priority: 0
  rules:
    - source: "198.19.1.0/24"
  forwarding:
    - lookupInTable: 100
```

This ABF matches all packets incoming on interface ***srv** from IPs matching range `198.19.1.0/24` on an instance `cgw` and tries to forward them by lookup in routing table 100.

### Rules
Rules are used to match traffic with a certain pattern and perform a defined action.
Each rule consists of an action and one or more optional parameters:

- **addressFamily** (optional) - Specifies the address family if it can't be deduced from the source or destination address
- **dest** (optional) - Destination Classless Inter-Domain Routing (CIDR)
- **dstPort** (optional) - Destination port range
- **protocol** (optional) - Defines the protocol. The possible values are `tcp`, `udp`, `sctp`, `icmp`, and `icmp6`.
- **source** (optional) - Source CIDR
- **srcPort** (optional) - Source port range

Source and destination port ranges are defined in the format of `1234-1235`.

CIDR addresses are defined in the formats of `192.168.0.0/24` or `2001:4860:4860::8888/32`.

Rules are shared with [VPPACL](https://docs.cennso.com/components/fpp/2.9/firewall.md#rules) object, except for action which does not make sense in this context, so is missing from configuration.

### Bindings
Before rules can start matching traffic, you must bind them to an interface using **bindings**.
Bindings contain a list of interfaces to which all the above rules will be applied.

Each binding consists of these parameters:

- **ifName** - Interface name as specified in the [VPPInterface CR](https://docs.cennso.com/components/fpp/2.9/crs.md#vppinterface-objects)
- **priority** - When multiple ABFs are bound to one interface, this parameter sets the order in which they match the incoming packets.

### Forwarding
This section lets you specify routing paths for the matched packets.

There are three possible values:
- **lookupInTable** - Perform lookup in this routing table ID
- **nextHopAddress** - Route packets to this next hop
- **nextHopInterface** - Route packets using this interface. The name should be as specified in the VPPInterface CR.

When multiple path entries are provided, VPP balances the matched packets between them.

## Limitations

- VPP ABFs cover only TCP/UDP/ICMP L4 protocols
