PART 4 Internet Routing Device Configuration
In previous chapters, we developed concepts and approaches, but withheld the details of configuration code. In Chapters 10 and 11, you will find code examples for most of the concepts and functions described in Part 2 and Part 3. Chapter 10 focuses on configuration examples of basic BGP attributes, and Chapter 11 focuses on configuration examples for some of the more complex, realistic design problems faced by administrators developing routing policies. You cannot simply plug these code examples into your own network routing policies. Rather, they are models for the particular routing decisions you are likely to have to make as you develop, maintain, and extend routing policies to accommodate your evolving network and connectivity needs. You will need to extrapolate from and adjust the models to suit your particular situation.
Chapter 10Configuring Basic BGP Functions and Attributes
Chapter 11Configuring Effective Internet Routing Policies
This chapter covers the following key topics:
- Building Peering Sessions
Configuration examples for the first step in the routing task. This section overviews basic syntax used in configuration code.
- Route Filtering and Attribute Manipulation
BGP route maps, filtering based on NLRI, and filtering based on AS_path.
- Peer Groups
Configuration examples of defining and utilizing peer groups.
- Sources of Routing Updates
Dynamic and static configuration for injecting information into BGP.
- Overlapping Protocols (Backdoors)
Configuration examples for changing the distance parameter to favor certain routes over others.
- BGP Attributes
Configuration examples for NEXT_HOP, AS_PATH, local preference, MED, and cummunity attributes.
- BGP4 Aggregation
Configuration examples for various aggregation scenarios.
Chapter 10 Configuring Basic BGP Functions and Attributes
This is the first of two chapters consisting primarily of configuration examples. Having covered all the important, prerequisite concepts, you can delve into these examples of how to write the code for basic BGP functions and attributes. This chapter focuses on those basics, and the next chapter considers some of the more complex design-oriented configuration problems.
Even if you have been using the references in previous chapters to flip ahead to these configuration examples, you are encouraged to reexamine them now, with the benefit of having read and assimilated all the concept-oriented chapters. In addition to the configuration code itself, be sure to look at the many routing tables that are included; they are intended to solidify your understanding of what results to expect.
Chapters 10 and 11 are not intended to replace Cisco manuals and do not cover every command and scenario. They present configurations for common situations that are encountered in connecting networks to the Internet. Your particular network might require a combination of scenariosor a different approachto achieve the most effective policies.
In the following discussions, an AS could play the role of a customer, provider, or both. Do not get confused by having AS numbers and AS roles being switched around, or by IP address numbering not being too realistic. These are just exercises that will help you understand BGP so that you can apply it accordingly in your own environment.
Building Peering Sessions
This example demonstrates the different types of BGP peering sessions you will encounter. Consider figure 10-1. An IBGP peering session is formed within AS3, between the loopback address of RTA and a physical address of RTF. An EBGP session is also formed between AS3 and AS1 by using the two directly connected IP addresses of RTA and RTC. Another EBGP session is formed between RTF in AS3 and RTD in AS2, using IP addresses that are not on the same segment (multihop).
Figure 10-1 Building peering sessions.
It is important to remember that the BGP peers will never become established unless there is an IGP connectivity between the two peers or the two peers are on the same segment. We will use OSPF as an IGP to establish the required internal connectivity.
RTA's configuration is:
ip subnet-zero
interface Loopback0
ip address 172.16.2.254 255.255.255.255
interface Ethernet1
ip address 172.16.1.1 255.255.255.0
interface Serial0
ip address 172.16.20.2 255.255.255.0
router ospf 10
network 172.16.0.0 0.0.255.255 area 0
router bgp 3
no synchronization
neighbor 172.16.1.2 remote-as 3
neighbor 172.16.1.2 update-source Loopback0
neighbor 172.16.20.1 remote-as 1
no auto-summary
ip classless
RTA's configuration shows some syntax that might be unfamiliar to you. All the syntax is explained here generically, as well as in relation to the particular routing scenario of figure 10-1. In subsequent examples throughout this chapter, however, the router's configuration will be reduced to necessary commands to configure BGP or IGP. Commands that assign IP addresses to interfaces will be omitted in many cases due to space limitations.
- ip subnet-zero: This global configuration command is necessary in case you are configuring interfaces that fall in subnet-zero subnets. With the introduction of classless routing, using subnet-zero is very common.
- interface type slot/port: This command configures an interface type and number on the router. Any configuration that appears under the command will be specific to that particular interface. Note that RTA has three interface commands, one for each of its three connections. The loopback interface is a software-only interface that emulates an interface that is always up.
- ip address ip-address mask [secondary]: This is an interface command that configures an interface with an IP address/mask tuple. RTA's Ethernet IP address, for example, is configured by: ip address 172.16.1.1 255.255.255.0.
- router process [process-id]: This is a global command that defines a process such as OSPF, RIP, or BGP, and gives the process a process ID. Some processes such as RIP do not require a process ID.
In RTA's configuration, "router ospf 10," for example, indicates an OSPF process with ID 10, whereas "router bgp 3" indicates a BGP process in autonomous system 3.
- network: This command indicates the networks or, in the case of OSPF, the interfaces that will run under a specific router process.
- inverse mask: In RTA's network command, you will notice a representation of the form 0.0.255.255 or basically a number of 0s followed with a number of 1s. This is an inverse mask with the 0s being an exact match, and the 1s being do-not-care-bits. For example: 172.16.0.0 0.0.255.255 indicates any IP address or network of the form 172.16.X.X. Inverse masks can be applied to access lists as well as the network command.
- area area-number: This is a representation of an OSPF area with a specified area number.
- neighbor: This command is used to define the BGP neighbor connection parameters and policies between this router and its peers. In RTA's configuration, "neighbor 172.16.1.2 remote-as 3," for example, is an indication that a BGP peer session is to be established between RTA and peer 172.16.1.2 in autonomous system 3.
- no synchronization: This command turns the synchronization off between BGP and IGP, as explained in Chapter 5, "Tuning BGP Capabilities."
- no auto-summary: This command will turn off the BGP automatic summarization at the major net boundary. Without this command, BGP will not send the subnets of a major net that are redistributed into BGP; that is, updates about 172.16.1.0/24, 172.16.2.0/24, and so on will be sent as a single major class B 172.16.0.0/16. Summarization at the major net boundary should be done only if the AS is the owner of the whole major net.
- ip classless: This command enables the router to forward packets that are destined for unrecognized subnets of directly connected networks. By default, when a router receives packets for a subnet that falls numerically within its subnetwork addressing scheme, if there is no such subnet number in the routing table and there is no network default route, the router discards the packets. When the ip classless command is enabled, however, the router forwards those packets to the best supernet route.
- update-source interface: This command, when associated with the BGP neighbor statement, specifies the interface to be used as a source IP address of the BGP session with the neighbor. In RTA's configuration, for example, the second neighbor statement indicates that Loopback 0 is to be used as a source IP address.
- remote-as: This command, when associated with the BGP neighbor statement, specifies the AS number of the remote BGP peer. In RTA's configuration, the first neighbor statement indicates that the internal BGP neighbor 172.16.1.2 belongs to the local AS3. The third neighbor statement indicates that the external BGP peer 172.16.20.1 belongs to AS1.
We turn now to RTF's configuration.
ip subnet-zero
interface Ethernet1/1
ip address 172.16.1.2 255.255.255.0
interface Serial2/1
ip address 192.68.5.1 255.255.255.0
router ospf 10
network 172.16.0.0 0.0.255.255 area 0
network 192.68.0.0 0.0.255.255 area 0
router bgp 3
no synchronization
neighbor 172.16.2.254 remote-as 3
neighbor 192.68.12.1 remote-as 2
neighbor 192.68.12.1 ebgp-multihop 2
no auto-summary
ip classless
|