opnsense / opnsense/plugins

os-frr: No possibility to select specific IP address as BGP source if interface contains multiple IP

Open
#5,362 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

incomplete
Dominant language
PHP
Stars
1.2k
Forks
863
Avg merge
2d 6h
Merged PRs (30d)
10

Description

Describe the bug
No possibility to select specific ip address as a source of bgp sessions. If interface has multiple ip addresses address selection is undeterministic. This is causing bgp neighbor mismatches on both side of bgp session depending on which.

There is possibility to select source interface, but it does not guarantee any specific IP from interface to be used.
The "Local initiater IP field is not used for update-source statement in frr.

# grep neighbor.localip * -r
net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml:    <id>neighbor.localip</id>
net/frr/src/opnsense/service/templates/OPNsense/Quagga/sa_policies.conf:dst={{ neighbor.localip }}
net/frr/src/opnsense/service/templates/OPNsense/Quagga/sa_policies.conf:src={{ neighbor.localip }}


# grep update-source * -r
net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf: neighbor {{ peergroup.name }} update-source {{ physical_interface(peergroup.updatesource) }}
net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf: neighbor {{ neighbor.address }} update-source {{ physical_interface(neighbor.updatesource) }}

To Reproduce
Steps to reproduce the behavior:

  1. Go to "Routing/BGP/Neighbor"
  2. set "local initiater IP"
  3. specified address is not used in frr config as value of update-source for given neighbor

Expected behavior
When "Local initiater IP" field is set, update-source within frr confguration should contain this IP, not an interface name. "Local initiater IP" should take precedence over source interface

Environment
OPNsense 26.1.5-amd64
FreeBSD 14.3-RELEASE-p9
OpenSSL 3.0.19

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the BGP neighbor field in net/frr/src/opnsense/mvc/app/controllers/OPNsense/Quagga/forms/dialogEditBGPNeighbor.xml and compare it with the update-source handling in net/frr/src/opnsense/service/templates/OPNsense/Quagga/bgpd.conf. Check the generated FRR configuration for a neighbor with multiple interface addresses; done means the Local initiater IP is used as update-source and takes precedence over the source interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.