Cisco路由器提供集成的路由與橋接(Integrated Routing and Bridging,IRB)功能。當配置了IRB后,不可路由的協議數據流可以在配置為相同網橋組的端口上實現橋接交換,同時可以路由的協議數據流則在其他的路由端口或不同的網橋組之間實現路由。
這里提到了一個概念,即網橋組(Bridge-Group)。要實現不同的端口之間的橋接交換,必須將這些端口歸到同一個網橋組當中。從概念上說,配置為同一個網橋組中的所有端口屬於同一個第二層的廣播域,不管這個端口類型是廣域網端口還是以太網端口,也不管這個端口是物理端口還是邏輯端口(如X.25的子口或以太網的VLAN子口)。Cisco路由器為每一個已配置的網橋組自動產生一個虛擬接口,稱之為Beidge-Group Virtual Interface(BVI),在不同的BVI之間或BVI與其它的端口之間可以實現路由的能力。下面說明BVI的主要概念和IRB的配置任務。
SW1
1 switch#conf t
2 switch(config)#vlan 2
3 switch(config-vlan)#exit
4 switch(config)#interface fastethernet0/1
5 switch(config-if)#switchport mode access
6 switch(config-if)#switchport access vlan 1
7 switch(config-if)#interface fastethernet 0/2
8 switch(config-if)#switchport mode access
9 switch(config-if)#switchport access vlan 2
10 switch(config-if)#interface fastethernet 0/24
11 switch(config-if)#encapsulation dot1q
12 switch(config-if)#switchport mode trunk
SW2
1 switch#configure terminal
2 switch(config)#vlan 2
3 switch(config-vlan)#exit
4 switch(config)#interface fastethernet 0/1
5 switch(config-if)#switchport mode access
6 switch(config-if)#switchport access vlan 1
7 switch(config-if)#interface fastethernet 0/2
8 switch(config-if)#switchport mode access
9 switch(config-if)#switchport accesss vlan 2
10 switch(config-if)#interface fastethernet 0/24
11 switch(config-if)#encapsulation isl
12 switch(config-if)#switchport mode trunk
R1
1 router#configure terminal
2 router(config)#interface fastethernet 0/0
3 router(config-if)#no shut
4 router(config-if)#interface fastethernet 0/0.1
5 router(config-subif)#encapsulation dot1q 1
6 router(config-subif)#bridge-group 1
7 router(config-subif)#interface fastethernet 0/0.2
8 router(config-subif)#encapsultion dot1q 2
9 router(config-subif)#bridge-group 2
10 router(config-subif)#exit
11 router(config-if)#interface fastetherent 0/1
12 router(config-if)#no shut
13 router(config-if)#interface fastethernet 0/1.1
14 router(config-subif)#encapsulation isl 1
15 router(config-subif)#brdige group 1
16 router(config-subif)#interface fastethernet 0/1.2
17 router(config-subif)#encapsulation isl 2
18 router(config-subif)#brdige group 2
19 router(config-subif)#exit
20 router(config-if)#exit
21 router(config)# bridge irb
22 router(config)#bridge 1 protocol ieee
23 router(config)#bridge 2 protocol ieee
24 router(config)#bridge 1 route ip
25 router(config)#brdige 2 route ip
26 router(config)#int bvi 1
27 router(config-if)#ip add 192.168.1.254 255.255.255.0
28 router(config-if)#int bvi 2
29 router(config-if)#ip add 192.168.2.254 255.255.255.0