Cisco Cloud in a Box

Say you have a small lab network to set up. The network consists of multiple subnets - lots of them.

Or perhaps you're producing lots of different sites, and each site has a different set of subnets that you need to set up.

In both cases, you could dedicate specific ports to specific subnets, and use a whole bunch of VLANs. But then you'd have to remember which port is required for which subnet. AND you would need to set this up again in between each site.

Or may be you can "get fancy" and use multiple switches/routers and set up dynamic routing.

Wouldn't it be easier if it didn't matter which port you connected the devices to? Why indeed do we even need to allocate a particular port to a particular subnet? Why can't the switch just figure it out itself? Why can't we just set up a single switch to act as that mythical internet "cloudy" thingamebob?

Well, it turns out that you can. You can set up a Cisco switch to use multiple subnets on as many ports as you want to.

You can emulate a CLOUD IN A BOX

To do this in a Cisco router, you can use "secondary IP addresses" to add multiple subnets to a port (or VLAN). Noting that when Cisco says "secondary", they actually mean "not primary". It turns out you can add an unlimited number of "secondary" IP addresses, so really "secondary" is a terrible name since it doesn't cover the "tertiary", "quaternary", "quintinery", "hextinal", "septinary", "octinery", "noninarinatinationiminal", or "dectanorial" cases (and so on etc).

Pro-tip: By allocating these additional IPs to VLAN1, it becomes available to all ports by default (assuming the ports haven't been added to trunks or converted to access ports).

Pro-tip 2: Ensure that you also enable "ip routing" or it won't route between subnets! Took me an hour to figure that out.

ip routing

!

interface Vlan1

ip address 10.0.0.1 255.255.255.224 secondary

ip address 10.0.0.33 255.255.255.224 secondary

ip address 10.0.0.65 255.255.255.224 secondary

ip address 10.0.0.97 255.255.255.224 secondary

ip address 10.0.0.129 255.255.255.224 secondary

ip address 10.0.0.161 255.255.255.224 secondary

ip address 10.0.0.193 255.255.255.224 secondary

ip address 10.0.0.225 255.255.255.224 secondary

ip address 192.168.0.1 255.255.255.0

no shutdown

!