Richard J Green

Using SDM with GNS3 and Dynamips in Windows 7

I am currently experimenting with the GNS3 and Dynamips network emulation platform to help me get to grips with some of the Cisco IOS commands for my CCNA, and I ran into a problem yesterday.

Parts of the ICND1 exam require knowledge of the Cisco SDM GUI application, however as it stands you cannot access the routers and switches within your GNS3 environment.

A link on the GNS3 forum takes you to a video which someone has produced providing instructions on how to access and use SDM for your virtual routers, however instructions are for Windows XP and cannot be followed for Windows 7.

If you are using GNS3 and Dynamips then follow these steps to get SDM working.

Step 1: Installing a Loopback Network Interface

To do this, hit Start + R on your keyboard to open the Run dialog. At the Run dialog, enter the command compmgmt.msc to open Computer Management.

From Computer Management, right click on the parent level item which is displayed as the hostname of your computer (RGREEN00 in my case). From the context menu, select the option Add Legacy Hardware.

At the Add Hardware Wizard, select Next.

At this point, allow the wizard to search for and install hardware automatically. Unless you have some pending hardware adds or changes you will not see any new hardware detection during this stage. Once the scan for new hardware is complete, you will be given the option to press Next to manually search for the hardware. Click Next to do so.

From the list of hardware types, select the Network adapters category, and then select Next.

On the next page, you will be presented with a list of available network adapters which you can add. Select Microsoft from the manufacturer column on the left and scroll down to select Microsoft Loopback Adapter from the list on the right. Once you have selected it, hit the Next button to install the hardware.

Step 2: Reboot

You need to reboot at this stage to allow Dynamips to be able to detect the new adapter.

Step 3: Create a Virtual Network Platform

If you already have a platform you want to be able to interact with then ignore this step, otherwise, you should launch GNS3 and create a new environment containing the model router with the appropriate amount of memory and the appropriate IOS image available to support the use of SDM.

For my purposes, I am using a Cisco 2651XM router because I have just purchased one, however if you are doing this purely virtually then you can use any 2600 Series model from the XM branch. This is because the non-XM models have insufficient memory to accommodate the SDM installation.

Once you have placed a router in the environment, save a copy of the configuration to disk. This will create a .net file.

Step 4: Determine the GUID for the Loopback Adapter

In Windows XP, a script provided with Dynamips and GNS3 does this part for you, however the script doesn’t appear to work in Windows 7 so we need to do it manually.

Open an Elevated Command Prompt (An Administrator Command Prompt).

From the command prompt, type the command reg query “HKLMSOFTWAREMicrosoftWindows NTCurrentVersionNetworkCards” /s

The output will look something like this:

HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionNetworkCards12
    ServiceName    REG_SZ    {DC4B6C52-BF22-464D-ACE7-4FA7BBAA267D}
    Description    REG_SZ    Broadcom NetXtreme 57xx Gigabit Controller

HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionNetworkCards30
    ServiceName    REG_SZ    {B523F7E0-5534-4328-BB4F-62DBAC0A10CE}
    Description    REG_SZ    Microsoft Loopback Adapter

HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionNetworkCards34
    ServiceName    REG_SZ    {BDFF6BE0-8921-4085-AF1B-BB3A3624B3FC}
    Description    REG_SZ    Microsoft Loopback Adapter

HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionNetworkCards8
    ServiceName    REG_SZ    {0136A94D-ED2E-470B-933B-BBF12FD589D6}
    Description    REG_SZ    Dell Wireless 1490 Dual Band WLAN Mini-Card

In the example above, I have truncated the results – There was actually about twice this many.

In the example above, network card number 30 and 34 are two Loopback Adapters I have installed on my machine. We are interested in the GUID or the ServiceName here. The GUID in my case is {B523F7E0-5534-4328-BB4F-62DBAC0A10CE}, so copy this to the clipboard.

Step 5: Edit the GNS3 .net File to Include the Interface

Now that you have the GUID, we can edit the file. Navigate to the file you saved in Step 2 or navigate to your existing configuration if you had one. Once you have located it, open it with Notepad or WordPad.

Within the file locate the configuration portion for the router you want to connect to: That is ROUTER R1 in my example. You will see the lines x and y. These define the position of the router on the graphical layout in GNS3. The console line dictates the port number used for the console session.

Add a new line and name it the interface on your router to connect to. My 2651XM has two FastEthernet ports, and I will be using Fa0/0 for the WAN interface so I have defined Fa0/1 as the interface.

You will now type the following:
Fa0/1 = nio_gen_eth:DeviceNPF_{B523F7E0-5534-4328-BB4F-62DBAC0A10CE}

To translate, this means the following:

Fa0/1 This defines the interface you wish to use on the router for the connection.
nio_gen_eth This instructs GNS3 to add a Generic Ethernet adapter.
DeviceNPF_ This provides GNS3 the instruction that this is a device on the local system you want to map to.
{B523F7E0-5534-4328-BB4F-62DBAC0A10CE} This is GUID you copied from the clipboard.

Step 6: Assign a Static Address

You need to assign an address to your loopback adapter so that you can communicate via IP with the router in GNS3. Go to Start and Network. From Network, select Network and Sharing Center in the toolbar and then Change Adapter Settings from the options on the left.

Double click on the loopback adapter you created to open the status.

From the status page, select the Properties button to view the adapter properties.

As you will see from the image above, I have turned off the IPv6 protocol for this interface because I want to keep things simple for now and ensure everything goes over IPv4. You should probably do the same.

Select the IPv4 IP Protocol entry and select Properties.

You should change from the default setting of Obtain an IP address automatically to Use the following IP address and specify an address manually. Ensure that you assign an address in the same network subnet as you will be configuring the router with.

In my example, I have configured 192.168.100.110 and a subnet of 255.255.255.0. Just for completeness, I have assigned the default gateway as the IP address I will be assigning the router.

Select OK and then Close to save the changes.

Step 6: Open GNS3 and Your Configuration

When you open GNS3, select the Open Project option and select your file.

You will see that GNS3 has added a cloud item to your configuration and that a link has been created between the router and the cloud. This represents your Loopback adapters link.

Step 7: Power on the Router and Configure an IP Address

Right click on the router in the visual layout and select Start. After a few seconds the red light for the link status light for the router will go green to show that the router is coming up. Now right click on the router and select Console to open a console session to the router.

The router will probably ask you if you want to use the Initial Configuration Dialog. I have said no, but you may wish to say yes – Up to you.

Configuring the IP address on the router is easy if you can remember the IOS commands from ICND1. Here they are:

enable
configure terminal
interface Fa0/1
ip address 192.168.100.254 255.255.255.0
no shutdown
exit
exit

After entering these commands you will see the router print the following to the output to the console:

*Mar  1 00:02:21.251: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
*Mar  1 00:02:22.253: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

This indicates that the link is up, however we are still going to test it.

From the console to the router enter the command ping 192.168.100.110 where that is the IP address I assigned to my Loopback Adapter.

If your link is working you will see the following printed from the router console:

Router#ping 192.168.100.110

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.100.110, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/37/112 ms
Router#

Success – I’ve got a working connection.

Step 8: Configure the Router for SDM

The documentation with SDM will give you these instructions later if you haven’t configured this already, however it makes sense to do it now while console connected to the router. I won’t go into detail explaining the commands as you can look them up on the Cisco IOS Command documentation online.

enable
configure terminal
hostname RouterA
ip domain-name test.local
crypto key generate rsa > Define a key length of 1024 or greater for SDM to work.
ip http server
ip http secure-server
username netadmin privilege 15 secret 0 netadmin
line vty 0 4
privilege level 15
login local
transport input telnet ssh

The Cisco documentation states that you need to enter the command ip http authentication local also, however I had no need for this in my configuration.

 

Step 9: Obtain SDM

I’m not going to walk through this. It’s a free download from Cisco. Go to Bing or Google and search for Cisco SDM and you will find a download link. It does require you to have a Cisco account but it’s free to register for now.

Step 10: Install SDM

Once again, I’m not going to walk through this, however unzip the file downloaded from Cisco and run setup.exe. When you are prompted where you want to install SDM, say This Computer only.

Step 11: Run and Use SDM

Upon launching SDM you get the following screen. From here you can enter the IP address of your router and force the use of HTTPS if you have it configured.

Once you enter the IP address, the SDM launcher will open a browser window and you should then see an authentication window appear. Enter the username and password you provided in Step 8: Configure the Router for SDM as the username and password.

Shortly after entering your username and password, the Cisco SDM application will start to launch.

The SDM application takes some time to get going for the first time, so expect to wait anything up to five minutes before you see any kind of user interface.

Exit mobile version