电脑技术学习

选择目的前缀和路径

dn001


为了选择要启用了Tag交换的目的地前缀和路径,输入下面例子中所列命令来配置路由器即可。假如你这样配置R2,R5和R8,使得它们不把标签分配到其它路由器,就可以保证任何路由器都不向它们发送加上标签的数据包。你还需要这样配置路由器R1,R3,R4,R6和R7,使得它们只为网络A分配标签,而且只分配到可用的邻接路由器中。这种配置可保证:R3将它的针对网络A标签只分配到R1,而R4只分配到R3,R6只分配到R4,R7只分配到R6
(参见图10-l)。
router-2 (config)# no tag- switching advertise-tags
router-5 (config)# no tag-switching advertise-tags
router-8 (config)# no tag- switching advertise-tags
router-1 (config)# Access-list permit R1
router-1 (config)# no tag-switching advertise-tags for 1
router-1 (config)# tag-switching advertise-tags for 1 to 2
router-1 (config)# exit

router-3# access-list 1 permit A
router-3# access-list 2 permit R1
router-3# tag-switching advertise-tags for 1 to 2
router-3# exit

router-4# access-list 1 permit A
router-4# access-list 2 permit R3
router-4# tag-switching advertise-tags for 1 to 2
router-4# exit
router-6# access-list 1 permit A
router-6# access-list 2 permit R4
router-6# tag-switching advertise-tags for 1 to 2
router-6# exit

router-7# access-list 1 permit A
router-7# access-list 2 permit R6
router-7# tag-switching advertise-tags for 1 to 2
router-7# exit