Bridging |
|
Introduction
Bridging is a forwarding technique used in packet-switched computer networks. Unlike routing, bridging makes no assumptions about where in a network a particular address is located. Instead, it depends on flooding and examination of source addresses in received packet headers to locate unknown devices. A bridge is a device that connects two or more network segments within one logical network (e.g. a single IP-subnet). A bridge behaves like a network switch (i.e. Layer 2 Switch). Now, lets see how routing and bridging can happen simultaneously on the router. To demonstrate this feature, lets take a network scenario as shown in fig-1. The network machines must have their IP address and default route set as indicated below:
Network Diagram
![]()
Configuration
Machine-1 root@machine-1# ifconfig eth0 192.168.1.10/16 Machine-2 root@machine-2# ifconfig eth0 192.168.1.20/16 At this moment, machine-1 and machine-2 being in different LAN segments, will not be able to reach (eg ping) each other. Also lets take Router-B as our neighbor router with the following configuration: Okapi(config)# interface FastEthernet 0 Now lets configure Okapi router, Router-A with following steps: Lets create a bridge with id 1 and enable STP (Spanning Tree Protocol) on it. Okapi(config)# bridge 1 Now, lets make fastethernet 0 and fastethernet 1 the members of this newly created bridge. Okapi(config)# interface FastEthernet 0 Okapi(config)# interface FastEthernet 1 Lets, assign an IP address to our bridge interface and make it a part of same logical subnet ie 192.168.0.0/16 Okapi(config)# interface Bridge_VI 1 Then configure serial interface as indicated below to establish a serial link with the neighbor router, Router-B. Okapi(config)# interface AsyncSerial 0 And finally lets enable RIP on serial and bridge interfaces. Okapi(config)# router rip With this configuration on Okapi router, the two ethernet interfaces are bridged together and will act as a single logical interface which is named as Bridge_VI 1. With this bridge, the two LAN segments are connected together enabling both the segments reaching each other. Which means now machine-1 can reach (eg ping) machine-2. Also as we have enabled RIP on Okapi, it will be able to discover dynamic routes through its neighbor RIP running on Router-B. With this we have bridging and routing both happening on our Okapi router, Router-A. This can be verified by pinging various destinations from machine-1 as: root@machine-1# ping 192.168.1.20 (pinging machine-2 on LAN-2). This verifies bridging |