实验篇---BGP小实验

实验拓扑图:

实验篇---BGP小实验_第1张图片

实验要求:

1.如图连接网络,合理规格IP地址,AS200内IGP协议为OSPF
2.R1属于AS 100 ; R2-R3-R4小AS 234 R5-R6-R7小AS 567,同时声 明大AS 200; R8属于AS300
3.R2-R5 R4-R7之间为联邦EBGP邻居关系
4.R1-R8之间通信

实验思路:

第一步:完成各路由器的基础接口配置

R1:
interface GigabitEthernet0/0/0
 ip address 12.1.1.1 255.255.255.0
interface LoopBack0
 ip address 1.1.1.1 255.255.255.0
 
R2:
interface GigabitEthernet0/0/0
 ip address 23.1.1.1 255.255.255.0 
interface GigabitEthernet0/0/1
 ip address 12.1.1.2 255.255.255.0 
interface GigabitEthernet0/0/2
 ip address 25.1.1.1 255.255.255.0 
interface LoopBack0
 ip address 2.2.2.2 255.255.255.0 

R3:
interface GigabitEthernet0/0/0
 ip address 34.1.1.1 255.255.255.0 
interface GigabitEthernet0/0/1
 ip address 23.1.1.2 255.255.255.0 
interface GigabitEthernet0/0/2
interface LoopBack0
 ip address 3.3.3.3 255.255.255.0 

R4:
interface GigabitEthernet0/0/0
 ip address 47.1.1.1 255.255.255.0 
interface GigabitEthernet0/0/1
 ip address 34.1.1.2 255.255.255.0 
interface LoopBack0
 ip address 4.4.4.4 255.255.255.0 

R5:
interface GigabitEthernet0/0/0
 ip address 56.1.1.1 255.255.255.0 
interface GigabitEthernet0/0/1
 ip address 25.1.1.2 255.255.255.0 
interface LoopBack0
 ip address 5.5.5.5 255.255.255.0 

R6:
interface GigabitEthernet0/0/0
 ip address 67.1.1.1 255.255.255.0 
interface GigabitEthernet0/0/1
 ip address 56.1.1.2 255.255.255.0 
interface LoopBack0
 ip address 6.6.6.6 255.255.255.0 

R7:
interface GigabitEthernet0/0/0
 ip address 47.1.1.2 255.255.255.0 
interface GigabitEthernet0/0/1
 ip address 67.1.1.2 255.255.255.0 
interface GigabitEthernet0/0/2
 ip address 78.1.1.1 255.255.255.0 
interface LoopBack0
 ip address 7.7.7.7 255.255.255.0 

R8:
interface GigabitEthernet0/0/0
 ip address 78.1.1.2 255.255.255.0 
interface LoopBack0
 ip address 8.8.8.8 255.255.255.0 

第二步:在AS 200中启用OSPF 100

R2:
ospf 100 router-id 2.2.2.2 
 area 0.0.0.0 
  network 2.2.2.2 0.0.0.0 
  network 23.1.1.1 0.0.0.0 
  network 25.1.1.1 0.0.0.0 
interface LoopBack0
 ospf network-type broadcast    ---进环回修改OSPF的网络类型
 
R3:
ospf 100 router-id 3.3.3.3 
 area 0.0.0.0 
  network 3.3.3.3 0.0.0.0 
  network 23.1.1.2 0.0.0.0 
  network 34.1.1.1 0.0.0.0 
interface LoopBack0
 ospf network-type broadcast    ---进环回修改OSPF的网络类型

R4:
ospf 100 router-id 4.4.4.4 
 area 0.0.0.0 
  network 4.4.4.4 0.0.0.0 
  network 34.1.1.2 0.0.0.0 
  network 47.1.1.1 0.0.0.0 
interface LoopBack0
 ospf network-type broadcast    ---进环回修改OSPF的网络类型

R5:
ospf 100 router-id 5.5.5.5 
 area 0.0.0.0 
  network 5.5.5.5 0.0.0.0 
  network 25.1.1.2 0.0.0.0 
  network 56.1.1.1 0.0.0.0 
interface LoopBack0
 ospf network-type broadcast    ---进环回修改OSPF的网络类型

R6:
ospf 100 router-id 6.6.6.6 
 area 0.0.0.0 
  network 6.6.6.6 0.0.0.0 
  network 56.1.1.2 0.0.0.0 
  network 67.1.1.1 0.0.0.0 
interface LoopBack0
 ospf network-type broadcast    ---进环回修改OSPF的网络类型

R7:
ospf 100 router-id 7.7.7.7 
 area 0.0.0.0 
  network 7.7.7.7 0.0.0.0 
  network 47.1.1.2 0.0.0.0 
  network 67.1.1.2 0.0.0.0 
interface LoopBack0
 ospf network-type broadcast    ---进环回修改OSPF的网络类型

第三步:启用BGP

1、R234 R567在OSPF基础上启用BGP,并分别建立IBGP邻居,使用小AS(记得声明该小AS号属于哪个打AS号),

  • 且R12 R78建立EBGP邻居,R25 R47建立联邦EBGP,
    BGP 234:
R2:
bgp 234
 router-id 2.2.2.2         ---手工指定router-id
 confederation id 200       ---声明大AS号
 confederation peer-as 567   ---在需要建立联盟EBGP之间指定peer-as
 peer 3.3.3.3 as-number 234    ---手工指定邻居
 peer 3.3.3.3 connect-interface LoopBack0  ---修改更新源(不修改则默认更新源为到达peer的本地出接口地址)
 peer 3.3.3.3 next-hop-local   ---指定下一跳属性为本地(EBGP学习路由传递给IBGP邻居时,下一跳不发生改变)
 peer 5.5.5.5 as-number 567 
 peer 5.5.5.5 ebgp-max-hop 255 ---关闭EBGP之间直连检测or修改EBGP数据包的TTL值
 peer 5.5.5.5 connect-interface LoopBack0
 peer 12.1.1.1 as-number 100 
 network 2.2.2.0 255.255.255.0    ---在BGP中通告环回

R3:
bgp 234
 router-id 3.3.3.3
 confederation id 200
 peer 2.2.2.2 as-number 234 
 peer 2.2.2.2 connect-interface LoopBack0
 peer 4.4.4.4 as-number 234 
 peer 4.4.4.4 connect-interface LoopBack0
 network 3.3.3.0 255.255.255.0 

R4:
bgp 234
 router-id 4.4.4.4
 confederation id 200
 confederation peer-as 567
 peer 3.3.3.3 as-number 234 
 peer 3.3.3.3 connect-interface LoopBack0
 peer 7.7.7.7 as-number 567 
 peer 7.7.7.7 ebgp-max-hop 255 
 peer 7.7.7.7 connect-interface LoopBack0
 network 4.4.4.0 255.255.255.0 

BGP 567:

R5:
bgp 567
 router-id 5.5.5.5
 confederation id 200
 confederation peer-as 234
 peer 2.2.2.2 as-number 234 
 peer 2.2.2.2 ebgp-max-hop 255 
 peer 2.2.2.2 connect-interface LoopBack0
 peer 6.6.6.6 as-number 567 
 peer 6.6.6.6 connect-interface LoopBack0
 network 5.5.5.0 255.255.255.0 

R6:
bgp 567
 router-id 6.6.6.6
 confederation id 200
 peer 5.5.5.5 as-number 567 
 peer 5.5.5.5 connect-interface LoopBack0
 peer 7.7.7.7 as-number 567 
 peer 7.7.7.7 connect-interface LoopBack0
 network 6.6.6.0 255.255.255.0 

R7:
bgp 567
 router-id 7.7.7.7
 confederation id 200
 confederation peer-as 234
 peer 4.4.4.4 as-number 234 
 peer 4.4.4.4 ebgp-max-hop 255 
 peer 4.4.4.4 connect-interface LoopBack0
 peer 6.6.6.6 as-number 567 
 peer 6.6.6.6 connect-interface LoopBack0
 peer 78.1.1.2 as-number 300 
 network 7.7.7.0 255.255.255.0

2、在R1上启用BGP 100,并与R2的物理接口建立EBGP邻居关系

bgp 100
 router-id 1.1.1.1
 peer 12.1.1.2 as-number 200 

3、在R8上启用BGP 300,并与R7的物理接口建立EBGP邻居关系

bgp 300
 router-id 8.8.8.8
 peer 78.1.1.1 as-number 200 

第四步:在R3、R6上做路由反射器

设置RR的cluster-id(簇ID)------在路由反射器中,由于破坏了IBGP水平分割机制,可能导致路由环路,所以引入起源者属性和簇ID属性进行防环

R3:
bgp 234
 ipv4-family unicast
  undo synchronization
  reflector cluster-id 33.3.3.3
  peer 2.2.2.2 enable
  peer 2.2.2.2 reflect-client
  peer 4.4.4.4 enable
  peer 4.4.4.4 reflect-client

R6:
bgp 567
 ipv4-family unicast
  undo synchronization
  reflector cluster-id 66.6.6.6
  peer 5.5.5.5 enable
  peer 5.5.5.5 reflect-client
  peer 7.7.7.7 enable
  peer 7.7.7.7 reflect-client 

第五步:R1和R8通告接口和环回路由

R1:
bgp 100
network 1.1.1.0 255.255.255.0
R8:
bgp 300
network 8.8.8.0 255.255.255.0

第六步:测试R1环回与R8环回互通

测试图:
实验篇---BGP小实验_第2张图片
访问路径图:
实验篇---BGP小实验_第3张图片

实验成功,滚去睡觉!!!

你可能感兴趣的:(网络实验,网络基础)