Cisco IOS Layer2 – Bridging (CRB IRBなど)の設定

スポンサーリンク

cisco ルータにおいてbridging (Layer 2の転送) を行う方法について説明します。bridgingには、ip routing, no ip routing, CRB, IRBの4種類が存在します。

概要

cisco ルータにおいてbridging (Layer 2の転送) を行う方法について説明します。bridgingには、ip routing, no ip routing, CRB, IRBの4種類が存在します。

ip routing

動作概要

ip routing すなわちデフォルトの状態では、bridgingが定義されたinterfaceはIPを転送するか破棄するかのどちらかです。IPをbrigdingする事はありません。なお、IP以外のフレームはbrigingされます。

必須設定

bridgingの設定は以下の通りです。interfaceに対してbridge groupを定義します。すると、同一のbridge group間でのみbridgingされるようになります。

Router(config-if)# bridge-group <num>

以下のコマンドでSpanning Treeを有効にします。なお、プロトコルの種類は”ieee”を選択して下さい。dec, ibmはHP, IBM独自のSpanning Treeプロトコルですので、このプロトコルを使用する事は殆どないと思います。

Router(config)# bridge-group <num> protocol [ dec | ibm | ieee ]

動作確認

以下の構成で動作確認を行います。R1, R3はルータとして使用し、R2はbridgeとして使用します。

      e0/0    e0/0    e0/1    e0/0
+------+.1      +------+      .3+------+
|  R1  +--------+  R2  +--------+  R3  |
+------+        +------+        +------+
             192.168.123.0/24
 [R1]
ipx routing
!
interface Ethernet0/0
 ip address 192.168.123.1 255.255.255.0
 ipx encapsulation SNAP
 ipx network 123

 [R2]
bridge 1 protocol ieee
!
interface Ethernet0/0
 bridge-group 1
!
interface Ethernet0/1
 bridge-group 1

 [R3]
ipx routing
!
interface Ethernet0/0
 ip address 192.168.123.3 255.255.255.0
 ipx encapsulation SNAP
 ipx network 123

R1, R3間でIPは疎通不能ですが、IP以外(IPX)は疎通可能である事が読み取れます。

 [R1]
R1#show ipx interface Ethernet 0/0
Ethernet0/0 is up, line protocol is up
  IPX address is 123.cc00.09f0.0000, SNAP [up]
  Delay of this IPX network, in ticks is 1
  IPXWAN processing not enabled on this interface.

 [R3]
R3#ping 192.168.123.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.123.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R3#
R3#
R3#
R3#ping 123.cc00.09f0.0000

Translating "123.cc00.09f0.0000"

Type escape sequence to abort.
Sending 5, 100-byte IPX Novell Echoes to 123.cc00.09f0.0000, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 56/75/136 ms
R3#

“show spanning-tree”コマンドを入力すると、ルータでもスイッチと同様にSpanning Treeの動作確認ができます。

R2#show spanning-tree 1

 Bridge group 1 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, address cc01.09f0.0000
  Configured hello time 2, max age 20, forward delay 15
  We are the root of the spanning tree
  Topology change flag not set, detected flag not set
  Number of topology changes 1 last change occurred 00:02:17 ago
          from Ethernet0/0
  Times:  hold 1, topology change 35, notification 2
          hello 2, max age 20, forward delay 15
  Timers: hello 0, topology change 0, notification 0, aging 300

 Port 3 (Ethernet0/0) of Bridge group 1 is forwarding
   Port path cost 100, Port priority 128, Port Identifier 128.3.
   Designated root has priority 32768, address cc01.09f0.0000
   Designated bridge has priority 32768, address cc01.09f0.0000
   Designated port id is 128.3, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 74, received 0

 Port 4 (Ethernet0/1) of Bridge group 1 is forwarding
   Port path cost 100, Port priority 128, Port Identifier 128.4.
   Designated root has priority 32768, address cc01.09f0.0000
   Designated bridge has priority 32768, address cc01.09f0.0000
   Designated port id is 128.4, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 74, received 0

R2#

no ip routing

動作概要

no ip routingは、bridgeが設定されたinterfaceで受信したフレームをbridgingします。但し、”no ip routing”を入力すると、routingは一切できなくなってしまう事には留意して下さい。

必須設定

以下のコマンドでroutingを無効にします。

Router(config)# no ip routing

bridgingの設定は以下の通りです。詳細は前述したので、省略します。

Router(config)# bridge-group <num> protocol [ dec | ibm | ieee ]
Router(config)# interface <interface>
Router(config-if)# bridge-group <num>

動作確認

以下の構成で動作確認を行います。R1, R3はルータとして使用し、R2はbridgeとして使用します。

      e0/0    e0/0    e0/1    e0/0
+------+.1      +------+      .3+------+
|  R1  +--------+  R2  +--------+  R3  |
+------+        +------+        +------+
             192.168.123.0/24
 [R1]
interface Ethernet0/0
 ip address 192.168.123.1 255.255.255.0

 [R2]
no ip routing
!
bridge 1 protocol ieee
!
interface Ethernet0/0
 bridge-group 1
!
interface Ethernet0/1
 bridge-group 1

 [R3]
interface Ethernet0/0
 ip address 192.168.123.3 255.255.255.0

ip routingの状態と異なり、R1, R3間でIPによる疎通が可能になりました。

R3#ping 192.168.123.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.123.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 56/80/120 ms
R3#

CRB (Concurrent Routing and Bridging)

動作概要

“ip routing”, “no ip routing”はroutingかbridgingの片方しかできません。しかし、CRB (Concurrent Routing and Bridging) を使用すると、あるinterfaceではbridgingが可能になるようにし、あるinterfaceではroutingが可能になるようにする事が可能です。つまり、CRBはbridgingとroutingが混在できるモードと考えて差し支えありません。

必須設定

以下のコマンドでCRBを有効にします。

Router(config)# bridge crb

bridgingの設定は以下の通りです。詳細は前述したので、省略します。

Router(config)# bridge-group <num> protocol [ dec | ibm | ieee ]
Router(config)# interface <interface>
Router(config-if)# bridge-group <num>

動作確認

以下の構成で動作確認を行います。R2 e0/0, e0/1はbridging interfaceとして定義し、
R2 e0/2, e0/3はrouting interfaceとして定義します。

             192.168.13.0/24
      e0/0    e0/0    e0/1    e0/0
+------+.1      +------+      .3+------+
|      +--------+      +--------+      |
|  R1  |        |  R2  |        |  R3  |
|      +--------+      +--------+      |
+------+.1    .2+------+.2    .3+------+
      e0/1    e0/2    e0/3    e0/1
    192.168.12.0/24   192.168.23.0/24
 [R1]
interface Ethernet0/0
 ip address 192.168.13.1 255.255.255.0
!
interface Ethernet0/1
 ip address 192.168.12.1 255.255.255.0

 [R2]
bridge crb
!
bridge 13 protocol ieee
!
interface Ethernet0/0
 bridge-group 13
!
interface Ethernet0/1
 bridge-group 13
!
interface Ethernet0/2
 ip address 192.168.12.2 255.255.255.0
!
interface Ethernet0/3
 ip address 192.168.23.2 255.255.255.0

 [R3]
interface Ethernet0/0
 ip address 192.168.13.3 255.255.255.0
!
interface Ethernet0/1
 ip address 192.168.23.3 255.255.255.0

R1, R2, R3が互いに疎通可能である事を確認します。

 [R1]
R1#ping 192.168.12.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/51/76 ms
R1#
R1#
R1#ping 192.168.13.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.13.3, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 60/79/128 ms
R1#

 [R2]
R2#ping 192.168.23.3

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.23.3, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 28/51/96 ms
R2#

bridgeの動作設定

以下のコマンドで、bridgeが設定されたinterfaceがroutingするかbridgingするかを定義する事ができます。

Router(config)# bridge <num> [ bridge ip | route ip ]

個人的な意見ですが、CRBのinterfaceの挙動は以下のようになっていますので、明示的にbridgingするかroutingするかを設定する必要はないと思います。

設定 挙動
bridge group 設定あり bridgingする
bridge group 設定なし routingする

あまり使用する機会のない設定ですが、先ほどの設定例を敢えて”bridge <num> [ bridge ip | route ip ]”を使って書き換えると以下の通りです。

 [R2]
bridge crb
!
bridge 13 protocol ieee
bridge 13 bridge ip
bridge 12 route ip
bridge 23 route ip
!
interface Ethernet0/0
 bridge-group 13
!
interface Ethernet0/1
 bridge-group 13
!
interface Ethernet0/2
 bridge-group 12
 ip address 192.168.12.2 255.255.255.0
!
interface Ethernet0/3
 bridge-group 23
 ip address 192.168.23.2 255.255.255.0

IRB (Integrated Routing and Bridging)

動作概要

IRB (Integrated Routing and Bridging) はCRBの後続の機能で、bridging可能なinterfaceとrouting可能な仮想interfaceを接続する事ができる機能です。仮想interfaceはBVI (Bridged Virtual Interface)と呼ばれ、L3 SwitchにおけるSVIと同じ挙動をします。

必須設定

以下のコマンドでIRBを有効にします。

Router(config)# bridge irb

以下のコマンドでBVI interfaceを作成します。

Router(config)# interface BVI <num>
Router(config-if)# ip address <addr> <mask>

以下のコマンドでroutingを可能にします。私はこのコマンドの入力を忘れる事が多いのですが、BVIへのpingが届かない場合は”route ip”漏れを疑うと良いと思います。

Router(config)# bridge <num> route ip 

bridgingの設定は以下の通りです。詳細は前述したので、省略します。

Router(config)# bridge-group <num> protocol [ dec | ibm | ieee ]
Router(config)# interface <interface>
Router(config-if)# bridge-group <num>

動作確認

以下の構成で動作確認を行います。R2にBVI 1に192.168.123.2/24を割り当てます。

      e0/0    e0/0    e0/1    e0/0
+------+.1      +------+      .3+------+
|  R1  +--------+  R2  +--------+  R3  |
+------+        +------+        +------+
             192.168.123.0/24
 [R1]
interface Ethernet0/0
 ip address 192.168.123.1 255.255.255.0

 [R2]
bridge irb
!
bridge 1 protocol ieee
bridge 1 route ip
!
interface Ethernet0/0
 bridge-group 1
!
interface Ethernet0/1
 bridge-group 1
!
interface BVI 1
 ip address 192.168.123.2 255.255.255.0

 [R3]
interface Ethernet0/0
 ip address 192.168.123.3 255.255.255.0

R1, R2, R3が互いに疎通可能である事を確認します。

 [R1]
R1#ping 192.168.123.255 repeat 2

Type escape sequence to abort.
Sending 2, 100-byte ICMP Echos to 192.168.123.255, timeout is 2 seconds:

Reply to request 0 from 192.168.123.2, 64 ms
Reply to request 0 from 192.168.123.3, 80 ms
Reply to request 1 from 192.168.123.2, 72 ms
Reply to request 1 from 192.168.123.3, 72 ms
R1#
タイトルとURLをコピーしました