Thursday, March 13, 2014

Integrated Routing and Bridging (IRB).

The concept of IRB is very simple and straightforward. And somehow similar to the concept of vlans and inter-vlan routing. I was surprised that CCNP track didn't include this topic.
This feature is very useful when you need to span a vlan between several ports, but your platform doesn't support vlans, and using additional switch is not an option. Or you need to bridge non-IP protocol, and MPLS is not your protocol of love (:
The topology is simple:
Basic configuration of the router:
interface FastEthernet0/0
 no ip address
!
interface FastEthernet0/1
 no ip address
!
interface FastEthernet1/0
 ip address 10.0.1.2 255.255.255.0
As expected, PC1 and PC2 can't reach each other (routers do not forward broadcast packets), and PC3 is able to ping only the R1's fa1/0 interface IP. I am using VPCs to emulate end stations:
VPCS[1]> show
NAME   IP/MASK              GATEWAY           MAC                LPORT  RHOST:PORT
VPCS1  10.0.0.1/24          255.255.255.0     00:50:79:66:68:00  20000  127.0.0.1:30000
VPCS2  10.0.0.2/24          255.255.255.0     00:50:79:66:68:01  20001  127.0.0.1:30001
VPCS3  10.0.1.1/24          10.0.1.2          00:50:79:66:68:02  20002  127.0.0.1:30002
VPCS[1]> ping 10.0.0.2
host (10.0.0.2) not reachable
VPCS[3]> ping 10.0.1.2
10.0.1.2 icmp_seq=1 ttl=255 time=10.004 ms
10.0.1.2 icmp_seq=2 ttl=255 time=44.027 ms
10.0.1.2 icmp_seq=3 ttl=255 time=44.009 ms
10.0.1.2 icmp_seq=4 ttl=255 time=33.022 ms
10.0.1.2 icmp_seq=5 ttl=255 time=42.025 ms
Notice, that PC1 and PC2 have no default gateway set yet. Since they are in the same broadcast domain they should be able to reach one another.
The first task is to configure bridging between R1's fa0/0 anf fa0/1 interfaces. Actual configuration is simple:
R1(config)#bridge irb #Enabling IRB, without this command you can get into the issues with bridging IP and "no ip routing".
R1(config)#bridge 10 protocol ieee #Creating the bridge group with ID of 10 and using IEEE version of STP (I'll check this later).
R1(config)#interface fastEthernet 0/0
R1(config-if)#bridge-group 10 #Assign each interface to the bridge group.
R1(config-if)#interface fastEthernet 0/1
R1(config-if)#bridge-group 10
That's it:
VPCS[1]> ping 10.0.0.2
10.0.0.2 icmp_seq=1 ttl=64 time=21.010 ms
10.0.0.2 icmp_seq=2 ttl=64 time=22.015 ms
10.0.0.2 icmp_seq=3 ttl=64 time=20.012 ms
10.0.0.2 icmp_seq=4 ttl=64 time=19.010 ms
10.0.0.2 icmp_seq=5 ttl=64 time=20.011 ms
But they are not able to reach PC3.
VPCS[1]> ping 10.0.1.2
host (255.255.255.0) not reachable
Mainly because they have no default gateway set, let's fix it:
NAME   IP/MASK              GATEWAY           MAC                LPORT  RHOST:PORT
VPCS1  10.0.0.1/24          10.0.0.3       00:50:79:66:68:00  20000  127.0.0.1:30000
VPCS2  10.0.0.2/24          10.0.0.3       00:50:79:66:68:01  20001  127.0.0.1:30001
VPCS3  10.0.1.1/24          10.0.1.2          00:50:79:66:68:02  20002  127.0.0.1:30002
And of course R1 is bridging frames in this subnet and hasn't it in the routing table at all:
     10.0.0.0/24 is subnetted, 1 subnets
C       10.0.1.0 is directly connected, FastEthernet1/0
Next step is to create the BVI (Bridge Group Virtual Interface) and assign an IP address to it. You may think of it as of vlan interface.
R1(config)#interface bvi 10 #The number of the interface has to match the bridge group id configured earlier.
R1(config-if)#ip add 10.0.0.3 255.255.255.0
R1(config)#bridge 10 route ip #Enabling routing of the IP protocol.
That's it:
VPCS[1]> ping 10.0.1.1
10.0.1.1 icmp_seq=1 ttl=63 time=25.016 ms
10.0.1.1 icmp_seq=2 ttl=63 time=22.015 ms
10.0.1.1 icmp_seq=3 ttl=63 time=22.013 ms
10.0.1.1 icmp_seq=4 ttl=63 time=22.007 ms
10.0.1.1 icmp_seq=5 ttl=63 time=22.012 ms
Some useful commands to check:
R1#show interfaces irb
FastEthernet0/0
 Routed protocols on FastEthernet0/0:
  ip
 Bridged protocols on FastEthernet0/0:
  appletalk  clns       decnet     ip
 Software MAC address filter on FastEthernet0/0
  Hash Len    Address      Matches  Act      Type
  0x00:  0 ffff.ffff.ffff        22 RCV Physical broadcast
  0x15:  0 c200.1568.0000        20 RCV Interface MAC address
  0x15:  1 c200.1568.0000         0 RCV Bridge-group Virtual Interface
  0x2A:  0 0900.2b01.0001         0 RCV DEC spanning tree
  0xC0:  0 0100.0ccc.cccc         0 RCV CDP
  0xC2:  0 0180.c200.0000         0 RCV IEEE spanning tree
  0xC2:  1 0180.c200.0000         0 RCV IBM spanning tree
  0xC2:  2 0100.0ccd.cdce         0 RCV VLAN Bridge STP
FastEthernet0/1
 Routed protocols on FastEthernet0/1:
  ip
 Bridged protocols on FastEthernet0/1:
  appletalk  clns       decnet     ip
 Software MAC address filter on FastEthernet0/1
  Hash Len    Address      Matches  Act      Type
  0x00:  0 ffff.ffff.ffff         3 RCV Physical broadcast
  0x14:  0 c200.1568.0001         0 RCV Interface MAC address
  0x15:  0 c200.1568.0000         0 RCV Bridge-group Virtual Interface
  0x2A:  0 0900.2b01.0001         0 RCV DEC spanning tree
  0xC0:  0 0100.0ccc.cccc         0 RCV CDP
  0xC2:  0 0180.c200.0000         0 RCV IEEE spanning tree
  0xC2:  1 0180.c200.0000         0 RCV IBM spanning tree
  0xC2:  2 0100.0ccd.cdce         0 RCV VLAN Bridge STP
FastEthernet1/0
 Routed protocols on FastEthernet1/0:
  ip
BVI10
 Routed protocols on BVI10:
  ip
R1#show bridge 10 group
Bridge Group 10 is running the IEEE compatible Spanning Tree protocol
   Port 4 (FastEthernet0/0) of bridge group 10 is forwarding
   Port 5 (FastEthernet0/1) of bridge group 10 is forwarding
And last but not least thing to check, since we are bridging now and enabled STP, let's confirm that STP works on the routers. The topology is as following:
Configs of R2 and R3 are identical:
bridge irb
!
interface FastEthernet0/0
 no ip address
 bridge-group 10
!
interface FastEthernet0/1
 bridge-group 10
!
bridge 10 protocol ieee
Effectively I created the bridged loop here, but STP is working just as expected:
R2#show spanning-tree
 Bridge group 10 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, address c202.1568.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:13:40 ago
          from FastEthernet0/1
  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 4 (FastEthernet0/0) of Bridge group 10 is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.4.
   Designated root has priority 32768, address c202.1568.0000
   Designated bridge has priority 32768, address c202.1568.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 414, received 0

 Port 5 (FastEthernet0/1) of Bridge group 10 is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.5.
   Designated root has priority 32768, address c202.1568.0000
   Designated bridge has priority 32768, address c202.1568.0000
   Designated port id is 128.5, designated path cost 0
   Timers: message age 0, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 415, received 0

R2#show spanning-tree
 Bridge group 10 is executing the ieee compatible Spanning Tree protocol
  Bridge Identifier has priority 32768, address c203.1e50.0000
  Configured hello time 2, max age 20, forward delay 15
  Current root has priority 32768, address c202.1568.0000
  Root port is 4 (FastEthernet0/0), cost of root path is 19
  Topology change flag not set, detected flag not set
  Number of topology changes 0 last change occurred 00:15:16 ago
  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 4 (FastEthernet0/0) of Bridge group 10 is forwarding
   Port path cost 19, Port priority 128, Port Identifier 128.4.
   Designated root has priority 32768, address c202.1568.0000
   Designated bridge has priority 32768, address c202.1568.0000
   Designated port id is 128.4, designated path cost 0
   Timers: message age 2, forward delay 0, hold 0
   Number of transitions to forwarding state: 1
   BPDU: sent 0, received 420

 Port 5 (FastEthernet0/1) of Bridge group 10 is blocking
   Port path cost 19, Port priority 128, Port Identifier 128.5.
   Designated root has priority 32768, address c202.1568.0000
   Designated bridge has priority 32768, address c202.1568.0000
   Designated port id is 128.5, designated path cost 0
   Timers: message age 2, forward delay 0, hold 0
   Number of transitions to forwarding state: 0
   BPDU: sent 0, received 416
The topology used along with the configuration files is available here.

No comments:

Post a Comment