> For the complete documentation index, see [llms.txt](https://docs.console.zenlayer.com/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.console.zenlayer.com/welcome/global-bgp/establish-bgp-session/configure-bgp-on-your-router.md).

# 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.console.zenlayer.com/welcome/global-bgp/establish-bgp-session/configure-bgp-on-your-router.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
