Huawei BGP dynamic routing protocol theory + experiment

Article Directory

Foreword

A: BGP protocol theory

1.1: Overview

1.2: Classification of dynamic routing

1.2.1: Classification by Autonomous System

1.2.2: Classification by protocol type

1.3: BGP features

1.4: BGP works

1.4.1: BGP packets

1.4.2: BGP database

1.4.3: Types BGP

Two: BGP protocol test

2.1: experimental environment

2.2: Purpose

2.3: Experiment topology

2.4: experiment

2.4.1: Command explanation

2.4.2: practical operation

2.5: experimental verification

2.6: Experimental summary

A: BGP protocol theory

1.1: Overview

BGP is a dynamic routing protocol between the AS and the AS, the main role is no automatic exchange of information by the loop between AS

AS in order to build the topology map, thus eliminating the routing policy routing loops and user-configured embodiment.

The current number of public network entry, IGP protocol can not carry, and can easily cope with BGP, BGP protocol commonly used to exchange routing information between ISPs and ISP or between the total cross-domain regional branch

Homemade System Number

Autonomous System (AS) is managed by a technical authority, the use of a unified routing policy of a group of routers collection

Autonomous System Number Range: 1-65535, 1-64511 which is a registered public AS number on the Internet, similar to a public IP address.

64512-65535 is a private AS number, similar to private IP addresses

www.inna.org, registration URL (individual can not be registered)

1.2: Classification of dynamic routing

1.2.1: Classification by Autonomous System

IGP

AS internal routing protocols, primarily: RIP1 / RIP2, OSPF, ISIS, EIGRP (Cisco proprietary protocol)

IGP routing protocols are run within the AS, mainly to solve the routing problem of the AS, we find, calculate routes

EGP

Routing protocol between autonomous systems, typically: BGP

EGP routing protocol running between the AS and AS, he resolved between AS routing problem.

1.2.2: Classification by protocol type

Distance vector routing protocol

rip1 / 2, BGP (path vector protocol), EIGRP (Advanced distance vector protocol)

Link-state routing protocol

OSPF, ISIS: Use SPF shortest path algorithm

1.3: BGP features

Transport protocols: TCP, port number 179

BGP is an external routing protocol for passing routing information between AS

Is an enhanced path vector routing protocol

Have reliable routing update mechanism

Has a wealth of metrics Metric

Loop-free protocol design

Include many attribute information for the routing entry

Support CIDR (Classless Inter-Domain Routing)

Rich routing and route filtering policy

No need to periodically update

Send only incremental routes when routing updates

KeepAlive messages are sent periodically to maintain connectivity TCP

1.4: BGP works

1.4.1: BGP packets

Open messages

OPen message is the first message sent after the establishment of TCP for establishing the connection between the BGP peers, BGP included major version number, the local AS number, Holdtime information

UPdate message

Update message is used to update routing information between BGP, Updata message can advertise routing information up to a plurality of the same attribute, a plurality of routes may be withdrawn by the unreachable route information

Notification messages

The role of BGP packet when an error is detected when the message is sent immediately to the NOtification peer, BGP will be interrupted after just received Notification message will return idle state

Route-Refresh messages

Used to inform the peer route refresh capability supported, entrance strategy BGP routing changes, the local BGP routing sends Route-Refresh messages to the peer, after receiving the information, the peer to re-routing information sent to the local BGP router

KeepAlive packets

Packet transmission period between packets for peers to maintain the effectiveness of the connection is maintained and which is connected, only a KeepAlive BGP packet header, the default KeepAlive message transmission period 60S, 180S holding time, this is similar to the OSPF Hello packets

1.4.2: BGP database

IP routing table: global routing information base, including the best of IP routing information

BGP routing table: BGP routing information base, routing information including local BGPSpeak announcement will add it to the optimal routing table

Neighbor: neighbor list table and other body, including neighbor information, and a list of neighbors across the peer

Adi-RIB-In: peer to untreated declared local routing information base Speak

Adjust-RIB-OUT: Speak declared donor local routing information repository specified peer

1.4.3: Types BGP

Two kinds of neighbors: IBGP and EBGP

IBGP: the same AS BGP neighbor relations, IBGP neighbor refers to both ends of the run BGP peer in the same AS domain, belonging to the internal BGP AS

EBGP: BGP peer relationship between AS, EBGP generally refers to both ends of the BGP protocol running within different peer AS

Two: BGP protocol test

2.1: experimental environment

eNSP software

4 router (R1, R2, R3, R5)

R1, R2, R4 in the OSPF area 0, also in the AS100

R3 in the AS200

2.2: Purpose

By configuration, the entire network interworking

2.3: Experiment topology

Huawei BGP dynamic routing protocol theory + experiment

2.4: experiment

2.4.1: Command explanation

BGP configuration roadmap

1, enable BGP, followed by AS number system

2, declaring Route-id, a neighbor relationship is established, because of which contains the OSPF protocol, the router-id can start before the BGP announcement, a reducing Procedure

3, and who declared the establishment of a neighbor relationship

4, BGP route advertisement, (network, import)

Command show

'//建立邻居关系'
[R1]router-id 1.1.1.1   '//宣告router-id'
[R1]bgp 100 '//启动bgp'
[R1-bgp]peer 7.7.7.7 as-number 100  '//建立邻居关系第一步,宣告要建立的as区域'
[R1-bgp]peer 7.7.7.7 connect-interface loo 0    '//建立邻居关系第二步,使用loo 0地址建立 邻居关系'
[R1-bgp]network 1.1.1.1 32  '//宣告网段'
'//查看命令'
[R1] display bgp peer       '//查看BGP邻居'
[R1] display routing-table      '//查看BGP路由表'
[R1-bgp] import-route ospf 1    '//注入ospf/ISIS中的路由'
'//只有建立邻居关系,注入的路由信息才能被邻居学习到'

2.4.2: practical operation

Command should give me a direct result of the specific we should be able, if I have any questions or comments can whisper exchange

R1 arrangement

sysname R1      //修改名称

router id 1.1.1.1       //宣告router id

int g0/0/0      //配置接口地址
ip add 12.0.0.1 30

int g0/0/1      //配置接口地址 
ip address 15.0.0.1 30

int loo 0           //配置接口地址
ip add 1.1.1.1 32

bgp 100         //启动bgp,100为进程号

peer 2.2.2.2 as-number 100      //和router id 为2.2.2.2且as区域为100的路由建立邻居关系的第一步,指定对方
peer 2.2.2.2 connect-interface LoopBack0    //和router id 为2.2.2.2的路由建立邻居关系的第二步,用loo 0接口连接对方 
peer 4.4.4.4 as-number 100  //和router id 为4.4.4.4且as区域为100的路由建立邻居关系的第一步,指定对方
peer 4.4.4.4 connect-interface LoopBack0    //和router id 为4.4.4.的路由建立邻居关系的第二步,用loo 0接口连接对方 

network 1.1.1.1 255.255.255.255 //宣告网段

ospf 1              //启动ospf进程为1
area 0.0.0.0            //宣告ospf区域 
network 1.1.1.1 0.0.0.0     //以下都为宣告网段 
network 12.0.0.0 0.0.0.3

network 15.0.0.0 0.0.0.3

R2 Configuration

sysname R2

router id 2.2.2.2

int g0/0/0
ip add 12.0.0.2 30

int g0/0/1
ip add 23.0.0.1 30

int loo 0
ip add 2.2.2.2 32

bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack0
peer 4.4.4.4 as-number 100
peer 4.4.4.4 connect-interface LoopBack0
peer 23.0.0.2 as-number 200     //直接使用23.0.0.2的物理地址和bgp200区域的路由器建立连接,不可以使用虚拟接口地址

network 2.2.2.2 255.255.255.255
import-route ospf 1     //注入ospf 1 的路由条目,否则R3学习不到bgp100中的其他路由条目,除了R2在BGP中宣告的2.2.2.2,其他的都会学习不到,所以需要注入ospf 1 的路由条目'

ospf 1       
area 0.0.0.0    
network 2.2.2.2 0.0.0.0 
network 12.0.0.0 0.0.0.3

network 23.0.0.0 0.0.0.3

R3 Configuration

sysname R3

router id 3.3.3.3

int g0/0/1
ip add 23.0.0.2 30

int loo 0
ip add 3.3.3.3 32

bgp 200
peer 23.0.0.1 as-number 100         //使用物理地址23.0.0.1和bgp100的路由器建立邻居关系

network 3.3.3.3 255.255.255.255

R4 Configuration

sysname R5

router id 4.4.4.4

int g0/0/1
ip add 15.0.0.2 30

int loo 0
ip add 4.4.4.4 32

int loo 1
ip add 202.0.0.1 24

int loo 2
ip add 202.0.1.1 24

bgp 100
peer 1.1.1.1 as-number 100
peer 1.1.1.1 connect-interface LoopBack0
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack0

network 4.4.4.4 255.255.255.255

ospf 1
area 0
network 4.4.4.4 0.0.0.0
network 15.0.0.0 0.0.0.3
network 202.0.0.0 0.0.0.255
network 202.0.1.0 0.0.0.255

At this point we use dis ip routing-table can be found has been to learn from each other all the routing entries

2.5: experimental verification

The success of the whole network interoperability, test several other routers can use the same method

Huawei BGP dynamic routing protocol theory + experiment

Huawei BGP dynamic routing protocol theory + experiment

2.6: Experimental summary

Inter-AS neighbor relationship requiring a physical address, or can not learn each other's routing entry

Inter-AS routers establish two neighbor relationship, you want to learn all the other entries in the routing area, need each other to ospf or IS-IS routing entries came injection

Establish neighbor relations across autonomous domains If you are using a virtual loopback address, you need to add static routes, and points to the next one for the two-hop

'//静态路由的添加不在赘述'
##R2##
[R2] router id 2.2.2.2
[R2] bgp 100
[R2-bgp] peer 3.3.3.3 as-number 200
[R2-bgp] peer 3.3.3.3 connect-interface LoopBack 0
[R2-bgp] peer 3.3.3.3 ebgp-max-hop 2

##R3##
[R3] router id 3.3.3.3
[R3] bgp 200
[R3-bgp] peer 2.2.2.2 as-number 100
[R3-bgp] peer 2.2.2.2 connect-interface LoopBack 0
[R3-bgp] peer 2.2.2.2 ebgp-max-hop 2

Guess you like

Origin blog.51cto.com/14557584/2469760