米葫芦网

BGP配置示例

热度:9℃ 发布时间:2023-11-16 19:52:04

(点击查看原图)
CAT 1
CAT1> (enable) show running-config
begin
!
# ***** NON-DEFAULT CONFIGURATION *****
!
!
#version 6.3(5)
!
#system
set system name CAT1
set system highavailability enable
!-- Enables high availability on Catalyst switch.
!
#vtp
set vtp domain cisco
set vlan 1 name default type ethernet mtu 1500 said 100001 state active
[..]
set vlan 10,20
!
#set boot command
set boot config-register 0x2102
set boot system flash bootflash:cat6000-sup.6-3-5.bin
!
#module 3 : 48-port 10/100BaseTX Ethernet
set vlan 10 3/2
!-- Port 3/2 is connected to AS10 on VLAN 10.
!
#module 5 : 8-port 1000BaseX Ethernet
set module name 5
set trunk 5/2 on isl 1-1005,1025-4094
!-- Port 5/2 is connected to CAT 2 as Trunk.
!
#module 15 : 1-port Multilayer Switch Feature Card
!-- MSFC #1 on Port 1, Mod 15.
!
#module 16 : 1-port Multilayer Switch Feature Card
!-- MSFC #2 on Port 2, Mod 16.
CAT 2
CAT2 (enable) show running-config
begin
!
# ***** NON-DEFAULT CONFIGURATION *****
!
!
#version 6.3(5)
!
#system
set system name CAT2
set system highavailability enable
!-- Enables high availability on Catalyst switch.
!
#vtp
set vtp domain cisco
set vlan 1 name default type ethernet mtu 1500 said 100001 state active
set vlan 10,20
!
#set boot command
set boot config-register 0x2102
set boot system flash bootflash:cat6000-sup.6-3-5.bin
!
!
#module 3 : 48-port 10/100BaseTX Ethernet
set vlan 20 3/3
!-- Port 3/3 is connected to AS20 on VLAN 20.
!
#module 4 : 8-port 1000BaseX Ethernet
set module name 4
set trunk 4/2 on isl 1-1005,1025-4094
!-- Port 4/2 is connected to CAT 1 as Trunk.
!
#module 15 : 1-port Multilayer Switch Feature Card
!-- MSFC 1 on Port 1, Mod 15.
!
#module 16 : 1-port Multilayer Switch Feature Card
!-- MSFC #2 on Port 2, Mod 16.
MSFC Configuration on CAT1
CAT1> (enable)
CAT1> (enable) session 15
Trying Router-15...
Connected to Router-15.
Escape character is "^]".
MSFC-CAT1>enable
MSFC-CAT1#show running-config
Building configuration...
Current configuration : 868 bytes
!
version 12.1
!
hostname MSFC-CAT1
!
boot system bootflash:c6msfc2-jsv-mz.121-8b.E7
!
ip subnet-zero
!
!
!
redundancy
!-- This command enables redundancy.
high-availability
!-- This command enables high availability.
single-router-mode
!-- This command enables SRM.
!
interface Vlan10
ip address 192.168.1.1 255.255.255.0
!-- Interface Vlan10 is connected to AS10.
!
interface Vlan20
ip address 192.168.2.3 255.255.255.0
!-- Interface Vlan20 is connected to interface Vlan20 on CAT2 via the trunk.
!
router bgp 4
no synchronization
bgp log-neighbor-changes
network 192.168.0.0 mask 255.255.0.0
neighbor 192.168.1.2 remote-as 10
!-- This command establishes eBGP peering with AS10.
neighbor 192.168.2.1 remote-as 4
!-- This command establishes iBGP peering with interface VLAN 20 on CAT2.
neighbor 192.168.2.1 next-hop-self
!-- This command assigns a next-hop value to 192.168.2.3 !-- for updates sent to 192.168.2.1 (the iBGP peer).
!
ip classless
ip route 192.168.0.0 255.255.0.0 Null0
MSFC Configuration on CAT2
CAT2 (enable)
CAT2 (enable) session 15
Trying Router-15...
Connected to Router-15.
Escape character is "^]".
MSFC-CAT2>enable
MSFC-CAT2#show running-config
Building configuration...
Current configuration : 890 bytes
!
version 12.1
!
hostname MSFC-CAT2
!
boot system flash bootflash:c6msfc-jsv-mz.121-8b.E7
!
ip subnet-zero
!
!
redundancy
!-- This command enables redundancy.
high-availability
!-- This command enables high availability.
single-router-mode
!-- This command enables SRM.
!
interface Vlan10
ip address 192.168.1.3 255.255.255.0
!-- Interface Vlan10 connected to interface Vlan10 on CAT1 via the trunk.
!
interface Vlan20
ip address 192.168.2.1 255.255.255.0
!-- Interface Vlan20 connected to AS20.
!
router bgp 4
no synchronization
bgp log-neighbor-changes
network 192.168.0.0 mask 255.255.0.0
neighbor 192.168.2.2 remote-as 20
!-- This command establishes eBGP peering with AS20.
neighbor 192.168.2.3 remote-as 4
!-- This command establishes iBGP peering with interface Vlan20 on CAT1.
neighbor 192.168.2.3 next-hop-self
!-- This command assigns a next-hop value to 192.168.2.1 !-- for updates sent to 192.168.2.3 (the iBGP peer).
!
ip classless
ip route 192.168.0.0 255.255.0.0 Null0
Troubleshoot
Now that you"ve verified the high availability SRM configuration, you need to verify the BGP MSFC on CAT1 and CAT2. Use the show ip bgp summary command to verify the neighbor establishment. The output below confirms sUCcessful eBGP and iBGP peering with AS10 and the CAT2 MSFC respectively.
MSFC-CAT1#show ip bgp summary
BGP router identifier 192.168.2.3, local AS number 4
BGP table version is 4, main routing table version 4
3 network entries and 4 paths using 435 bytes of memory
4 BGP path attribute entries using 240 bytes of memory
2 BGP AS-PATH entries using 48 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP activity 3/14 prefixes, 4/0 paths, scan interval 15 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.1.2 4 10 90 92 4 0 0 01:26:02 1
192.168.2.1 4 4 91 91 4 0 0 01:25:38 2
Verify the BGP state on the active MSFC in CAT2. The output below confirms successful eBGP and iBGP peering with AS20 and CAT1 respectively
MSFC-CAT2#show ip bgp summary
BGP router identifier 192.168.2.1, local AS number 4
BGP table version is 4, main routing table version 4
3 network entries and 4 paths using 435 bytes of memory
4 BGP path attribute entries using 240 bytes of memory
2 BGP AS-PATH entries using 48 bytes of memory
0 BGP route-map cache entries using 0 bytes of memory
0 BGP filter-list cache entries using 0 bytes of memory
BGP activity 3/0 prefixes, 4/0 paths, scan interval 15 secs
Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd
192.168.2.2 4 20 110 112 4 0 0 01:46:43 1
192.168.2.3 4 4 101 101 4 0 0 01:35:09 2
In the event the designated MSFC (Mod 15 on CAT1) eXPeriences a failure, the standby MSFC (Mod 16 on CAT1) takes over the role of active MSFC. It is important to understand that with the failure of the designated MSFC and fail over to the non-designated MSFC, packet switching will continue to work with the Cisco Express Forwarding (CEF) table programmed by the old designated MSFC. The newly designated MSFC will eventually re-program the CEF table with its own entries and the old entries will expire.
Failure of designated MSFC is simulated by resetting Mod 15 on CAT1 as shown below.
CAT1> (enable) reset 15
This command will reset module 15.
Unsaved configuration on module 15 will be lost
Do you want to continue (y/n) [n]? y
2002 May 16 11:52:54 %SYS-5-MOD_RESET:Module 15 reset from Console//
Resetting module 15...
Ping traffic was generated from AS10 to a destination in AS20 during the fail over on CAT1 from designated to non-designated MSFC. Note that there was minimal packet loss during this fail over and the packet forwarding continued to work with the old CEF table programmed by the Mod 15 MSFC until the Mod 16 MSFC re-programs the CEF table with its own entries.
AS10-Router#ping
Protocol [ip]:
Target IP address: 172.16.1.1
Repeat count [5]: 1000
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 1000, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!
Success rate is 99 percent (999/1000), round-trip min/avg/max = 1/3/116 ms

网友评论
评论
发 布

更多软件教程
  • 软件教程推荐
更多+
Greenfoot设置中文的方法

Greenfoot设置中文的方法

Greenfoot是一款简单易用的Java开发环境,该软件界面清爽简约,既可以作为一个开发框使用,也能够作为集成开发环境使用,操作起来十分简单。这款软件支持多种语言,但是默认的语言是英文,因此将该软件下载到电脑上的时候,会发现软件的界面语言是英文版本的,这对于英语基础较差的朋友来说,使用这款软件就会...

07-05

Egret UI Editor修改快捷键的方法

Egret UI Editor修改快捷键的方法

Egret UI Editor是一款开源的2D游戏开发代码编辑软件,其主要功能是针对Egret项目中的Exml皮肤文件进行可视化编辑,功能十分强大。我们在使用这款软件的过程中,可以将一些常用操作设置快捷键,这样就可以简化编程,从而提高代码编辑的工作效率。但是这款软件在日常生活中使用得不多,并且专业性...

07-05

KittenCode新建项目的方法

KittenCode新建项目的方法

KittenCode是一款十分专业的编程软件,该软件给用户提供了可视化的操作界面,支持Python语言的编程开发以及第三方库管理,并且提供了很多实用的工具,功能十分强大。我们在使用这款软件进行编程开发的过程中,最基本、最常做的操作就是新建项目,因此我们很有必要掌握新建项目的方法。但是这款软件的专业性...

07-05

Thonny设置中文的方法

Thonny设置中文的方法

Thonny是一款十分专业的Python编辑软件,该软件界面清爽简单,给用户提供了丰富的编程工具,具备代码补全、语法错误显示等功能,非常的适合新手使用。该软件还支持多种语言,所以在下载这款软件的时候,有时候下载到电脑中的软件是英文版本的,这对于英语基础较差的小伙伴来说,使用这款软件就会变得十分困难,...

07-05

最新软件下载