title: BGP
category: Networking
time: 1733352690739
---

## General BGP Related

#### Tools

There are a lot of useful online BGP tools available:
- [BGP.Tools](https://bgp.tools)
- [PeeringDB](https://www.peeringdb.com/)
- [HE.net BGP](https://bgp.he.net)
- [BGPView](https://bgpview.io/)

For Checking BGP route, you can also use `traceroute` etc
```
traceroute -A <ip-address> 
mtr -z <ip-address>
```

Some good alternative tools (Looking Glass) for traceroute or ping globally
- [HE.net Looking Glass](https://lg.he.net/)
- [Packet Clearing House (PCH) Looking Glass](https://www.pch.net/tools/looking_glass/)
- [Ping.SX - Misaka Network Looking Glass](https://ping.sx/)

#### BGP Software (Without Router)
- [BIRD](https://bird.network.cz/)
- [FRRouting (Quagga)](https://frrouting.org/)
- [ExaBGP](https://github.com/Exa-Networks/exabgp)

#### Commands

(ToDo)

## BGP With BIRD

Youc an check example (complicated) BIRD configeration [here](https://github.com/Zenuncl/bgp)

#### Example (simple) BIRD configeration

This is a simple BIRD configuration example for easy setup

```
router id <customer-ip-address>;

protocol kernel {
        scan time 60;
        import none;
        export all;   # Actually insert routes into the kernel routing table
        persist;
}

protocol device {
        scan time 60;
}

protocol bgp <bgp_protocol-peer-asn> {
        local as <customer-asn>;
        neighbor <peer-ip-address> as <peer-asn>;

        source address <customer-ip-address;

        export where proto = "static_bgp";
        import none; # Disable import routing table from upstream
}

protocol static static_bgp {
        import all;
        route <announcing-ip-block>/<prefix-length> reject;
}
```

#### Useful Commands

Reload configeration
```
birdc configure
```

Show status
```
birdc show status
birdc show interfaces

birdc show protocols
birdc show protocols all <bgp_protocol-peer-asn>    # Check specific BGP Status in details

birdc show static
birdc show static static_bgp                        # Show static BGP announcement

birdc show route
birdc show route export <bgp_protocol-peer-asn>     # Show specific BGP Exported route
```

Control Specific Protocol
```
birdc reload <protocol> | "<pattern>" | all         # Reload protocol
birdc restart <protocol> | "<pattern>" | all        # Restart protocol
birdc disable <protocol> | "<pattern>" | all        # Disable protocol
```

Add / Remove ROA
```
birdc add roa <prefix> max <num> as <num> [table <name>]        # Add ROA record
birdc delete roa <prefix> max <num> as <num> [table <name>]     # Delete ROA record
```

## BGP With FRRouting

(ToDo)
