Samstag, 21. November 2009

EN - Layer 2 redundancy with routers

Yesterday I was playing around with dynamips and found a really cool solution to a problem that well not exists. But after thinking a while I found a situation at a customer location that could make use of my idea.

I'll describe the situation.
The customer has one core switch located in his main building and across his (large) campus a few distribution switches. All switches are layer 2 only so no routing stuff. Since the network small (a view servers and some hand full of workstations) the customer uses one class C subnet (eg 172.20.3.0 /24)
The problem is, the internet access is located near 2 edge switches but far from the main building. So the Edge Router is placed with one WAN interfaces and 2 LAN interfaces one connecting to each edge switch
This looks like this diagram:


So this leads to one obvious question, how do you provide on those LAN interfaces ONE gateway IP (remember no dynamic routing plain default gateway)
The solution is easy: build a bridge group and add a Bridged Virtual Interface (BVI)

How this is done? Just a second I'll show you.
Start with the usual fluff: name, domain, ntp whatever you need and want.

enable
configure terminal

hostname EdgeRouter
ip domain-name playingwithnetworks.com
no ip domain-lookup

line console 0
logging synchronous
password #sicher01
login

line vty 0 4
logging synchronous
password #sicher01
login
transport input telnet


OK you should add of course logging, ntp, ssh security and so on but this would be to much.

Now the next step becomes interesting.
Apply the bridging settings


bridge irb
! enables bridging with routing

bridge 1 protocol ieee
! tells the router what protocol to bridge on bridge group 1

bridge 1 route ip
! tells the router what protocol to route (not what routing protocol )

! configure your LAN interfaces
interface fastEthernet 0/0
description ### LAN Link to EdgeSwitch01 ###
bridge-group 1
! add interface to bridging group 1

! configure your LAN interfaces
interface fastEthernet 0/1
description ### LAN Link to EdgeSwitch02 ###
bridge-group 1
! add interface to bridging group 1

interface BVI 1
description ### routing interface of bridge group 1 ###
ip address 172.20.3.1 255.255.255.0
no shutdown


Next thing you need is to configure the interface to the ISP, this is usual stuff done about a hundred of times and set your default route.

interface Serial0/0
description ### ISP Uplink ###
ip address 172.20.4.2 255.255.255.252
no shutdown

ip route 0.0.0.0 0.0.0.0 Serial0/0 172.20.4.1

Well that's it !!

To verify that all is working, issue a show spanning-tree on your EdgeRouter

Bridge group 1 is executing the ieee compatible Spanning Tree protocol
(…)
Port 3 (FastEthernet0/0) of Bridge group 1 is forwarding
(...)
Port 4 (FastEthernet0/1) of Bridge group 1 is blocking
(…)

By now you know that what we've done is, we've turned the LAN side of our Router into a switch and let spanning tree do the path selection. We could have bought a switching module for our router or created a third single point of failure (1st is only one CoreSwitch, 2nd is only one Edge Router) and set up a physical switch between the edge switches and our router.

Keine Kommentare:

Kommentar veröffentlichen