当前位置:文档之家› bgp&eigrp重分发

bgp&eigrp重分发

使用2个R进行基本的配置信息及在R上使用EIGRP协议
首先、定义各接口IP地址,并且使用环回接口建立BGP邻居关系。
其次、启用BGP进程,并配置相关参数。
然后再宣告网络,在BGP进程下宣告,注意其关键字MASK。
最后做好重分发,根据具体情况而定。
------------------------------------------------------
1、------------R1配置信息------

Router>en
Router#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho R1
R1(config)#no ip domain-lo
R1(config)#line c 0
R1(config-line)#logg syn
R1(config-line)#exec-t 0 0
R1(config-line)#exit
R1(config)#int lo 0
R1(config-if)#ip add 192.168.0.1 255.255.255.0
R1(config-if)#int lo 1
R1(config-if)#ip add 192.168.1.1 255.255.255.0
R1(config-if)#int lo 2
R1(config-if)#ip add 192.168.2.1 255.255.255.0
R1(config-if)#int lo 3
R1(config-if)#ip add 192.168.3.1 255.255.255.0
R1(config-if)#int lo 4
R1(config-if)#ip add 192.168.4.1 255.255.255.0
R1(config-if)#int lo 5
R1(config-if)#ip add 1.1.1.1 255.255.255.255
R1(config-if)#exit
R1(config)#int ser 0
R1(config-if)#ip add 10.0.0.1 255.255.255.252
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#

2、----启用BGP进程,配置基本参数--------

R1(config)#router bgp 10
R1(config-router)#neighbor 2.2.2.2 remote-as 20
R1(config-router)#neighbor 2.2.2.2 ebgp-multihop
R1(config-router)#neighbor 2.2.2.2 update-source lo 5
R1(config-router)#ip route 2.2.2.2 255.255.255.255 ser0
R1(config)#exit
R1#

3、-----宣告直连网络号-----------
R1(config)#router bgp 10
R1(config-router)#net
R1(config-router)#network 192.168.0.0 mask 255.255.255.0
R1(config-router)#network 192.168.1.0 mask 255.255.255.0
R1(config-router)#network 192.168.2.0 mask 255.255.255.0
R1(config-router)#network 192.168.3.0 mask 255.255.255.0
R1(config-router)#network 192.168.4.0 mask 255.255.255.0
R1(config-router)#aggregate-address 192.168.0.0 255.255.252.0 summary-only
R1(config-router)#exit
R1(config)#
R1#



------------------------------R2配置信息----------------------------------------------
1、配置其基本接口信息

Router>en
Router#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ho R2
R2(config)#no ip domain-lo
R2(config)#line c 0
R2(config-line)#logg sy
R2(config-line)#exec-t 0 0
R2(config-line)#exit

R2(config)#int ser 0
R2(config-if)#ip add 10.0.0.2 255.255.255.252
R2(config-if)#clock rate 56000
R2(config-if)#no shut
R2(config-if)#exit

R2(config)#int lo 0
R2(config-if)#ip add 172.168.0.1 255.255.255.0
R2(config-if)#int lo 1
R2(config-if)#ip add 172.168.1.1 255.255.2

55.0
R2(config-if)#int lo 2
R2(config-if)#ip add 172.168.2.1 255.255.255.0
R2(config-if)#int lo 3
R2(config-if)#ip add 172.168.3.1 255.255.255.0
R2(config-if)#int lo 4
R2(config-if)#ip add 172.168.4.1 255.255.255.0
R2(config-if)#int lo 6
R2(config-if)#ip add 2.2.2.2 255.255.255.255
R2(config-if)#exit
R2(config)#
-------------------------
2、起用BGP进程并且宣告网络及建立静态路由

R2(config)#router bgp 20
R2(config-router)#nei 1.1.1.1 re
R2(config-router)#nei 1.1.1.1 remote
R2(config-router)#nei 1.1.1.1 remote-as 10
R2(config-router)#nei 1.1.1.1 ebgp
R2(config-router)#nei 1.1.1.1 ebgp-multihop
R2(config-router)#nei 1.1.1.1 up
R2(config-router)#nei 1.1.1.1 update-source lo 6
R2(config-router)#ip route 1.1.1.1 255.255.255.255 ser0
R2(config)#



----------------------
3、启用EIGRP协议,并且宣告网络号
R2#config
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
R2(config-router)#exit
R2(config)#router eigrp 100
R2(config-router)#net 172.168.0.0 0.0.255.255
R2(config-router)#net 172.168.1.0 0.0.255.255
R2(config-router)#net 172.168.2.0 0.0.255.255
R2(config-router)#net 172.168.3.0 0.0.255.255
R2(config-router)#net 172.168.4.0 0.0.255.255
R2(config-router)#no auto-summary
R2(config-router)#exit
--------------------
4、进行重分发

配置重分发,在这里我们是把EIGRP灌入到BGP中

R2(config)#router bgp 20
R2(config-router)#redistribute eigrp 100
R2(config-router)#exit
R2(config)#
R2#
---------验证其结果------------------
R1#sh ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
* - candidate default, U - per-user static route, o - ODR
P - periodic downloaded static route

Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets
C 1.1.1.1 is directly connected, Loopback5
2.0.0.0/32 is subnetted, 1 subnets
S 2.2.2.2 is directly connected, Serial0
172.168.0.0/24 is subnetted, 5 subnets
B 172.168.4.0 [20/0] via 2.2.2.2, 00:02:31
B 172.168.0.0 [20/0] via 2.2.2.2, 00:02:31
B 172.168.1.0 [20/0] via 2.2.2.2, 00:02:31
B 172.168.2.0 [20/0] via 2.2.2.2, 00:02:31
B 172.168.3.0 [20/0] via 2.2.2.2, 00:02:31
C 192.168.4.0/24 is directly connected, Loopback4
10.0.0.0/30 is subnetted, 1 subnets
C 10.0.0.0 is directly connected, Serial0
C 192.168.0.0/24 is directly connected, Loopback0
C 192.168.1.0/24 is directly connected, Loopback1
C 192.168.2.0/24 is directly connected, Loopback

2
C 192.168.3.0/24 is directly connected, Loopback3
B 192.168.0.0/22 [200/0] via 0.0.0.0, 00:23:16, Null0
------------
R1#sh ip bgp
BGP table version is 30, local router ID is 192.168.4.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

Network Next Hop Metric LocPrf Weight Path
*> 172.168.0.0/24 2.2.2.2 0 0 20 ?
*> 172.168.1.0/24 2.2.2.2 0 0 20 ?
*> 172.168.2.0/24 2.2.2.2 0 0 20 ?
*> 172.168.3.0/24 2.2.2.2 0 0 20 ?
*> 172.168.4.0/24 2.2.2.2 0 0 20 ?
s> 192.168.0.0 0.0.0.0 0 32768 i
*> 192.168.0.0/22 0.0.0.0 32768 i
s> 192.168.1.0 0.0.0.0 0 32768 i
s> 192.168.2.0 0.0.0.0 0 32768 i
s> 192.168.3.0 0.0.0.0 0 32768 i
*> 192.168.4.0 0.0.0.0 0 32768 i
R1#
-----在这里你可看到BGP状态,BGP state = Established-------
R1#sh ip bgp nei
BGP neighbor is 2.2.2.2, remote AS 20, external link
BGP version 4, remote router ID 172.168.4.1
BGP state = Established, up for 00:21:31
Last read 00:00:30, hold time is 180, keepalive interval is 60 seconds
Neighbor capabilities:
Route refresh: advertised and received(new)
Address family IPv4 Unicast: advertised and received
Received 28 messages, 0 notifications, 0 in queue
Sent 27 messages, 0 notifications, 0 in queue
Route refresh request: received 0, sent 0
Default minimum time between advertisement runs is 30 seconds

For address family: IPv4 Unicast
BGP table version 30, neighbor version 30
Index 1, Offset 0, Mask 0x2
5 accepted prefixes consume 180 bytes
Prefix advertised 2, suppressed 0, withdrawn 0
Number of NLRIs in the update sent: max 1, min 0

Connections established 1; dropped 0
Last reset never
External BGP neighbor may be up to 255 hops away.
Connection state is ESTAB, I/O status: 1, unread input bytes: 0
Local host: 1.1.1.1, Local port: 179
Foreign host: 2.2.2.2, Foreign port: 11000

Enqueued packets for retransmit: 0, input: 0 mis-ordered: 0 (0 bytes)

Event Timers (current time is 0x25F784):
Timer Starts Wakeups Next
Retrans 25 0 0x0
TimeWait 0 0 0x0
AckHold 28 14 0x0
SendWnd 0 0 0x0
KeepAlive 0 0 0x0
GiveUp 0 0 0x0
PmtuAger 0 0 0x0
DeadWait 0 0 0x0

iss: 505498954 snduna: 505499565 sndnxt: 505499565 sndwnd: 16327
irs: 1899673529 rcvnxt: 1899674230 rcvwnd: 16221 delrc

vwnd: 163

SRTT: 289 ms, RTTO: 376 ms, RTV: 87 ms, KRTT: 0 ms
minRTT: 20 ms, maxRTT: 300 ms, ACK hold: 200 ms
Flags: passive open, nagle, gen tcbs

Datagrams (max data segment is 536 bytes):
Rcvd: 44 (out of order: 0), with data: 29, total data bytes: 719
Sent: 41 (retransmit: 0), with data: 25, total data bytes: 629
R1#


相关主题
文本预览
相关文档 最新文档