新网创想网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
1、实验拓扑
创新互联专注于企业全网营销推广、网站重做改版、寒亭网站定制设计、自适应品牌网站建设、H5页面制作、商城网站制作、集团公司官网建设、外贸营销网站建设、高端网站制作、响应式网页设计等建站业务,价格优惠性价比高,为寒亭等各大城市提供网站开发制作服务。2、基础配置
R1配置
interface Loopback0
ip address 1.1.1.1 255.255.255.0
interface Serial0/0
ip address 13.1.1.1 255.255.255.0
interface FastEthernet1/0
ip address 124.1.1.1 255.255.255.0
router ospf 110
log-adjacency-changes
network 1.1.1.0 0.0.0.255 area 0
network 124.1.1.0 0.0.0.255 area 0
router bgp 1
no synchronization
bgp router-id 1.1.1.1
neighbor 2.2.2.2 remote-as 1
neighbor 2.2.2.2 update-source Loopback0
neighbor 2.2.2.2 next-hop-self
neighbor 13.1.1.3 remote-as 3
no auto-summary
R2配置
interface Loopback0
ip address 2.2.2.2 255.255.255.0
interface FastEthernet1/0
ip address 124.1.1.2 255.255.255.0
router ospf 110
log-adjacency-changes
network 2.2.2.0 0.0.0.255 area 0
network 124.1.1.0 0.0.0.255 area 0
router bgp 1
no synchronization
bgp router-id 2.2.2.2
bgp log-neighbor-changes
neighbor 1.1.1.1 remote-as 1
neighbor 1.1.1.1 update-source Loopback0
neighbor 124.1.1.4 remote-as 4
no auto-summary
R3配置
interface Loopback0
ip address 3.3.3.3 255.255.255.0
interface Loopback16
ip address 202.1.16.3 255.255.255.0
interface Loopback17
ip address 202.1.17.3 255.255.255.0
interface Loopback18
ip address 202.1.18.3 255.255.255.0
interface Loopback19
ip address 202.1.19.3 255.255.255.0
interface Serial0/0
ip address 13.1.1.3 255.255.255.0
router bgp 3
no synchronization
bgp router-id 3.3.3.3
bgp log-neighbor-changes
network 3.3.3.0 mask 255.255.255.0
network 202.1.16.0
network 202.1.17.0
network 202.1.18.0
network 202.1.19.0
neighbor 13.1.1.1 remote-as 1
no auto-summary
R4配置
interface Loopback0
ip address 4.4.4.4 255.255.255.0
interface FastEthernet1/0
ip address 124.1.1.4 255.255.255.0
router bgp 4
no synchronization
bgp router-id 4.4.4.4
bgp log-neighbor-changes
network 4.4.4.0 mask 255.255.255.0
neighbor 124.1.1.2 remote-as 1
no auto-summary
3、配置聚合
BGP聚合可以使用两种方法:
方法一:手动写一条指向空接口的静态汇总路由,再在BGP路由进程汇总发布该汇总路由
方法二:先在BGP路由进程中network所有的明细路由,在用aggregate-address 202.1.16.0 255.255.252.0 做聚合,此时会将聚合路由和明细路由都通告出去,aggregate-address 202.1.16.0 255.255.252.0 summary-only将会抑制明细路由,标识为s,且不发给其他BGP邻居。
此外我们也可以指定不通告特定路由,基本步骤如下:
ip prefix-list 1 permit 202.1.16.0/23 ge 24 le 24
route-map YZ permit 10
match ip address prefix-list 1
router bgp 3
aggregate-address 202.1.16.0 255.255.252.0 suppress-map YZ
方法二是在发送方做聚合,如果在接收方做聚合,接收方生成聚合路由后会反传给发送方,此时将会产生丢包现象,所以不应该让聚合路由回传。为达到不会传的目的,我们采用BGP的水平分割技术,在聚合路由上加入明细路由的属性,这样当发送方收到聚合路由后,由于聚合路由携带有自身的AS号而不接受该路由,aggregate-address 202.1.16.0 255.255.252.0 summary-only as-set。
方法一:
R3配置
ip route 202.1.16.0 255.255.252.0 null0
router bgp 3
no network 202.1.16.0
no network 202.1.17.0
no network 202.1.18.0
no network 202.1.19.0
network 202.1.16.0 mask 255.255.252.0
方法二:
R3配置
no ip route 202.1.16.0 255.255.252.0 null0
router bgp 3
no network 202.1.16.0 mask 255.255.252.0
network 202.1.16.0
network 202.1.17.0
network 202.1.18.0
network 202.1.19.0
aggregate-address 202.1.16.0 255.255.252.0
aggregate-address 202.1.16.0 255.255.252.0 summary-only将会抑制明细路由,标识为s,且不发给其他BGP邻居。
router bgp 3
aggregate-address 202.1.16.0 255.255.252.0 summary-only
清除R3上的聚合,将聚合做在R1上。
router bgp 3
no aggregate-address 202.1.16.0 255.255.252.0 summary-only
router bgp 1
no aggregate-address 202.1.16.0 255.255.252.0 summary-only
router bgp 1
no aggregate-address 202.1.16.0 255.255.252.0 summary-only as-set
R1不再将聚合路由通告给R3。
另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。