# Configure BGP on Your Router

After establishing your BGP session on zenConsole, to enable BGP interconnect, you need to configure BGP on your router.

{% hint style="info" %} <mark style="color:blue;">**Note**</mark>

* <mark style="color:blue;">Make sure you are familiar with BGP configuration and consult professionals if necessary.</mark>
* <mark style="color:blue;">BGP configuration may vary depending on router models and the version of the router's operating system (IOS), refer to your router's manual if you need.</mark>
  {% endhint %}

## Procedures

1. **Access Router Configuration Mode**\
   Log in to your router and access the configuration mode. This is typically done through a command-line interface (CLI) using SSH, Telnet, or a console connection.<br>
2. **Enter BGP Configuration Mode**\
   Once in the router's configuration mode, enter BGP configuration mode by typing:

   ```typescript
   router bgp <your-as-number>
   ```

   Replace `<your-as-number>` with your Autonomous System Number (ASN).<br>
3. **Configure BGP Neighbor Relationship**

   Configure BGP neighbor relationships to establish connections with other routers. Use the following command:

   ```typescript
   neighbor <neighbor-ip-address> remote-as <neighbor-as-number>
   ```

   Replace `<neighbor-ip-address>` with the IP address of your BGP neighbor, that is the Peer IP in BGP Session Details; and `<neighbor-as-number>` with their ASN, that is the Peer ASN (65534).<br>
4. **Configure BGP Route Policies**
   * Create a route policy: `route-map <route-map-name> permit 10`
   * Match routes: `match ip address 1`<br>
5. **Activate BGP Neighbor Relationships**\
   Once you have configured BGP neighbor relationships and route policies, activate the BGP neighbor relationships using the command:

   ```typescript
   neighbor <neighbor-ip-address> activate
   ```

   Replace `<neighbor-ip-address>` with the IP address of your BGP neighbor, that is the Peer IP in BGP Session Details.

Example

```python
pythonCopy coderouter bgp 65000
neighbor 10.0.0.1 remote-as 65534
route-map to-as65534 permit 10
  match ip address 1
neighbor 10.0.0.1 activate
```

6. **Save Configuration**\
   After configuring BGP, make sure to save the configuration changes to the router's running configuration. Use the command:

   ```arduino
   arduinoCopy codewrite memory
   ```

   or

   ```arduino
   arduinoCopy codecopy running-config startup-config
   ```

   This ensures that the configuration changes are retained even after a reboot.<br>
7. **Verify Configuration**\
   Use various show commands (e.g., `show ip bgp`, `show ip bgp neighbor`) to verify that BGP has been configured correctly and is operational.
