Configuring BGP

The configuration required for BGP to work can be broken into two parts:

  • A configuration that specifies who you are: Who you are is really as simple as identifying your AS and specifying the address by which you want to be known. You configure “who you are” by setting your AS under routing options:

    [edit]
    routing options {
       autonomous-system 65001;
    }
    

    A lot of protocols include an address for the router in their exchange of information with other routers. Explicitly configuring the address to be used for this type of communication is generally a good idea so that messages between routers are always clear, making it far easier to troubleshoot things down the road. You should always explicitly configure the router ID:

    [edit]
    routing-options {
       router-id 192.168.14.3
    }
    

    images A common best practice is to have the router-id correspond to your loopback interface IP address.

  • A configuration that establishes a session with your neighbors: After configuring your own information, you need to set up the BGP session to your external neighbor, as shown in Figure 13-2.

    Using the topology in Figure 13-2, configure a BGP session between router 3 to router 5, and vice versa, by working in the protocols section of the configuration hierarchy, such as shown here:

    [edit protocols]
    bgp {
       group those-guys {
          type external;
          peer-as 65002;
          neighbor 10.0.26.2;
       }
    }
    

    All you're doing ...

Get Junos® OS For Dummies®, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.