Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BGP Antctl commands #6209

Open
1 of 4 tasks
Tracked by #6189
rajnkamr opened this issue Apr 10, 2024 · 8 comments
Open
1 of 4 tasks
Tracked by #6189

BGP Antctl commands #6209

rajnkamr opened this issue Apr 10, 2024 · 8 comments
Assignees
Labels
area/component/antctl Issues or PRs releated to the command line interface component area/transit/bgp Issues or PRs related to BGP support.

Comments

@rajnkamr
Copy link
Contributor

rajnkamr commented Apr 10, 2024

antctl agent command to -

  • get effective BGPPolicy name. (Add "antctl get bgppolicy" agent command #6646)
    It is nice to also have some basic info about it like LocalASN, RouterID, ListenPort.
    antctl get bgppolicy(or get bp) , exclude short name get bp

  • get ASN, RouterID and ListenPort directly from local BGP server corresponding to effective BGPPolicy.
    It can be helpful in debugging when BGP server is not running properly or its configuration is different from effective BGPPolicy due to some unknown reason.
    antctl get bgpserver(or get bs) , exclude short name get bs
    This command was earlier excluded , check details here
    We replanned to include this command as gobgp binary support is excluded now. details here

  • get BGP Peers(known by their Address) added to effective BGPPolicy. (Add "antctl get bgppeers" agent command #6689)
    It is nice to also have ASN and State of each BGP Peer which can be unknown, idle, active, established etc.
    antctl get bgppeers , include peer and state in command output, other details will be added later.

  • get routes advertised by effective BGPPolicy.
    It is nice to also have Advertisement type for each advertised routes. AdvertisementType can be egress, service, pod or all (default all)
    antctl get bgproutes --type <AdvertisementType> ( currently excluding --type, it will be supported later only for advertised routes )

antctl get bgproutes --peer <peer-ip-address> --in or(--out) for received or advertised routes respectively.

  • if --in or (--out) is omitted, the command will use --out (advertised routes) as default.
  • if --peer flag is omitted we will consider routes from all peers depending on --in or(--out) flag provided.
@rajnkamr rajnkamr changed the title To provide Antctl commands specific to BGP BGP Antctl commands Apr 29, 2024
@Atish-iaf Atish-iaf added area/component/antctl Issues or PRs releated to the command line interface component area/transit/bgp Issues or PRs related to BGP support. labels May 7, 2024
@roopeshsn
Copy link
Contributor

Hi, @Atish-iaf! If you're already working on this issue, I would like to be a part of it.

CC: @rajnkamr

@rajnkamr rajnkamr added this to the Antrea v2.2 release milestone Jul 15, 2024
Atish-iaf added a commit to Atish-iaf/antrea that referenced this issue Aug 30, 2024
Add `antctl get bgppolicy` command to get effective BGP policy applied
on the Node.
Add `antctl get bgpserver` command to get configuration of BGP server
running on the Node.

For antrea-io#6209

Signed-off-by: Kumar Atish <[email protected]>
Atish-iaf added a commit to Atish-iaf/antrea that referenced this issue Aug 30, 2024
Add `antctl get bgppolicy` agent command to get effective BGP policy applied
on the Node.
Add `antctl get bgpserver` agent command to get configuration of BGP server
running on the Node.

For antrea-io#6209

Signed-off-by: Kumar Atish <[email protected]>
@hongliangl
Copy link
Contributor

antctl agent command to -

  • get effective BGPPolicy name.
    It is nice to also have some basic info about it like LocalASN, RouterID, ListenPort.
    antctl get bgppolicy(or get bp)

Maybe remove the alias bp, it is not a great short name. IMO, only outputting the effective BGPPolicy name is sufficient for this command.

  • get ASN, RouterID and ListenPort directly from local BGP server corresponding to effective BGPPolicy.
    It can be helpful in debugging when BGP server is not running properly or its configuration is different from effective BGPPolicy due to some unknown reason.
    antctl get bgpserver(or get bs)

Maybe remove the alias bs. The output of the command might contain:

  • local listen port;
  • router ID;
  • local ASN;
  • other attributes of the config to start gobgp server added in the future.
  • get BGP Peers(known by their Address) added to effective BGPPolicy.
    It is nice to also have ASN and State of each BGP Peer which can be unknown, idle, active, established etc.
    antctl get bgppeers

I'm fine this with one.

  • get routes advertised by effective BGPPolicy.
    It is nice to also have Advertisement type for each advertised routes. AdvertisementType can be egress, service, pod or all (default all)
    antctl get bgproutes --type <AdvertisementType>

IIRC, we can only identify the routes received from remote peers as well as the routes sent to remote peers (by getting the routes from the bgpserver on a Node).

cc @antoninbas @tnqn

@rajnkamr
Copy link
Contributor Author

rajnkamr commented Sep 2, 2024

Maybe remove the alias bp, it is not a great short name. IMO, only outputting the effective BGPPolicy name is sufficient for this command.

For effective policy we might want to have asn, router id and listen port details given that at one time only one bgp policy can be effective however multiple bgp policies could have been applied .

may be can add option to display only effective bgp policy name with antctl get bgppolicy and antctl get bgppolicy --detailsfor all other details ?

NAME              LOCAL ASN     ROUTER ID      LISTEN PORT
bgp-policy-1  64512               192.168.1.1       179
  • get ASN, RouterID and ListenPort directly from local BGP server corresponding to effective BGPPolicy.
    It can be helpful in debugging when BGP server is not running properly or its configuration is different from effective BGPPolicy due to some unknown reason.
    antctl get bgpserver(or get bs)

Maybe remove the alias bs. The output of the command might contain:

  • local listen port;
  • router ID;
  • local ASN;
  • other attributes of the config to start gobgp server added in the future.

Usually this command is equivalent to gobgp global which gets information by calling gobgp apis
may be add antctl get bgpserver --details for future expansion

AS: 64512
Router-ID: 192.168.1.1
Listening Port: 179
  • get BGP Peers(known by their Address) added to effective BGPPolicy.
    It is nice to also have ASN and State of each BGP Peer which can be unknown, idle, active, established etc.
    antctl get bgppeers

I'm fine this with one.

for
antctl get bgppeers
Usually this command can have more information in future but for now, peer, as and state should be ok to start with

Peer            AS       State     Uptime    Received  Advertised
192.168.2.2    64513  Establ    4d12h     24             13
192.168.3.3    64514  Establ    1d02h     18              15

IMO- can add another command to get bgp peer specific details using gobgp apis ( second phase)
antctl get peer xyz similar to gobgp neighbor 192.168.255.1

  • get routes advertised by effective BGPPolicy.
    It is nice to also have Advertisement type for each advertised routes. AdvertisementType can be egress, service, pod or all (default all)
    antctl get bgproutes --type <AdvertisementType>

IIRC, we can only identify the routes received from remote peers as well as the routes sent to remote peers (by getting the routes from the bgpserver on a Node).

It seems it is possible to filter advertised routes, usually routes which starts with * are advertized routes ! from gobgp standard output
gobgp global rib

Network              Next Hop             AS_PATH              Age        Attrs
*> 192.168.100.0/24     192.168.1.101                             00:00:06   [{Origin: i}]

@antoninbas
Copy link
Contributor

What's the difference between "antctl get bgpolicy" and "antctl get bgprouter"? It's better to have fewer commands if possible.

For "antctl get bgproutes", we should have the ability to filter by peer. Filtering routes by "type", or being able to tie each route to a specific resource, sounds nice, but I wonder if it is worth it as it may increase the complexity of the implementation without adding too much value.

@rajnkamr
Copy link
Contributor Author

rajnkamr commented Sep 6, 2024

What's the difference between "antctl get bgpolicy" and "antctl get bgprouter"? It's better to have fewer commands if possible.

antctl get bgpserver retrieves information from gobgp daemon.

@rajnkamr
Copy link
Contributor Author

rajnkamr commented Sep 9, 2024

For "antctl get bgproutes", we should have the ability to filter by peer. Filtering routes by "type", or being able to tie each route to a specific resource, sounds nice, but I wonder if it is worth it as it may increase the complexity of the implementation without adding too much value.

Makes sense to me as for each bgp peer, a local rib is maintained which could be used to filter routes based on peer, we can have an extension of command antctl get bgproutes which could list all routes received from/sent to a peer antctl get bgproutes --peer <peer-ip-address>

@antoninbas
Copy link
Contributor

What's the difference between "antctl get bgpolicy" and "antctl get bgprouter"? It's better to have fewer commands if possible.

antctl get bgpserver retrieves information from gobgp daemon.

In this case, I wonder if antctl get bgpserver should really be included, especially if we are going to include the gobgp binary in the antrea-agent image for troubleshooting purposes. The command is only useful if we assume there is a very obvious bug in either Antrea or gobgp?

@rajnkamr
Copy link
Contributor Author

What's the difference between "antctl get bgpolicy" and "antctl get bgprouter"? It's better to have fewer commands if possible.

antctl get bgpserver retrieves information from gobgp daemon.

In this case, I wonder if antctl get bgpserver should really be included, especially if we are going to include the gobgp binary in the antrea-agent image for troubleshooting purposes. The command is only useful if we assume there is a very obvious bug in either Antrea or gobgp?

As it provides same information as provided by gobgp global, do not see a strong case for supporting antctl get bgpserver , also explained about command output in second section , we will drop this command.

antoninbas pushed a commit that referenced this issue Sep 18, 2024
Add `antctl get bgppolicy` agent command to get effective BGP policy
applied on the Node.

The command is implemented using a new HTTP endpoint (`/bgppolicy`),
which will return a `404 Not Found` error if no BGPPolicy has been applied
on the Node.

For #6209

Signed-off-by: Kumar Atish <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/component/antctl Issues or PRs releated to the command line interface component area/transit/bgp Issues or PRs related to BGP support.
Projects
None yet
Development

No branches or pull requests

5 participants