中级会员 
 精华: 1
 积分: 403
 帖子: 51  威望: 141 点 金钱: 90 币 贡献: 65 点 经验: 02级
 阅读权限: 30
 注册: 2007-8-17
 状态:
|
1#
大 中
小 发表于 2007-11-13 09:43 只看该作者
理解as-set关键字(bgp实验)
实验目的:理解as-set关键字 (为了实验测试,路由器全部运行在一个OSPF区域0而那两个网云用BGP通告)
R1的配置
| interface Loopback0
ip address 1.1.1.1 255.255.255.0
ip ospf network point-to-point
!
interface Ethernet0/0
ip address 15.1.1.1 255.255.255.0
!
router ospf 10
log-adjacency-changes
network 0.0.0.0 255.255.255.255 area 0
!
router bgp 10
no synchronization
bgp log-neighbor-changes
neighbor 15.1.1.5 remote-as 50
no auto-summary
|
R5的配置
| interface Loopback0
ip address 5.5.5.5 255.255.255.0
ip ospf network point-to-point
!
interface Ethernet0/0
ip address 15.1.1.5 255.255.255.0
!
interface Serial1/0
ip address 35.1.1.5 255.255.255.0
serial restart-delay 0
!
interface Serial2/0
ip address 45.1.1.5 255.255.255.0
serial restart-delay 0
!
router ospf 10
log-adjacency-changes
network 0.0.0.0 255.255.255.255 area 0
!
router bgp 50
no synchronization
bgp router-id 5.5.5.5
bgp log-neighbor-changes
aggregate-address 192.168.12.0 255.255.252.0 summary-only
neighbor 15.1.1.1 remote-as 10
neighbor 35.1.1.3 remote-as 30
neighbor 45.1.1.4 remote-as 40
no auto-summary
|
R3的配置
| interface Loopback0
ip address 3.3.3.3 255.255.255.0
ip ospf network point-to-point
!
interface Loopback1
ip address 192.168.13.1 255.255.255.0 secondary
ip address 192.168.12.1 255.255.255.0
!
interface Serial2/0
ip address 35.1.1.3 255.255.255.0
serial restart-delay 0
!
router ospf 10
log-adjacency-changes
network 3.3.3.0 0.0.0.255 area 0
network 35.1.1.0 0.0.0.255 area 0
!
router bgp 30
no synchronization
bgp router-id 3.3.3.3
bgp log-neighbor-changes
network 192.168.12.0
network 192.168.13.0
neighbor 35.1.1.5 remote-as 50
no auto-summary
|
R4的配置
| interface Loopback0
ip address 4.4.4.4 255.255.255.0
ip ospf network point-to-point
!
interface Loopback1
ip address 192.168.15.1 255.255.255.0 secondary
ip address 192.168.14.1 255.255.255.0
!
interface Serial1/0
ip address 45.1.1.4 255.255.255.0
!
router ospf 10
log-adjacency-changes
network 4.4.4.0 0.0.0.255 area 0
network 45.1.1.0 0.0.0.255 area 0
!
router bgp 40
no synchronization
bgp router-id 4.4.4.4
bgp log-neighbor-changes
network 192.168.14.0
network 192.168.15.0
neighbor 45.1.1.5 remote-as 50
no auto-summary
|
没有使用as-set关键字时
r1#sho ip bgp 192.168.12.0/22
BGP routing table entry for 192.168.12.0/22, version 12
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Flag: 0x820
Not advertised to any peer
50, (aggregated by 50 5.5.5.5)
15.1.1.5 from 15.1.1.5 (5.5.5.5)
Origin IGP, metric 0, localpref 100, valid, external, atomic-aggregate, best
r5(config-router)#aggregate-address 192.168.12.0 255.255.252.0 summary-only as-set
使用了关键字as-set后再查看
r1#sho ip bgp 192.168.12.0/22
BGP routing table entry for 192.168.12.0/22, version 13
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
50 {30,40}, (aggregated by 50 5.5.5.5)
15.1.1.5 from 15.1.1.5 (5.5.5.5)
Origin IGP, metric 0, localpref 100, valid, external, best
|