Using a switch instead of a hub can do a lot to help you get the most of out the available bandwidth on your network. The disadvantage is that when you need to use a protocol analyzer, you will only see the broadcast traffic that is sent to all ports on a switch, not traffic to and/or from a particular workstation or server plugged into the switch.
This is where port mirroring comes into the picture. You pick the port you want to monitor and then also the port that the traffic on the monitored port will be copied or mirrored to. Port mirroring is not something that you will want to do all the time, but it is useful to know how to do it. In this Daily Feature, I will show you exactly how to set up port mirroring on a Bay 450 switch.
Preparing to configure the Bay 450 switch
The way you will configure the Bay 450 switch initially requires that you connect a PC to the console port on the Bay switch. Bay doesn’t supply the cable you need, but one can be obtained easily through Radio Shack or similar companies. You will need a DB9 straight-through cable with a connector that fits your particular laptop. I use a Compaq Armada that has a DB9 serial connector, so the straight-through cable works well with the addition of an inline female-to-female converter that lets the serial cable have female connectors on both ends. Configure a session in HyperTerminal to use the COM port on your laptop with settings of 9600 baud, 8 data bits, 1 stop bit, and no parity. Save this session for later use.
Configuring the switch
The first thing that you will need to do is assign an IP address to the switch so that later you can telnet into the switch and not use a laptop (unless you prefer to do so). After connecting the serial cable and going into the HyperTerminal session you set up, press [Ctrl]Y and then press [Enter]. You should see a BayStack 450-24T Main Menu screen (see Figure A). Highlight the IP Configuration/Setup option and press [Enter] to continue. When the IP Configuration/Setup screen appears, press the spacebar until the BootP Request Mode selection goes to Disabled. As a general rule, you won’t want a switch to be able to have a different address if its lease doesn’t get renewed on time. It can be a real problem trying to manage network devices such as switches when the address doesn’t stay the same.
|Through the HyperTerminal session, you can log onto the Bay 450 switch.|
Press the Down Arrow key until you get to the In-Band Switch IP Address line. Enter the IP address you want assigned to this switch and press [Enter] to continue. Press the Down Arrow key again and you will be at the In-Band Subnet Mask line. Enter the subnet mask that matches the IP address you just entered above and press [Enter]. Press the Down Arrow key one more time and you will be at the Default Gateway line. Enter the IP address of the default gateway for this segment and press [Enter]. After you have entered all the information, you should see it in both the Configurable and In Use columns. Press [Ctrl]C to return to the Main Menu.
Setting up port mirroring
At this point, you are ready to set up port mirroring. From the Bay 450 Main Menu, press the Down Arrow key until you have highlighted the Switch Configuration option and press [Enter]. From the Switch Configuration Menu, press the Down Arrow key until you highlight the Port Mirroring Configuration option and then press [Enter]. When you get to the Port Mirroring Configuration screen (see Figure B), the Monitoring Mode will be set to Disabled by default. Press the spacebar and look at the different options that are available. If both of the devices you want to monitor are not on the same switch, the best you will be able to do is to watch all the traffic coming in and out of one port. In our case, we want to look at all traffic coming to and from a particular device. Press the spacebar until you see <-> Port X. This will copy all traffic going to the port being mirrored over to the port that is doing the monitoring.
|The Port Mirroring Configuration screen offers a complete set of configuration options.|
Press [Enter] to move down to the Monitor Port line. Type the port number that you want to do the monitoring with and press [Enter]. Using the Down Arrow key, move down to the Unit/Port X line. Enter the port number that you want to monitor and press [Enter]. Press the Down Arrow key until you are on the Port Mirror Configuration question line. Press the spacebar until Yes appears as an option. Press [Enter] to begin the Port Mirroring operation.
What you have just gone through is port mirroring a single port on a single switch. In the case of multiple Bay 450s in a single stack and interconnected with a cable running through a special interconnect module in the back of each Bay 450 in that stack, you will be able to monitor the ports of both systems on which you need to capture or analyze the network traffic. If you know the MAC addresses of the systems but not the port numbers of where they are connected, you also have the option in the Bay switches to monitor the traffic based on the MAC address instead of a physical port number. In this case, instead of entering the port number(s) that you want to monitor, you would enter the MAC addresses of the systems that you want to watch.
Port mirroring is not something you will need to do everyday, but it is something that is useful to know how to do. Although this article has shown you how to do port mirroring using a Bay 450 switch, this same feature should be available in just about any hub that is on the market today.