R1 配置如下:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
r1#show running-config
Building configuration...
Current configuration : 1249 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r1
!
boot-start-marker
boot-end-marker
!
!
memory-size iomem 5
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
!
ip cef
ip ips po max-events 100
no ftp-server write-enable
!
interface Loopback1
ip address <?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />1.1.1.1 255.255.255.0
!
interface Serial0/0
ip address 192.168.1.1 255.255.255.0
serial restart-delay 0
!
interface Serial0/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial0/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial0/3
no ip address
shutdown
serial restart-delay 0
!
interface FastEthernet1/0
ip address 192.168.3.1 255.255.255.0
duplex auto
speed auto
!
router bgp 10
no synchronization
bgp router-id 1.1.1.1
bgp log-neighbor-changes
bgp confederation identifier 100
bgp confederation peers 20
network 1.1.1.0 mask 255.255.255.0
neighbor 192.168.1.2 remote-as 200
neighbor 192.168.3.2 remote-as 20
neighbor 192.168.3.2 next-hop-self
no auto-summary
!
ip http server
no ip http secure-server
ip classless
!
control-plane
!
line con 0
line aux 0
line vty 0 4
!
!
End
R2 配置如下:
r2#show running-config
Building configuration...
Current configuration : 1074 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r2
!
boot-start-marker
boot-end-marker
!
!
memory-size iomem 5
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
!
ip cef
ip ips po max-events 100
no ftp-server write-enable
!
interface Loopback2
ip address 2.2.2.2 255.255.255.0
!
interface Serial0/0
ip address 192.168.1.2 255.255.255.0
serial restart-delay 0
!
interface Serial0/1
ip address 192.168.2.1 255.255.255.0
serial restart-delay 0
!
interface Serial0/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial0/3
no ip address
shutdown
serial restart-delay 0
!
router bgp 200
no synchronization
bgp router-id 2.2.2.2
bgp log-neighbor-changes
network 2.2.2.0 mask 255.255.255.0
neighbor 192.168.1.1 remote-as 100
neighbor 192.168.2.2 remote-as 100
no auto-summary
!
ip http server
no ip http secure-server
ip classless
!
control-plane
!
line con 0
line aux 0
line vty 0 4
!
!
End
R3 配置如下:
r3#show running-config
Building configuration...
Current configuration : 1449 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r3
!
boot-start-marker
boot-end-marker
!
!
memory-size iomem 5
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
!
ip cef
ip ips po max-events 100
no ftp-server write-enable
!
interface Loopback3
ip address 3.3.3.3 255.255.255.0
!
interface Serial0/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial0/1
ip address 192.168.2.2 255.255.255.0
serial restart-delay 0
!
interface Serial0/2
ip address 192.168.4.1 255.255.255.0
serial restart-delay 0
!
interface Serial0/3
no ip address
shutdown
serial restart-delay 0
!
interface FastEthernet1/0
ip address 192.168.3.2 255.255.255.0
duplex auto
speed auto
!
router eigrp 1
network 3.3.3.0 0.0.0.255
network 192.168.4.0
no auto-summary
!
router bgp 20
no synchronization
bgp router-id 3.3.3.3
bgp log-neighbor-changes
bgp confederation identifier 100
bgp confederation peers 10
network 3.3.3.0 mask 255.255.255.0
neighbor 4.4.4.4 remote-as 20
neighbor 4.4.4.4 update-source Loopback3
neighbor 4.4.4.4 next-hop-self
neighbor 192.168.2.1 remote-as 200
neighbor 192.168.3.1 remote-as 10
neighbor 192.168.3.1 next-hop-self
no auto-summary
!
ip http server
no ip http secure-server
ip classless
!
control-plane
!
line con 0
line aux 0
line vty 0 4
!
End
R4 配置如下:
r4#show running-config
Building configuration...
Current configuration : 1143 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname r4
!
boot-start-marker
boot-end-marker
!
!
memory-size iomem 5
no aaa new-model
ip subnet-zero
!
!
no ip domain lookup
!
!
ip cef
ip ips po max-events 100
no ftp-server write-enable
!
interface Loopback4
ip address 4.4.4.4 255.255.255.0
!
interface Serial0/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial0/1
no ip address
shutdown
serial restart-delay 0
!
interface Serial0/2
ip address 192.168.4.2 255.255.255.0
serial restart-delay 0
!
interface Serial0/3
no ip address
shutdown
serial restart-delay 0
!
router eigrp 1
network 4.4.4.0 0.0.0.255
network 192.168.4.0
no auto-summary
!
router bgp 20
no synchronization
bgp router-id 4.4.4.4
bgp log-neighbor-changes
network 4.4.4.0 mask 255.255.255.0
neighbor 3.3.3.3 remote-as 20
neighbor 3.3.3.3 update-source Loopback4
no auto-summary
!
ip http server
no ip http secure-server
ip classless
!
control-plane
!
line con 0
line aux 0
line vty 0 4
!
End
验证如下:
得出结论:在联邦范围内,将成员 AS 加入到 AS-path 中,并且括号扩起来,但是并不将他们公布到联邦的范围外, AS-path 中联邦的 as 号用于避免出现路由环路;
外部无法了解联邦内的所有成员的信息