RA(config)#int l0
RA(config-if)#ip add 192.168.0.1 255.255.255.0
RA(config-if)#int l1
RA(config-if)#ip add 192.168.1.1 255.255.255.0
RA(config-if)#int s1/0
RA(config-if)#ip add 10.0.0.2 255.255.255.252                   RA上的配置
RA(config-if)#no shut
RA(config-if)#int s1/2
RA(config-if)#ip add 172.16.0.2 255.255.255.252
RA(config-if)#no shut
RA(config-if)#end
RA(config)#router bgp 100
RA(config-router)#neighbor 10.0.0.1 remote-as 200
RA(config-router)#neighbor 172.16.0.1 remote-as 300
RA(config-router)#network 192.168.0.0                              
RA(config-router)#network 192.168.1.0
RA(config-router)#end
RA#sh ip route
Gateway of last resort is not set
     172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C       172.16.0.0/30 is directly connected, Serial1/2
B       172.16.1.0/24 [20/0] via 172.16.0.1, 00:01:53
     10.0.0.0/30 is subnetted, 1 subnets
C       10.0.0.0 is directly connected, Serial1/0
C    192.168.0.0/24 is directly connected, Loopback0
     12.0.0.0/24 is subnetted, 1 subnets
B       12.0.1.0 [20/0] via 10.0.0.1, 00:01:53
C    192.168.1.0/24 is directly connected, Loopback1
-----------------------------
R2#confi t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int s1/0
R2(config-if)#ip add 10.0.0.1 255.255.255.0
R2(config-if)#no shut
R2(config)#int l0
R2(config-if)#ip add 12.0.1.1 255.255.255.0
R2(config-if)#exit
R2(config)#router bgp 200
R2(config-router)#neighbor 10.0.0.2 remote-as 100               R2上的配置
R2(config-router)#network 12.0.1.0 mask 255.255.255.0
R2(config-router)#exit
R2#sh ip route
Gateway of last resort is not set
     172.16.0.0/24 is subnetted, 1 subnets
B       172.16.1.0 [20/0] via 10.0.0.2, 00:07:46
     10.0.0.0/24 is subnetted, 1 subnets
C       10.0.0.0 is directly connected, Serial1/0
B    192.168.0.0/24 [20/0] via 10.0.0.2, 00:07:46
     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.1.0 is directly connected, Loopback0
B    192.168.1.0/24 [20/0] via 10.0.0.2, 00:07:46
--------------------------------
RC(config)#int s1/2
RC(config-if)#ip add 172.16.0.1 255.255.255.252
RC(config-if)#no shut
RC(config-if)#int l0
RC(config-if)#ip add 172.16.1.1 255.255.255.0
RC(config-if)#exit
RC(config)#router bgp 300                                        RC上的配置
RC(config-router)#neighbor 172.16.0.2 remote-as 100
RC(config-router)#network 172.16.1.0 mask 255.255.255.0
RC#sh ip route
Gateway of last resort is not set
     172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C       172.16.0.0/30 is directly connected, Serial1/2
C       172.16.1.0/24 is directly connected, Loopback0
B    192.168.0.0/24 [20/0] via 172.16.0.2, 00:03:17
     12.0.0.0/24 is subnetted, 1 subnets
B       12.0.1.0 [20/0] via 172.16.0.2, 00:03:17
B    192.168.1.0/24 [20/0] via 172.16.0.2, 00:03:17
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
RA(config)#access-list 1 permit 192.168.0.0 0.0.1.255
RA(config)#router bgp 100
RA(config-router)#neighbor 10.0.0.1 distribute-list 1 out
RA(config-router)#neighbor 172.16.0.1 distribute-list 1 out
RA(config-router)#exit
RA(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.1 210
RA(config)#ip route 0.0.0.0 0.0.0.0 172.16.0.1 220
RA(config)#end          在RA上路由器使得它只向两个供应商发布网络192.168.0.0和192.168.1.0
---------------------------
R2#sh ip route
Gateway of last resort is not set
               ---------重新检查R2,到RC的路由不出现在路由表中
     10.0.0.0/24 is subnetted, 1 subnets
C       10.0.0.0 is directly connected, Serial1/0
B    192.168.0.0/24 [20/0] via 10.0.0.2, 00:08:37
     12.0.0.0/24 is subnetted, 1 subnets
C       12.0.1.0 is directly connected, Loopback0
B    192.168.1.0/24 [20/0] via 10.0.0.2, 00:08:37
------------------------
RA#sh ip route
Gateway of last resort is 10.0.0.1 to network 0.0.0.0
     172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks
C       172.16.0.0/30 is directly connected, Serial1/2
B       172.16.1.0/24 [20/0] via 172.16.0.1, 00:09:32
     10.0.0.0/30 is subnetted, 1 subnets
C       10.0.0.0 is directly connected, Serial1/0
C    192.168.0.0/24 is directly connected, Loopback0
     12.0.0.0/24 is subnetted, 1 subnets
B       12.0.1.0 [20/0] via 10.0.0.1, 00:09:32
C    192.168.1.0/24 is directly connected, Loopback1
S*   0.0.0.0/0 [210/0] via 10.0.0.1