February 9, 2012

Learning IPv6 with QEMU

If you’re just getting started with IPv6 you may want to mock it up in a lab with a few hosts. While it’s pretty easy to grab a windows machine running Windows 7 and lab it up you can do this in an even more controlled environment. Here is what you need:

  • GNS3 and your own IOS image
  • a QEMU image. that has IPv6 Support
  • To get started download the QEMU image and throw it somewhere on your hard drive. I put mine in my Virtual Machines folder.

    Next, install GNS3 if you haven’t already done so.

    Now the fun part- get GNS3 to talk to QEMU. From my testing there seems to be an issue with this when running it on a Mac. When you define where the QEMU image is located and then test it fails unless it’s already running. So what I have done here is started the Qemuwrapper from the CLI. Then I go back and load it up in GNS3:

    terminal$:
    terminal$:/Applications/GNS3.app/Contents/Resources/qemuwrapper/qemuwrapper.py
    Qemu Emulator Wrapper (version 0.3.2)
    Copyright (c) 2007-2009 Thomas Pani & Jeremy Grossmann

    Unpacking pemu binary. Qemu TCP control server started (port 10525).

    Here you can see I have now tested QEMU:

    QEMU1

    And you can also see the QEMU image that I have defined:

    QEMU2

    Our next step is to build the topology. Mine is simple, two QEMU hosts and 1 router.

    QEMU3

    Now we can configure the router for simple IPv6 Connectivity:

    !
    ipv6 unicast-routing
    !
    interface FastEthernet0/0
     no ip address
     duplex auto
     speed auto
     ipv6 address 2001:DB8:1::1/64
     ipv6 enable
     ipv6 nd prefix 2001:DB8:1::/64
    !
    interface FastEthernet0/1
     no ip address
     duplex auto
     speed auto
     ipv6 address 2001:DB8:2::1/64
     ipv6 enable
     ipv6 nd prefix 2001:DB8:2::/64
    !
    interface FastEthernet1/0
     no ip address
     shutdown
     duplex auto
     speed auto
    !
    

    Because we have configured the Neighbor Discovery Prefix the QEMU hosts should obtain an IPv6 address via Router Advertisements. On the QEMU host we did nothing and looking at the interface shows us that we have an IPv6 address with the same prefix:

    QEMU4

    The last 64-bits of the host address was configured using EUI-64 formatting. This, for the most part, takes the Mac address of the interface and inserts FFFE in the middle of it.

    Now we should be able to ping the gateway:

    QEMU5

    So far so good! We should also be able to verify the second QEMU host has an IPv6 address:

    QEMU6

    Now for the real test. Let’s see if this router is going to route traffic as a default gateway for the two QEMU hosts. From QEMU Host 2 we ping QEMU host 1:

    QEMU7

    Conclusion

    As you can tell configuring a simple IPv6 lab is not difficult to do. For further testing you could add a few routers and configure IPv6 Routing Protocols like OSPFv3 and EIGRP and the pass IPv6 traffic between the QEMU hosts. Alternatively you could configure an IPv4 backbone and use VTI interfaces to encrypt the IPv6 traffic over the IPv4 network. There is a ton that you can do, and it’s really not that difficult.

    A New Version of GNS3 has been released.

    A new version of GNS3 has been released. This version adds some new features and fixes a few as well. It brings the product to version 0.7.3. The two features I like is the capture ability for QEMU based devices so you can now capture packets for Junos devices and ASA’s. I also like the “reload all devices” feature.

    Read all about the update on GNS3.net.

    Surfing a state of ennui…

    So I’m in the Cisco Office in Richfeild, Oh. this week teaching an ASA class.  Still, I am a bit listless from lack of excitement in my CCIE studies.  Of course I would be much more excited if I had lab gear to study on.  This is the first time in over a year that Ipexpert and IE have been completely booked in the same week. Now I know that there are other vendors out there of rack time.  But I already paid for rack time with IE and Ipexpert and I dont want to spend any more money.  Is that a crime?

    Oh well. I suppose I could do some labs with dynamips.  I just wish there was some canned dynamips topologies for the IE or Ipexpert security workbooks.  Anyone know of someone that has them?  I started creating a topology with GNS3 of Ipexpert lab 1.  The issue I am having is memory.  I have 2 gigs in my macbook and there are 5 routers in lab 1.  I boot 2 and it sucks all my resources.  I try to set the idlepc value and that doesnt help.  Not sure what to do next.

    On another note, does anyone have PIX 7.x running in GNS3 on a Mac?  That would REALLY make me happy!