【实验9.11.4c】 BGP团体属性【IEEEnjoy.L.ZH】

本文介绍了一个关于BGP团体属性的实验案例,演示了如何使用no-export命令控制路由信息仅传递给直接邻居对等体而不进一步传播,解决无法直接配置中间提供商的问题。

实验9.11.4c BGP团体属性

一、实验拓扑图:

 

二、实验目的:

       国际互联网培训中心ITAAISP是对等的互联关系,但ITAA会担心自己内部的网络被ISP通告给其他的对等体,而ITAA又不能直接配置ISP内部的路由器,所以采用团体属性(community no-export),禁止应用于策略的路有条目发布到下一个AS区域。

三、具体实验内容:

       步骤:

-实验基本配置(包括BGP的配置);

-在ITAA上配置团体属性,控制路由发布;

-结论

 

实验基本配置(包括BGP的配置):

ITAA#sh run

Building configuration...

 

Current configuration : 1573 bytes

!

version 12.3

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

!

hostname ITAA

interface Loopback0

 ip address 1.1.1.1 255.255.255.0

!      

interface Serial1/0

 ip address 192.168.1.1 255.255.255.252

 serial restart-delay 0

!

router bgp 100

 no synchronization

 bgp log-neighbor-changes

 network 1.1.1.0 mask 255.255.255.0

 neighbor 192.168.1.2 remote-as 200

 neighbor 192.168.1.2 send-community

 neighbor 192.168.1.2 route-map OUTLIMIT out

 no auto-summary

!

end

ISP#sh run

Building configuration...

 

Current configuration : 1389 bytes

!

version 12.3

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

!

hostname ISP

interface Loopback0

 ip address 2.2.2.2 255.255.255.0    

interface Serial1/0

 ip address 172.16.1.1 255.255.255.0

 serial restart-delay 0

!

interface Serial1/1

 ip address 192.168.1.2 255.255.255.252

 serial restart-delay 0

!

router bgp 200

 no synchronization

 bgp log-neighbor-changes

 network 2.2.2.0 mask 255.255.255.0

 neighbor 172.16.1.2 remote-as 400

 neighbor 192.168.1.1 remote-as 100

 no auto-summary  

end

OUT#sh run

Building configuration...

 

Current configuration : 1338 bytes

!

version 12.3

service timestamps debug datetime msec

service timestamps log datetime msec

no service password-encryption

!

hostname OUT

interface Loopback0

 ip address 3.3.3.3 255.255.255.0

!

interface Serial1/1

 ip address 172.16.1.2 255.255.255.0

 serial restart-delay 0

!

router bgp 400

 no synchronization

 bgp log-neighbor-changes

 network 3.3.3.0 mask 255.255.255.0

 neighbor 172.16.1.1 remote-as 200

 no auto-summary

end     

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ITAA上配置团体属性,控制路由发布:

在配置之前,我们查看一下OUT路由器上面的BGP表:

OUT#sh ip bgp

BGP table version is 4, local router ID is 3.3.3.3

   Network          Next Hop            Metric LocPrf Weight Path

*> 1.1.1.0/24       172.16.1.1                             0 200 100 i

*> 2.2.2.0/24       172.16.1.1               0             0 200 i

*> 3.3.3.0/24       0.0.0.0                  0         32768 i

条目中是有1.1.1.0的路由条目的,下面我们在ITAA上面配置团体属性,来达到控制路由发布的目的(前提还要保证ISP可以获得相应路由):

ITAA(config)#access-list 10 per 1.1.1.0 0.0.0.255

ITAA(config)#route-map OUTLIMIT per 10

ITAA(config-route-map)#match ip address 10

ITAA(config-route-map)#set community no-export

ITAA(config-route-map)#route-map OUTLIMIT per 20

ITAA(config-route-map)#exi

ITAA(config)#router bgp 100

ITAA(config-router)#nei 192.168.1.2 route-map OUTLIMIT out

ITAA(config-router)#nei 192.168.1.2 send-community

通过配置路由策略,控制1.1.1.0的网段通告给下一个AS(不包括ISP)。我们来验证一下:

查看OUT路由器上面的BGP表:

OUT#sh ip bgp

BGP table version is 7, local router ID is 3.3.3.3

   Network          Next Hop            Metric LocPrf Weight Path

*> 2.2.2.0/24       172.16.1.1               0             0 200 i

*> 3.3.3.0/24       0.0.0.0                  0         32768 i

可以看到,1.1.1.0的路由条目已经消失了,我们再来查看一下ISP上面的BGP条目:

ISP#sh ip bgp

BGP table version is 4, local router ID is 2.2.2.2

   Network          Next Hop            Metric LocPrf Weight Path

*> 1.1.1.0/24       192.168.1.1              0             0 100 i

*> 2.2.2.0/24       0.0.0.0                  0         32768 i

*> 3.3.3.0/24       172.16.1.2               0             0 400 i

很明显,1.1.1.0的条目很清楚的存在。

 

结论:

1.  团体属性中的no-export命令是在本地控制相隔一个AS的路由发布情况,也就是说,通过团体属性的控制可以实现只传给它的直接邻居对等体,而不继续传下去,这样也就解决了不能在类似于ISP这样的中间提供商直接配置的局限;

 

 

 
对于使用 `rpm -ivh` 安装 `bind-chroot-9.11.4-26.P2.el7.x86_64.rpm` 时出现的依赖检测失败和密钥警告问题,可以参考以下解决方法: ### 解决依赖检测失败问题 依赖检测失败提示 `bind(x86 - 64) = 32:9.11.4-26.P2.el7 被 bind-chroot-32:9.11.4-26.P2.el7.x86_64 需要`,说明系统中缺少 `bind(x86 - 64) = 32:9.11.4-26.P2.el7` 这个特定版本的依赖包。可以尝试以下方法: 1. **下载并安装依赖包**:根据引用[1]中提供的信息,可能需要下载并安装 `bind-9.11.4-16.P2.el7.x86_64.rpm` 和 `bind-libs-9.11.4-16.P2.el7.x86_64.rpm` 等相关的 `bind` 系列包。确保下载的版本与 `bind-chroot` 所需的版本一致(即 `9.11.4-26.P2.el7`)。 ```bash # 下载并安装依赖包 wget <bind-9.11.4-26.P2.el7.x86_64.rpm的下载链接> wget <bind-libs-9.11.4-26.P2.el7.x86_64.rpm的下载链接> rpm -ivh bind-9.11.4-26.P2.el7.x86_64.rpm bind-libs-9.11.4-26.P2.el7.x86_64.rpm ``` 2. **使用 `yum` 或 `dnf` 解决依赖**:如果系统支持 `yum` 或 `dnf`,可以使用它们来安装 `bind-chroot` 包,它们会自动处理依赖关系。 ```bash # 使用yum安装 yum install bind-chroot-9.11.4-26.P2.el7.x86_64.rpm # 或者使用dnf安装 dnf install bind-chroot-9.11.4-26.P2.el7.x86_64.rpm ``` ### 解决头V3 RSA/SHA256 Signature密钥ID f4a80eb5: NOKEY警告问题 出现密钥警告是因为 `rpm` 无法验证软件包的签名。可以通过导入相应的GPG密钥来解决这个问题。 ```bash # 导入GPG密钥 rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 # 假设是CentOS 7系统,根据实际系统调整 ``` ### 总结 按照上述步骤操作,先解决依赖问题,再导入GPG密钥,应该可以解决使用 `rpm -ivh` 安装 `bind-chroot-9.11.4-26.P2.el7.x86_64.rpm` 时出现的依赖检测失败和密钥警告问题。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值