第15章 BGP典型配置案例
- 格式:ppt
- 大小:718.00 KB
- 文档页数:30
组网说明:本案例采用H3C HCL模拟器来模拟IPV6 IBGP一级RR路由反射器典型组网配置!R1与R2属于AS100,R3属于AS200。
R1是R2的RR路由反射器的客户端。
R2与R3为EBGP邻居关系。
要求R1、R2、R3的loopback0能够互通。
配置思路:1、按照网络拓扑图正确配置IP地址2、R1与R2建立IBGP邻居关系,R2配置RR路由反射器客户端,指向R13、R2与R3建立EBGP邻居关系配置过程:R1:<H3C>sysSystem View: return to User View with Ctrl+Z.[H3C]sysname R1[R1]int loopback 1[R1-LoopBack1]ip address 1.1.1.1 32[R1-LoopBack1]quit[R1]int loopback 0[R1-LoopBack0]ipv6 address 3::1 64[R1-LoopBack0]quit[R1]int gi 0/1[R1-GigabitEthernet0/1]des <connect to R2>[R1-GigabitEthernet0/1]ipv6 address 1::1 64[R1-GigabitEthernet0/1]quit[R1]bgp 100[R1-bgp-default]router-id 1.1.1.1[R1-bgp-default]peer 1::2 as-number 100[R1-bgp-default]address-family ipv6 unicast[R1-bgp-default-ipv6]peer 1::2 enable[R1-bgp-default-ipv6]network 3:: 64[R1-bgp-default-ipv6]quit[R1-bgp-default]quitR2:<H3C>sysSystem View: return to User View with Ctrl+Z. [H3C]sysname R2[R2]int loopback 1[R2-LoopBack1]ip address 2.2.2.2 32[R2-LoopBack1]quit[R2]int loopback 0[R2-LoopBack0]ipv6 address 4::1 64[R2-LoopBack0]quit[R2]int gi 0/1[R2-GigabitEthernet0/1]des <connect to R1> [R2-GigabitEthernet0/1]ipv6 address 1::2 64 [R2-GigabitEthernet0/1]quit[R2]int gi 0/0[R2-GigabitEthernet0/0]des <connect to R3> [R2-GigabitEthernet0/0]ipv6 address 2::1 64 [R2-GigabitEthernet0/0]quit[R2]bgp 100[R2-bgp-default]router-id 2.2.2.2[R2-bgp-default]peer 1::1 as-number 100 [R2-bgp-default]peer 2::2 as-number 200 [R2-bgp-default]address-family ipv6 unicast [R2-bgp-default-ipv6]peer 1::1 enable[R2-bgp-default-ipv6]peer 1::1 reflect-client [R2-bgp-default-ipv6]peer 2::2 enable[R2-bgp-default-ipv6]network 4:: 64[R2-bgp-default-ipv6]import-route direct [R2-bgp-default-ipv6]quit[R2-bgp-default]quitR3:<H3C>sysSystem View: return to User View with Ctrl+Z. [H3C]sysname R3[R3]int loopback 1[R3-LoopBack1]ip address 3.3.3.3 32[R3-LoopBack1]quit[R3]int loopback 0[R3-LoopBack0]ipv6 address 5::1 64[R3-LoopBack0]quit[R3]int gi 0/0[R3-GigabitEthernet0/0]des <connect to R2> [R3-GigabitEthernet0/0]ipv6 address 2::2 64 [R3-GigabitEthernet0/0]quit[R3]bgp 200[R3-bgp-default]router-id 3.3.3.3[R3-bgp-default]peer 2::1 as-number 100 [R3-bgp-default]address-family ipv6 unicast [R3-bgp-default-ipv6]peer 2::1 enable[R3-bgp-default-ipv6]network 5:: 64[R3-bgp-default-ipv6]quit[R3-bgp-default]quit分别查看R1、R2、R3的路由表:查看R1的BGP邻居信息:查看R2的BGP邻居信息:查看R3的BGP邻居信息:查看R1的IPV6 BGP路由表:查看R2的IPV6 BGP路由表:[R2]dis bgp routing-table ipv6Total number of routes: 8BGP local router ID is 2.2.2.2Status codes: * - valid, > - best, d - dampened, h - historys - suppressed, S - stale, i - internal, e - externala - additional-pathOrigin: i - IGP, e - EGP, ? - incomplete* > Network : 1:: PrefixLen : 64 NextHop : :: LocPrf :PrefVal : 32768 OutLabel : NULL MED : 0Path/Ogn: ?* > Network : 1::2 PrefixLen : 128 NextHop : ::1 LocPrf :PrefVal : 32768 OutLabel : NULL MED : 0Path/Ogn: ?* > Network : 2:: PrefixLen : 64 NextHop : :: LocPrf :PrefVal : 32768 OutLabel : NULL MED : 0Path/Ogn: ?* > Network : 2::1 PrefixLen : 128 NextHop : ::1 LocPrf :PrefVal : 32768 OutLabel : NULL MED : 0Path/Ogn: ?* >i Network : 3:: PrefixLen : 64 NextHop : 1::1 LocPrf : 100 PrefVal : 0 OutLabel : NULL MED : 0Path/Ogn: i* > Network : 4:: PrefixLen : 64 NextHop : :: LocPrf :PrefVal : 32768 OutLabel : NULLMED : 0Path/Ogn: i* > Network : 4::1 PrefixLen : 128 NextHop : ::1 LocPrf :PrefVal : 32768 OutLabel : NULL MED : 0Path/Ogn: ?* >e Network : 5:: PrefixLen : 64 NextHop : 2::2 LocPrf :PrefVal : 0 OutLabel : NULL MED : 0Path/Ogn: 200i[R2]查看R3的IPV6 BGP路由表:在R1使用loopback0作为源能PING通R2和R3的loopback0:在R2使用loopback0作为源能PING通R1和R3的loopback0:在R3使用loopback0作为源能PING通R1和R1的loopback0:至此,IPV6之IBGP 一级RR路由反射器典型组网配置案例已完成!。
CISCO 路由器OSPF+MPLS+BGP配置实例二OO八年九月四日目录一、网络环境 (3)二、网络描述 (3)三、网络拓扑图 (4)四、P路由器配置 (4)五、PE1路由器配置 (6)六、PE2路由器配置 (9)七、CE1路由器配置 (11)八、CE2路由器配置 (13)九、业务测试 (14)一、网络环境由5台CISCO7204组成的网络,一台为P路由器,两台PE路由器,两台CE 路由器;二、网络描述在P和两台PE路由器这间通过OSPF动态路由协议完成MPLS网络的建立,两台PE路由器这间启用BGP路由协议,在PE路由器上向所属的CE路由器指VPN 路由,在CE路由器中向PE路由器配置静态路由。
配置思路:1、在P和两台PE路由器这间通过OSPF动态路由协议,在P和PE路由器两两互连的端口上启用MPLS,两台PE之间的路为备份路由,这属公网路由。
2、两台PE路由器这间启用BGP路由协议,这使得属于VPN的IP地址能在两个网络(两台CE所属的网络)互相发布,这属私网(VPN)路由。
3、在PE路由器上向所属的CE路由器指VPN路由,这打通了两个网络(两台CE所属的网络)之间的路由。
三、网络拓扑图P路由器(r1)(r4) CE1路由器(r5)LOOP0:192.168.3.1/24LOOP0:192.168.4.1/24四、P路由器配置p#SHOW RUNBuilding configuration...Current configuration : 1172 bytes!version 12.3service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname p!boot-start-markerboot-end-marker!!no aaa new-modelip subnet-zero!!!ip cefip audit po max-events 100!!interface Loopback0ip address 202.98.4.3 255.255.255.255 !interface FastEthernet0/0description to_r2ip address 10.1.1.10 255.255.255.252 ip ospf cost 20duplex fulltag-switching mtu 1508tag-switching ip!interface FastEthernet1/0description to_r3ip address 10.1.1.6 255.255.255.252 ip ospf cost 20duplex fulltag-switching mtu 1508tag-switching ip!interface FastEthernet2/0no ip addressshutdownduplex half!interface FastEthernet3/0no ip addressshutdownduplex half!router ospf 100log-adjacency-changesredistribute connected subnets redistribute static subnetsnetwork 10.1.1.6 0.0.0.0 area 0 network 10.1.1.10 0.0.0.0 area 0!ip classlessno ip http serverno ip http secure-server!gatekeepershutdown!!line con 0exec-timeout 0 0logging synchronousstopbits 1line aux 0stopbits 1line vty 0 4login!!endp#五、PE1路由器配置pe1#show runBuilding configuration...Current configuration : 1813 bytes!version 12.3service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption!hostname pe1!boot-start-markerboot-end-marker!!no aaa new-modelip subnet-zero!!!ip vrf vpnard 1:100route-target export 200:1route-target import 200:1!ip cefip audit po max-events 100!!interface Loopback0ip address 202.98.4.1 255.255.255.255!interface FastEthernet0/0description to_r5ip vrf forwarding vpnaip address 172.16.1.1 255.255.255.252 duplex fulltag-switching ip!interface FastEthernet1/0description to_r1ip address 10.1.1.5 255.255.255.252ip ospf cost 20duplex fulltag-switching mtu 1508tag-switching ip!interface FastEthernet2/0ip address 10.1.1.1 255.255.255.252ip ospf cost 100duplex fulltag-switching mtu 1508tag-switching ip!interface FastEthernet3/0no ip addressshutdownduplex half!router ospf 100log-adjacency-changesredistribute connected metric-type 1 subnetsnetwork 10.1.1.0 0.0.0.255 area 0network 202.98.4.0 0.0.0.255 area 0!router bgp 100no bgp default ipv4-unicastbgp log-neighbor-changesneighbor 202.98.4.2 remote-as 100neighbor 202.98.4.2 update-source Loopback0 neighbor 202.98.4.2 version 4!address-family vpnv4neighbor 202.98.4.2 activateneighbor 202.98.4.2 send-community extendedexit-address-family!address-family ipv4 vrf vpnaredistribute connectedredistribute staticno auto-summaryno synchronizationexit-address-family!ip classlessip route vrf vpna 192.168.3.0 255.255.255.0 172.16.1.2 no ip http serverno ip http secure-server!ip ospf name-lookup!!gatekeepershutdown!!line con 0exec-timeout 0 0logging synchronousstopbits 1line aux 0stopbits 1line vty 0 4login!!endpe1#六、PE2路由器配置pe2#show runBuilding configuration...Current configuration : 1725 bytes!version 12.3service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption!hostname pe2!boot-start-markerboot-end-marker!!no aaa new-modelip subnet-zero!!!ip vrf vpnard 1:100route-target export 200:1route-target import 200:1!ip cefip audit po max-events 100!!interface Loopback0ip address 202.98.4.2 255.255.255.255 !interface FastEthernet0/0description to_r1ip address 10.1.1.9 255.255.255.252ip ospf cost 20duplex fulltag-switching ip!interface FastEthernet1/0ip vrf forwarding vpnaip address 172.16.2.1 255.255.255.0duplex fulltag-switching ip!interface FastEthernet2/0ip address 10.1.1.2 255.255.255.252ip ospf cost 100duplex fulltag-switching ip!interface FastEthernet3/0no ip addressshutdownduplex half!router ospf 100log-adjacency-changesredistribute connected metric 1 subnets redistribute static metric-type 1 subnets network 10.1.1.0 0.0.0.255 area 0!router bgp 100no bgp default ipv4-unicastbgp log-neighbor-changesneighbor 202.98.4.1 remote-as 100neighbor 202.98.4.1 update-source Loopback0 neighbor 202.98.4.1 version 4!address-family vpnv4neighbor 202.98.4.1 activateneighbor 202.98.4.1 send-community extended exit-address-family!address-family ipv4 vrf vpnaredistribute connectedredistribute staticno auto-summaryno synchronizationexit-address-family!ip classlessip route vrf vpna 192.168.4.0 255.255.255.0 172.16.2.2 no ip http serverno ip http secure-server!gatekeepershutdown!!line con 0exec-timeout 0 0logging synchronousstopbits 1line aux 0stopbits 1line vty 0 4login!!End七、CE1路由器配置ce1#show runBuilding configuration...Current configuration : 892 bytes!version 12.3service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname ce1!boot-start-markerboot-end-marker!!no aaa new-modelip subnet-zero!!!ip cefip audit po max-events 100!!interface Loopback0ip address 192.168.3.1 255.255.255.0 !interface FastEthernet0/0description to_r3ip address 172.16.1.2 255.255.255.252 duplex full!interface FastEthernet1/0no ip addressshutdownduplex half!interface FastEthernet2/0no ip addressshutdownduplex half!interface FastEthernet3/0no ip addressshutdownduplex half!ip classlessip route 0.0.0.0 0.0.0.0 172.16.1.1no ip http serverno ip http secure-server!!!gatekeepershutdown!!line con 0exec-timeout 0 0logging synchronousstopbits 1line aux 0stopbits 1line vty 0 4login!!end八、CE2路由器配置Ce2#show runBuilding configuration...*Sep 3 13:53:56.167: %SYS-5-CONFIG_I: Configured from console by console Current configuration : 888 bytes!version 12.3service timestamps debug datetime msecservice timestamps log datetime msecno service password-encryption!hostname ce2!boot-start-markerboot-end-marker!!no aaa new-modelip subnet-zero!!!ip cefip audit po max-events 100!!interface Loopback0ip address 10.10.13.1 255.255.255.0!interface FastEthernet0/0no ip addressshutdownduplex half!interface FastEthernet1/0description to_r2ip address 10.10.12.2 255.255.255.0duplex full!interface FastEthernet2/0no ip addressshutdownduplex half!interface FastEthernet3/0no ip addressshutdownduplex half!ip classlessip route 0.0.0.0 0.0.0.0 172.16.2.1no ip http serverno ip http secure-server!!gatekeepershutdown!!line con 0exec-timeout 0 0logging synchronousstopbits 1line aux 0stopbits 1line vty 0 4login!!end九、业务测试ce1# ping 172.16.1.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 96/190/324 ms ce1#ce2#ping 192.168.3.1Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 192.168.3.1, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 336/468/588 ms ce2#。
BGP配置实验案例BGP(边界网关协议)是一个用于在互联网中交换路由信息的协议。
在本篇文章中,我们将探讨一个BGP配置实验案例,其中包括两个自治系统(AS)之间的BGP邻居关系的建立和路由的传递。
这个实验案例可以帮助读者更好地理解BGP协议的工作原理和配置步骤。
在这个实验案例中,我们有两个自治系统:AS1和AS2、AS1拥有IP 地址段192.168.0.0/24,AS2拥有IP地址段10.0.0.0/24、我们的目标是在两个自治系统之间建立BGP邻居关系,并实现路由的传递。
首先,我们需要在两个自治系统中配置BGP路由器。
在AS1中,我们选择一个路由器作为BGP路由器,并配置其Loopback接口的IP地址为192.168.0.1、在AS2中,选择另一个路由器作为BGP路由器,并配置其Loopback接口的IP地址为10.0.0.1、这些Loopback接口的IP地址将用作BGP邻居之间的通信地址。
接下来,我们开始配置BGP邻居关系。
在AS1中,我们需要告诉BGP 路由器与AS2的BGP路由器建立邻居关系。
假设AS2的BGP路由器的IP 地址为10.0.0.2,我们将在AS1的BGP路由器上执行以下命令:``````同样地,在AS2的BGP路由器上,我们需要告诉其与AS1的BGP路由器建立邻居关系。
假设AS1的BGP路由器的IP地址为192.168.0.1,我们将在AS2的BGP路由器上执行以下命令:``````配置完BGP邻居关系后,我们可以开始传递路由信息。
在AS1中,我们希望将本地的IP地址段192.168.0.0/24传输给AS2、我们需要在AS1的BGP路由器上执行以下命令:```network 192.168.0.0 mask 255.255.255.0```这些命令告诉AS1的BGP路由器将地址段192.168.0.0/24传输给BGP邻居。
同样地,在AS2中,我们希望将本地的IP地址段10.0.0.0/24传输给AS1、我们需要在AS2的BGP路由器上执行以下命令:```network 10.0.0.0 mask 255.255.255.0```这些命令告诉AS2的BGP路由器将地址段10.0.0.0/24传输给BGP邻居。
去年12月的时候做了一个项目,中间碰到一个问题,今天写出来跟大家分享一下。
项目概况是这样的,国家电网的一市局,市局里放了两台NE20E-8的路由器,做为全市的核心路由器,每台NE20E-8用一个CPOS口通过传输设备复用出多个2M线路,下接多个变电所,变电所路由器为cisco的2811路由器。
cisco 2811路由器与两台NE20E-8组成一个链路双归网络,cisco 2811、两台NE20E-8路由器均为PE设备,两台NE20E-8做为全市的路由反射器,变电所的cisco2811路由器只与两台NE20E-8路由器建立BGP邻居关系。
全市存在两个VPN(MPLS/VPN),分别以VRF A和VRF B表示,两台NE20E-8使用upe 方式向cisco2811下发缺省路由引导上行流量,在cisco 2811中重分布直连路由。
以下为网络示意图:以下为三台设备的配置文件NE20E-8A:dis cu#sysname HZLA-NE20E-8A#router id 33.10.191.11#diffserv domain#ip vpn-instance realtimeroute-distinguisher 2007:1vpn-target 30033:11 export-extcommunityvpn-target 30033:1 30033:11 30033:13 import-extcommunity #ip vpn-instance nrtroute-distinguisher 2007:2vpn-target 30033:12 export-extcommunityvpn-target 30033:2 30033:12 30033:14 import-extcommunity #mpls lsr-id 33.10.191.11mpls#mpls ldp#controller Cpos3/0/0e1 6 channel-set 0 timeslot-list 1-31#interface Aux0async mode flowlink-protocol ppp#interface Ethernet1/0/0#interface Ethernet1/0/1#interface Ethernet1/0/2#interface Ethernet1/0/3#interface Ethernet1/0/4description LINK_TO_HZ-NE20-8Aip address 33.10.190.6 255.255.255.252mplsmpls ldp#interface Ethernet1/0/5#interface Ethernet1/0/6#interface Ethernet1/0/7#interface Ethernet2/0/0#interface Ethernet2/0/1#interface Ethernet2/0/2description LINK_TO_HZLA-NE20-8Bip address 33.10.190.61 255.255.255.252 mplsmpls ldp#interface Ethernet2/0/3#interface Ethernet2/0/4#interface Ethernet2/0/5#interface Ethernet2/0/6#interface Ethernet2/0/6.100vlan-type dot1q 100description LINK_TO_HZLA-S3328TP-RT ip binding vpn-instance realtimeip address 33.10.190.209 255.255.255.252 #interface Ethernet2/0/6.200vlan-type dot1q 200description realtimeip binding vpn-instance realtimeip address 10.33.177.94 255.255.255.224 vrrp vrid 200 virtual-ip 10.33.177.94#interface Ethernet2/0/7#interface Ethernet4/0/0#interface Ethernet4/0/1#interface Ethernet4/0/2#interface Ethernet4/0/3#interface Ethernet4/0/4#interface Ethernet4/0/5#interface Ethernet4/0/6#interface Ethernet4/0/6.300#interface Ethernet4/0/6.400description nrt#interface Ethernet4/0/7#interface Serial3/0/0/6:0link-protocol pppdescription xiushuiip address 33.10.177.217 255.255.255.252 mplsmpls ldp#interface GigabitEthernet0/0/1#interface GigabitEthernet0/0/2#interface NULL0#interface LoopBack0ip address 33.10.191.11 255.255.255.255 #bgp 30033group 500 internalpeer 500 connect-interface LoopBack0 peer 33.10.191.131 as-number 30033 peer 33.10.191.131 group 500group 300 internalpeer 300 connect-interface LoopBack0 peer 33.10.191.1 as-number 30033peer 33.10.191.1 group 300peer 33.10.191.12 as-number 30033peer 33.10.191.12 group 300#ipv4-family unicastundo synchronizationreflector cluster-id 100.100.100.100peer 300 enablepeer 33.10.191.1 enablepeer 33.10.191.1 group 300peer 33.10.191.12 enablepeer 33.10.191.12 group 300peer 500 enablepeer 500 reflect-clientpeer 33.10.191.131 enablepeer 33.10.191.131 group 500#ipv4-family vpnv4reflector cluster-id 100.100.100.100policy vpn-targetpeer 300 enablepeer 33.10.191.1 enablepeer 33.10.191.1 group 300peer 33.10.191.12 enablepeer 33.10.191.12 group 300peer 500 enablepeer 500 reflect-clientpeer 500 upepeer 500 default-originate vpn-instance realtimepeer 500 default-originate vpn-instance nrtpeer 33.10.191.131 enablepeer 33.10.191.131 group 500#ipv4-family vpn-instance realtimeimport-route directimport-route static#ipv4-family vpn-instance nrtimport-route directimport-route static#aaalocal-user admin password cipher .]@USE=B,53Q=^Q`MAF4<1!! local-user admin service-type telnetlocal-user admin level 15authentication-scheme default#authorization-scheme default#accounting-scheme default#domain default##ospf 1area 0.0.0.21network 33.10.191.11 0.0.0.0network 33.10.190.4 0.0.0.3network 33.10.190.60 0.0.0.3network 33.10.177.216 0.0.0.3#nqa-jitter tag-version 1#snmp-agentsnmp-agent local-engineid 000007DB7F00000100004E8Bsnmp-agent community write Zpepbdc@sjwsnmp-agent community read huaWei8zjepsnmp-agent sys-info version allsnmp-agent target-host trap address udp-domain 10.33.223.178 params securityname huaWei8zjepsnmp-agent target-host trap address udp-domain 10.33.223.179 params securityname huaWei8zjepsnmp-agent trap enable standardsnmp-agent trap source LoopBack0#user-interface con 0user-interface aux 0user-interface vty 0 4authentication-mode aaa#returnNE20—B:dis cu#sysname HZLA-NE20E-8B#router id 33.10.191.12#diffserv domain#ip vpn-instance realtimeroute-distinguisher 2008:1vpn-target 30033:11 export-extcommunityvpn-target 30033:1 30033:11 30033:13 import-extcommunity#ip vpn-instance nrtroute-distinguisher 2008:2vpn-target 30033:12 export-extcommunityvpn-target 30033:2 30033:12 30033:14 import-extcommunitympls lsr-id 33.10.191.12mpls#mpls ldp#controller Cpos3/0/0e1 6 channel-set 0 timeslot-list 1-31#interface Aux0async mode flowlink-protocol ppp#interface Ethernet1/0/0#interface Ethernet1/0/1#interface Ethernet1/0/2#interface Ethernet1/0/3#interface Ethernet1/0/4#interface Ethernet1/0/5#interface Ethernet1/0/6#interface Ethernet1/0/7#interface Ethernet2/0/0#interface Ethernet2/0/1#interface Ethernet2/0/2description LINK_TO_HZLA-NE20-8A ip address 33.10.190.62 255.255.255.252 mplsmpls ldp#interface Ethernet2/0/3#interface Ethernet2/0/4#interface Ethernet2/0/5interface Ethernet2/0/6#interface Ethernet2/0/6.300vlan-type dot1q 300description LINK_TO_HZLA-S3328TP-NRT ip binding vpn-instance nrtip address 33.10.190.217 255.255.255.252#interface Ethernet2/0/6.400vlan-type dot1q 400description nrtip binding vpn-instance nrtip address 10.33.177.126 255.255.255.224 vrrp vrid 40 virtual-ip 10.33.177.126#interface Ethernet2/0/7#interface Ethernet4/0/0#interface Ethernet4/0/1#interface Ethernet4/0/2#interface Ethernet4/0/3#interface Ethernet4/0/4description LINK_TO_HZFY-NE20-8Aip address 33.10.190.58 255.255.255.252 mplsmpls ldp#interface Ethernet4/0/5#interface Ethernet4/0/6#interface Ethernet4/0/6.100#interface Ethernet4/0/6.200description realtime#interface Ethernet4/0/7#interface Serial3/0/0/6:0link-protocol pppdescription xiushuiip address 33.10.226.217 255.255.255.252 mplsmpls ldp#interface GigabitEthernet0/0/1#interface GigabitEthernet0/0/2#interface NULL0#interface LoopBack0ip address 33.10.191.12 255.255.255.255 #bgp 30033group 500 internalpeer 500 connect-interface LoopBack0 peer 33.10.191.131 as-number 30033 peer 33.10.191.131 group 500group 300 internalpeer 300 connect-interface LoopBack0 peer 33.10.191.11 as-number 30033peer 33.10.191.11 group 300peer 33.10.191.9 as-number 30033peer 33.10.191.9 group 300#ipv4-family unicastundo synchronizationreflector cluster-id 100.100.100.100peer 300 enablepeer 33.10.191.11 enablepeer 33.10.191.11 group 300peer 33.10.191.9 enablepeer 33.10.191.9 group 300peer 500 enablepeer 33.10.191.131 enablepeer 33.10.191.131 group 500#ipv4-family vpnv4reflector cluster-id 100.100.100.100 policy vpn-targetpeer 300 enablepeer 33.10.191.11 enablepeer 33.10.191.11 group 300peer 33.10.191.9 enablepeer 33.10.191.9 group 300peer 500 enablepeer 500 reflect-clientpeer 500 upepeer 500 default-originate vpn-instance realtimepeer 500 default-originate vpn-instance nrtpeer 33.10.191.131 enablepeer 33.10.191.131 group 500#ipv4-family vpn-instance realtimeimport-route directimport-route static#ipv4-family vpn-instance nrtimport-route directimport-route static#aaalocal-user admin password cipher .]@USE=B,53Q=^Q`MAF4<1!! local-user admin service-type telnetlocal-user admin level 15authentication-scheme default#authorization-scheme default#accounting-scheme default#domain default##ospf 1import-route directarea 0.0.0.21network 33.10.191.12 0.0.0.0network 33.10.190.60 0.0.0.3network 33.10.190.56 0.0.0.3network 33.10.226.216 0.0.0.3#nqa-jitter tag-version 1#snmp-agentsnmp-agent local-engineid 000007DB7F00000100004E8Bsnmp-agent community write Zpepbdc@sjwsnmp-agent community read huaWei8zjepsnmp-agent sys-info version allsnmp-agent target-host trap address udp-domain 10.33.223.178 params securityname huaWei8zjepsnmp-agent target-host trap address udp-domain 10.33.223.179 params securityname huaWei8zjepsnmp-agent trap enable standardsnmp-agent trap source LoopBack0#user-interface con 0user-interface aux 0user-interface vty 0 4authentication-mode aaa#returncisco 2811LAXIUSHUI-R2811-1#sho runBuilding configuration...Current configuration : 3511 bytes!version 12.4no service padservice timestamps debug datetime msecservice timestamps log datetime msecservice password-encryption!hostname LAXIUSHUI-R2811-1!boot-start-markerboot-end-marker!card type e1 0 1logging message-counter syslogenable secret 5 $1$0LKz$71.irTxS.bL56D.GD74lD/!no aaa new-modelclock timezone CST 8no network-clock-participate wic 1!dot11 syslogno ip source-routeno ip gratuitous-arps!!ip cefip vrf nrtrd 2406:2route-target export 30033:14route-target import 30033:2route-target import 30033:12!ip vrf realtimerd 2406:1route-target export 30033:13route-target import 30033:1route-target import 30033:11!!!no ipv6 cef!multilink bundle-name authenticated !!!!!!!!!!!!!!!!!!!!!!!voice-card 0!!!!!archivelog confighidekeys!!!!!controller E1 0/1/0framing NO-CRC4clock source internalchannel-group 0 timeslots 1-31!controller E1 0/1/1framing NO-CRC4clock source internalchannel-group 0 timeslots 1-31!!!!!interface Loopback0ip address 33.10.191.131 255.255.255.255 !interface FastEthernet0/0ip address 192.168.1.1 255.255.255.0 duplex autospeed auto!interface FastEthernet0/1no ip addressshutdownduplex autospeed auto!interface FastEthernet0/0/0description ***TO LAXIUSHUI-C2918-01 G0/24*** switchport mode trunk!interface FastEthernet0/0/1description ***TO LAXIUSHUI-C2918-02 G0/24*** switchport mode trunk!interface FastEthernet0/0/2!interface FastEthernet0/0/3!interface Serial0/1/0:0description ***TO LINAN-NE20-A ....***ip address 33.10.177.218 255.255.255.252 encapsulation pppmpls ip!interface Serial0/1/1:0description ***TO LINAN-NE20-B ....***ip address 33.10.226.218 255.255.255.252 encapsulation pppmpls ip!interface Vlan1no ip address!interface Vlan10ip vrf forwarding realtimeip address 33.10.234.97 255.255.255.248!interface Vlan20ip vrf forwarding nrtip address 33.10.234.105 255.255.255.248!interface Vlan30description management-realtimeip vrf forwarding realtimeip address 33.10.185.218 255.255.255.252ip access-group 100 in!interface Vlan40description management-nrtip vrf forwarding nrtip address 33.10.189.218 255.255.255.252!router ospf 1router-id 33.10.191.131log-adjacency-changesnetwork 33.10.177.216 0.0.0.3 area 21 network 33.10.191.131 0.0.0.0 area 21 network 33.10.226.216 0.0.0.3 area 21 !router bgp 30033bgp router-id 33.10.191.131no bgp default ipv4-unicastbgp log-neighbor-changesneighbor 500 peer-groupneighbor 500 remote-as 30033 neighbor 500 update-source Loopback0 neighbor 33.10.191.11 peer-group 500 neighbor 33.10.191.12 peer-group 500 !address-family ipv4neighbor 33.10.191.11 activate neighbor 33.10.191.12 activateno auto-summaryno synchronizationexit-address-family!address-family vpnv4neighbor 500 send-community extended neighbor 33.10.191.11 activate neighbor 33.10.191.12 activateexit-address-family!address-family ipv4 vrf realtime redistribute connectedredistribute staticno synchronizationexit-address-family!address-family ipv4 vrf nrt redistribute connectedredistribute staticno synchronizationexit-address-family!ip forward-protocol ndno ip http serverno ip http secure-server!!!!!!!!!control-plane!!!!!!!!!!line con 0line aux 0line vty 0 4exec-timeout 5 0password 7 1511021F07257A767Blogin!scheduler allocate 20000 1000end正常情况下,按照上面的配置,网络是不会有问题的,但当天做完后,发现网络不通,经检查,发现cisco 2811中每个vrf中均上存在一条缺省路由,为bgp路由是指向NE20-A 的(优选router-ID小的),这条路由是正常的。
操纵BGP路径选择---local preference属性案例本地优先级(local pref)属性是分配给路由的一种优先级度量,用于和到同一目的地的其他路由相比较。
这是BGP路由处理中的第二优先属性(WEIGHT是第一优先属性)。
Local Pref属性只在本AS内部有效,不会被传送到EBGP邻居上。
本地优先级越高,路由优先级越高。
以上案例中,我们通过对R3的配置,设置从R1学到的1.0.0.0的本地优先级(Localpref)设置为200,由于缺省的值为100,AS200中所有的路由器都会选择R3到达1.0.0.0。
//// r1 ////int f2/0ip ad 192.1.1.1 255.255.255.0int f3/0ip ad 193.1.1.1 255.255.255.0int lo0ip ad 1.1.1.1 255.255.255.0int lo1ip ad 2.2.2.2 255.255.255.0router bgp 100no synneighbor 192.1.1.2 remote-as 200neighbor 193.1.1.3 remote-as 200network 1.0.0.0network 1.0.0.0//// r2 ////int f2/0ip ad 192.1.1.2 255.255.255.0int f4/0ip ad 194.1.1.2 255.255.255.0router os 1netw 0.0.0.0 255.255.255.255 a 0passive-interface f2/0router bgp 200no synneighbor 192.1.1.1 remote-as 100neighbor 194.1.1.4 remote-as 200neighbor 195.1.1.3 remote-as 200neighbor 194.1.1.4 next-hop-self//// r3 ////int f3/0ip ad 193.1.1.3 255.255.255.0int f5/0ip ad 195.1.1.3 255.255.255.0router os 1netw 0.0.0.0 255.255.255.255 a 0passive-interface f3/0router bgp 200no synneighbor 193.1.1.1 remote-as 100neighbor 195.1.1.4 remote-as 200neighbor 195.1.1.4 next-hop-selfneighbor 194.1.1.2 remote-as 200 neighbor 193.1.1.1 route-map localpref inaccess-list 1 permit 1.0.0.0 0.255.255.255route-map localpref permit 10match ip ad 1set local-pref 200route-map localpref permit 20set local-pref 100//// r4 ////int f4/0ip ad 194.1.1.4 255.255.255.0int f5/0ip ad 195.1.1.4 255.255.255.0int lo0ip ad 4.4.4.4 255.255.255.0router os 1netw 0.0.0.0 255.255.255.255 a 0router bgp 200no synneighbor 194.1.1.2 remote-as 200neighbor 195.1.1.3 remote-as 200netw 4.0.0.0验证://// r4 ////r4#sh ip bgpNetwork Next Hop Metric LocPrf Weight Path *>i1.0.0.0 195.1.1.3 0 200 0 100 i * i2.0.0.0 195.1.1.3 0 100 0 100 i *>i 194.1.1.2 0 100 0 100 i *> 4.0.0.0 0.0.0.0 0 32768 ir4#sh ip roB 1.0.0.0/8 [200/0] via 195.1.1.3, 00:02:20B 2.0.0.0/8 [200/0] via 194.1.1.2, 00:02:244.0.0.0/24 is subnetted, 1 subnetsC 4.4.4.0 is directly connected, Loopback0O 193.1.1.0/24 [110/128] via 195.1.1.3, 00:04:35, Serial5/0O 192.1.1.0/24 [110/128] via 194.1.1.2, 00:04:35, Serial4/0C 195.1.1.0/24 is directly connected, Serial5/0C 194.1.1.0/24 is directly connected, Serial4/0r2#sh ip bgpNetwork Next Hop Metric LocPrf Weight Path *>i1.0.0.0 193.1.1.1 0 200 0 100 i * 192.1.1.1 0 0 100 i * i2.0.0.0 193.1.1.1 0 100 0 100 i *> 192.1.1.1 0 0 100 i *>i4.0.0.0 194.1.1.4 0 100 0 ir2#sh ip roB 1.0.0.0/8 [200/0] via 193.1.1.1, 00:06:00B 2.0.0.0/8 [20/0] via 192.1.1.1, 00:06:044.0.0.0/8 is variably subnetted, 2 subnets, 2 masksO 4.4.4.4/32 [110/65] via 194.1.1.4, 00:08:20, Serial4/0B 4.0.0.0/8 [200/0] via 194.1.1.4, 00:06:55O 193.1.1.0/24 [110/192] via 194.1.1.4, 00:08:20, Serial4/0C 192.1.1.0/24 is directly connected, Serial2/0O 195.1.1.0/24 [110/128] via 194.1.1.4, 00:08:20, Serial4/0C 194.1.1.0/24 is directly connected, Serial4/0。
迈普路由器BGP基本配置示例随着互联网的发展,网络规模逐渐扩大,大型企事业单位的网络也越来越复杂。
在这样的背景下,BGP(边界网关协议)作为一种最常用的外部网关协议,被广泛应用于企业网络中。
本文将为你介绍迈普路由器BGP基本配置示例,帮助你更好地理解和应用BGP协议。
1. 路由器基本设置首先,我们需要对迈普路由器进行基本设置。
打开终端连接迈普路由器,进入路由器的全局配置模式。
输入以下命令完成路由器的基本设置:hostname RouterAip address 192.168.1.1 255.255.255.0interface GigabitEthernet 0/0/0ip address 10.0.0.1 255.255.255.0以上命令中,设置了路由器的主机名为RouterA,配置了路由器的管理IP地址为192.168.1.1/24,同时设置了路由器的接口GigabitEthernet 0/0/0的IP地址为10.0.0.1/24。
2. BGP协议配置接下来,我们需要配置BGP协议。
BGP协议是一种路由选择协议,用于跨自治系统的路由选择。
输入以下命令完成BGP协议的基本配置:router bgp 65001bgp router-id 192.168.1.1neighbor 10.0.0.2 remote-as 65002network 192.168.1.0 mask 255.255.255.0以上命令中,设置了本路由器的自治系统号为65001,指定了本路由器的BGP路由器ID为192.168.1.1,同时配置了邻居路由器的IP地址为10.0.0.2,邻居路由器的自治系统号为65002。
最后,我们将本路由器的192.168.1.0/24网段添加到BGP路由表中。
3. BGP邻居关系建立在上一步中,我们配置了本路由器的邻居路由器的信息。
接下来,我们需要建立BGP邻居关系。
输入以下命令完成邻居关系的建立:neighbor 10.0.0.2 activateneighbor 10.0.0.2 next-hop-self以上命令中,首先激活邻居路由器10.0.0.2,然后指定本路由器作为下一跳地址。
【CCNP】BGP联盟配置案例版本V1.0密级☑开放☐内部☐机密类型☐讨论版☐测试版☑正式版1案例配置拓扑2案例配置需求1、如上图所示,IP地址规划方面,R2上有一环回接口loopback 200,地址为200.1.1.1/32,R5上有一环回接口loopback 100,地址为100.1.1.1/32,路由器互连的接口为172.8.AB.X/24(其中AB为路由器编号叠加,X为路由器编号,如R1连接R2的接口S0/0的地址为172.8.12.1/24)2、如图所示,联盟AS 100中有两个子AS,它们分别为AS 65501、AS 65502,配置R1与R2行成联盟iBGP邻居关系,R2与R3之间行成联盟eBGP邻居关系,R3与R4行成联盟iBGP邻居关系,R3与R5形成eBGP邻居关系,采用物理接口配置邻居建立;SPOTO 全球培训●项目●人才 1SPOTO 全球 培训 ● 项目 ● 人才2 3、 将R2的loopback 200、R5的loopback 100接口宣告到相应的BGP 中,观察联盟内部的特征;3 案例配置思路1、 R1上的关键配置:router bgp 65501 /联盟子AS/no synchronizationbgp log-neighbor-changesbgp confederation identifier 100 /指定对联盟外呈现的AS/ 雏鹰论坛CCNPneighbor 172.8.12.2 remote-as 65501no auto-summary2、 R2上的关键配置:router bgp 65501no synchronizationbgp log-neighbor-changesbgp confederation identifier 100bgp confederation peers 65502 /指定联盟内部eBGP 邻居关系的邻居AS/network 200.1.1.1 mask 255.255.255.255neighbor 172.8.12.1 remote-as 65501neighbor 172.8.23.3 remote-as 65502no auto-summary3、 R3上的关键配置:router bgp 65502no synchronizationbgp log-neighbor-changesbgp confederation identifier 100bgp confederation peers 65501neighbor 172.8.23.2 remote-as 65501neighbor 172.8.34.4 remote-as 65502neighbor 172.8.35.5 remote-as 200no auto-summary4、 R4上的关键配置:router bgp 65502SPOTO 全球 培训 ● 项目 ● 人才3 no synchronizationbgp log-neighbor-changesbgp confederation identifier 100neighbor 172.8.34.3 remote-as 65502no auto-summary5、 R5上的关键配置:router bgp 200no synchronizationbgp log-neighbor-changesnetwork 100.1.1.1 mask 255.255.255.255neighbor 172.8.35.3 remote-as 100no auto-summary4 案例检验结果1、 查看认证后BGP 邻居建立的情况:R5#show ip bgpBGP table version is 3, local router ID is 172.8.35.5Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,r RIB-failure, S StaleOrigin codes: i - IGP , e - EGP , ? - incompleteNetwork Next Hop Metric LocPrf Weight Path*> 100.1.1.1/32 0.0.0.0 0 32768 i*> 200.1.1.1/32 172.8.35.3 0 100 i/AS PATH 中不包含联盟内部的子AS/R3#show ip bgpBGP table version is 3, local router ID is 172.8.35.3Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,r RIB-failure, S StaleOrigin codes: i - IGP , e - EGP , ? - incomplete雏鹰论坛CCNPSPOTO 全球 培训 ● 项目 ● 人才4 Network Next Hop Metric LocPrf Weight Path*> 100.1.1.1/32 172.8.35.5 0 0 200 i*> 200.1.1.1/32 172.8.23.2 0 100 0 (65501) i/R3从R5学习到100.1.1.1/32,下一跳为172.8.35.5,从联盟AS 65501学习到了200.1.1.1/32,AS PATH 为(65501),括号()内的AS 不用来参与最短AS 比较,只是用来做防环/R4#show ip bgpBGP table version is 5, local router ID is 172.8.34.4Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,r RIB-failure, S StaleOrigin codes: i - IGP , e - EGP , ? - incompleteNetwork Next Hop Metric LocPrf Weight Path* i100.1.1.1/32 172.8.35.5 0 100 0 200 i* i200.1.1.1/32 172.8.23.2 0 100 0 (65501) i/下一跳不可达,所以不是最优路径/R2#show ip bgpBGP table version is 4, local router ID is 172.8.23.2Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,r RIB-failure, S StaleOrigin codes: i - IGP , e - EGP , ? - incompleteNetwork Next Hop Metric LocPrf Weight Path* 100.1.1.1/32 172.8.35.5 0 100 0 (65502) 200 i*> 200.1.1.1/32 0.0.0.0 0 32768 i/R2与R3在联盟内部是eBGP 的邻居关系,路由器从联盟外部的eBGP 邻居学习到的路由NEXT-HOP 属性在联盟内部予以保留并传递,Metric 属性在整个联盟予以保留,LocPrf 属性在整个联盟予以保留,而不是在分配它们成员的AS 内保留,R2由于下一跳172.8.35.5不可达,所以没有“>”,不是最佳路由/ 雏鹰论坛CCNPR1#show ip bgpBGP table version is 4, local router ID is 172.8.12.1SPOTO 全球 培训 ● 项目 ● 人才5 Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,r RIB-failure, S StaleOrigin codes: i - IGP , e - EGP , ? - incompleteNetwork Next Hop Metric LocPrf Weight Path*>i200.1.1.1/32 172.8.12.2 0 100 0 i/R1没有学习到100.1.1.1/32的路由是因为R2关于这条的路由下一跳不可达,不是最优路径,所以不会发送给R1 /5 案例数据抓包1、 R2/R3为联盟eBGP 邻居,R3发送Update Message 给R2时携带如下属性:2、 R3/R5为eBGP 邻居,R5发送Update Message 给R3时携带如下属性:SPOTO 全球 培训 ● 项目 ● 人才66 案例配置文件7 案例总结及其它1、 iBGP 邻居并不把路由信息从一个iBGP 邻居传播到另外一个iBGP 邻居。
实验3 BGP协议实验注意:为了提高效率,上传文件到服务器可以用在实验报告上粘贴相关内容的截图代替。
1.查看R1和R2的路由表,注入路由信息前,是否有对方loopback的路由信息?注入路由信息后,是否有对方loopback的路由信息?为什么?答:注入路由信息前,没有对方的loopback;注入路由信息后,有对方的loopback;因为没有注入路由信息前,5.5.5.5的路由信息不会被BGP转发。
2.[R2]ping –a 4.4.4.4 5.5.5.5 能否ping通?如果不用ping命令的-a参数是否能ping通?为什么?答:能ping通,如果不用-a不能ping通。
-a参数指定源地址,而如果不指定4.4.4.4为源地址,则源地址为2.1.1.2,而R1中没有2.1.1.2的路由信息,所以ping消息无法返回。
3.把所截报文命名为BGP1-学号,并上传到服务器。
根据截获的BGP报文的顺序和结构,填写下表。
4. 思考题:在实验截获的报文中是否有NOTIFICATION报文?为什么?答:没有,因为BGP运行正常没有出错。
5. 写出一个Update报文的完整结构,并指出报文中路由信息所携带的路由属性。
答:Marker(16 byte) 全1 检测BGP对等体之间的同步是否丢失Length(2 byte) 55 整个报文长度Type(1 byte) 2(UPDATE) 报文类型Withdrawn Routes Length(2 byte) 0 撤销路由长度Withdrawn Routes(变长0 byte) - 撤销路由Path Attribute Length(2 byte) 27 路径属性长度Path Attribute(27 byte) 见下路径属性ORIGIN(3+1=4 byte) 0(IGP) 起点属性AS_PATH(3+6=9 byte) 见下AS路径属性Segment type(1 byte) 2(AS_SEQUENCE)Segment length(1 byte) 1AS4(4byte) 100NEXT_HOP(3+4=7 byte) 1.1.1.1 下一跳属性MED(3+4=7 byte) 0 部邻居路由器进AS内的优先路径此Update报文共携带以上4个路由属性。
BGP后门链路(Backdoor)实际案例(配图+详细验证过程Cisco提供一种方式强IGP路由优先于EBGP路由.这个概念也就是"后门链路"(backdoor link).EBGP 路由可以标记为后门链路,它将设置这些路由的管理距离与BGP本地或200相同.因为这个管理距离要高于IGP,所以首选IGP路由.以下是具体配置://// r1 ////int lo0ip ad 1.1.1.1 255.255.255.0int e1/0ip ad 192.1.1.1 255.255.255.0router os 1network 0.0.0.0 255.255.255.255 a 0 //将所有接口宣告进OSPFrouter bgp 200no syn //关闭同步,同时也注定了全互连的拓扑neighbor 192.1.1.2 remote-as 200neighbor 192.1.1.2 update-source lo0 //以lo0接口IP作为更新源地址//// r2 ////int lo0ip ad 2.2.2.2 255.255.255.0int e1/0ip ad 192.1.1.2 255.255.255.0int e0/0ip ad 193.1.1.2 255.255.255.0int e2/0ip ad 195.1.1.2 255.255.255.0router os 1network 0.0.0.0 255.255.255.255 a 0 //宣告所有接口进OSPFrouter bgp 200no synneighbor 192.1.1.1 remote-as 200neighbor 192.1.1.1 update-source lo0neighbor 192.1.1.1 next-hop-selfneighbor 195.1.1.5 remote-as 100network 192.1.1.0 mask 255.255.255.0//// r3 ////int lo0ip ad 3.3.3.3 255.255.255.0int e0/0ip ad 193.1.1.3 255.255.255.0int e1/0ip ad 194.1.1.3 255.255.255.0int e3/0ip ad 196.1.1.3 255.255.255.0router os 1netw 0.0.0.0 255.255.255.255 a 0router bgp 300no synneighbor 196.1.1.5 remote-as 100neighbor 194.1.1.4 remote-as 300neighbor 194.1.1.4 update-source lo0neighbor 194.1.1.4 next-hop-selfnetwork 194.1.1.0 mask 255.255.255.0//// r4 ////int lo0ip ad 4.4.4.4 255.255.255.0int e0/0ip ad 194.1.1.3 255.255.255.0router os 1network 0.0.0.0 255.255.255.255 a 0router bgp 300no synneighbor 194.1.1.3 remote-as 300neighbor 194.1.1.3 update-source lo0network 192.1.1.0 mask 255.255.255.0 backdoor//// r5 ////int lo0ip ad 5.5.5.5 255.255.255.0int e2/0ip ad 195.1.1.5 255.255.255.0int e3/0ip ad 196.1.1.5 255.255.255.0router bgp 100no synneighbor 195.1.1.2 remote-as 200neighbor 196.1.1.3 remote-as 300验证://后门链路作用前r2#sh ip bgpNetwork Next Hop Metric LocPrf Weight Path*> 192.1.1.0 0.0.0.0 0 32768 i*> 194.1.1.0 195.1.1.5 0 100 300 ir2#r2#r2#r2#sh ip ro bgpB 194.1.1.0/24 [20/0] via 195.1.1.5, 00:00:49r3#sh ip bgpNetwork Next Hop Metric LocPrf Weight Path *> 192.1.1.0 196.1.1.5 0 100 200 i *> 194.1.1.0 0.0.0.0 0 32768 ir3#sh ip ro bgpB 192.1.1.0/24 [20/0] via 196.1.1.5, 00:02:28r3#sh ip ro //后门链路作用前1.0.0.0/32 is subnetted, 1 subnetsO 1.1.1.1 [110/21] via 193.1.1.2, 00:04:22, Ethernet0/02.0.0.0/32 is subnetted, 1 subnetsO 2.2.2.2 [110/11] via 193.1.1.2, 00:04:22, Ethernet0/03.0.0.0/24 is subnetted, 1 subnetsC 3.3.3.0 is directly connected, Loopback04.0.0.0/32 is subnetted, 1 subnetsO 4.4.4.4 [110/11] via 194.1.1.4, 00:04:22, Ethernet1/0C 196.1.1.0/24 is directly connected, Serial3/0C 193.1.1.0/24 is directly connected, Ethernet0/0B 192.1.1.0/24 [20/0] via 196.1.1.5, 00:00:06O 195.1.1.0/24 [110/74] via 193.1.1.2, 00:04:22, Ethernet0/0 C 194.1.1.0/24 is directly connected, Ethernet1/0//后门链路作用后r3#sh ip ro1.0.0.0/32 is subnetted, 1 subnetsO 1.1.1.1 [110/21] via 193.1.1.2, 00:06:38, Ethernet0/02.0.0.0/32 is subnetted, 1 subnetsO 2.2.2.2 [110/11] via 193.1.1.2, 00:06:38, Ethernet0/03.0.0.0/24 is subnetted, 1 subnetsC 3.3.3.0 is directly connected, Loopback04.0.0.0/32 is subnetted, 1 subnetsO 4.4.4.4 [110/11] via 194.1.1.4, 00:06:38, Ethernet1/0C 196.1.1.0/24 is directly connected, Serial3/0C 193.1.1.0/24 is directly connected, Ethernet0/0O 192.1.1.0/24 [110/20] via 193.1.1.2, 00:00:06, Ethernet0/0O 195.1.1.0/24 [110/74] via 193.1.1.2, 00:06:38, Ethernet0/0 C 194.1.1.0/24 is directly connected, Ethernet1/0。
BGP配置及路由注入实例讲解路由协议包括很多种,例如RIP、OSPF、IS-IS、BGP等等。
前面部分章节已看过OSPF和ISIS的实例。
今天我们来看看BGP路由协议。
首先我们通过下图先来回顾一下BGP在网络中的部署位置:简单地说:BGP属于外部网关协议,一般部署于自治系统之间(例如我们在两个运营商之间部署,或两个大企业网之间部署。
当然有些运营商内部使用了多种IGP协议,此时也在一个运营商内部使用,此种场景多见于城域网-省网-国网)。
说到BGP路由协议,必然会涉及到路由注入(有些人也叫做路由引入import-route XXX)。
举个简单例子,有A和B两个企业(或运营商),均部署了不同的IGP路由协议,中间使用BGP连接。
其中B企业(运营商)内部建设了一个http网站,此时A企业(运营商)的客户需要访问该网站,则需要涉及路由注入。
一、BGP配置实例讲解1、配置环境:(1)基本组网图:(2)组网说明:1、上图中左侧为A企业,配置了IS-IS路由协议,右侧为B企业,配置了OSPF协议。
2、目前A企业内各设备能够通过IS-IS协议通信,B企业内各设备能够通过OSPF协议通信。
3、分别查看部署BGP前A-R1和B-R1的IP路由表,如下:4、因前期部分章节已说明ISIS和OSPF的配置,本节不再说明。
如有需要,请从上下载(文件位置:网站→文件共享→BGP配置实验,压缩包里有“配置bgp 前网络拓扑及数据配置”)2、配置目标:在路由器A-R1和B-R1之间部署EBGP,使用对端的物理接口作为反射器的源接口。
3、数据规划:4、配置步骤:配置BGP(包括AS、peer)a.配置路由器A-R1的BGP。
命令如下:bgp 65001router-id 1.1.1.1peer 12.12.12.2 as-number 65002peer 12.12.12.2 connect-interface GigabitEthernet 0/0/0quitb.配置路由器B-R1的BGP。