diff --git a/rackspace/rackconnect/v3/cloudnetworks/requests.go b/rackspace/rackconnect/v3/cloudnetworks/requests.go
new file mode 100644
index 0000000..33f5e04
--- /dev/null
+++ b/rackspace/rackconnect/v3/cloudnetworks/requests.go
@@ -0,0 +1,27 @@
+package cloudnetworks
+
+import (
+	"github.com/rackspace/gophercloud"
+	"github.com/rackspace/gophercloud/pagination"
+)
+
+// List returns all cloud networks that are associated with RackConnect. The ID
+// returned for each network is the same as the ID returned by the networks package.
+func List(c *gophercloud.ServiceClient) pagination.Pager {
+	url := listURL(c)
+	createPage := func(r pagination.PageResult) pagination.Page {
+		return CloudNetworkPage{pagination.SinglePageBase(r)}
+	}
+	return pagination.NewPager(c, url, createPage)
+}
+
+// Get retrieves a specific cloud network (that is associated with RackConnect)
+// based on its unique ID.
+func Get(c *gophercloud.ServiceClient, id string) GetResult {
+	var res GetResult
+	_, res.Err = c.Request("GET", getURL(c, id), gophercloud.RequestOpts{
+		JSONResponse: &res.Body,
+		OkCodes:      []int{200},
+	})
+	return res
+}
diff --git a/rackspace/rackconnect/v3/cloudnetworks/requests_test.go b/rackspace/rackconnect/v3/cloudnetworks/requests_test.go
new file mode 100644
index 0000000..10d15dd
--- /dev/null
+++ b/rackspace/rackconnect/v3/cloudnetworks/requests_test.go
@@ -0,0 +1,87 @@
+package cloudnetworks
+
+import (
+	"fmt"
+	"net/http"
+	"testing"
+	"time"
+
+	"github.com/rackspace/gophercloud/pagination"
+	th "github.com/rackspace/gophercloud/testhelper"
+	fake "github.com/rackspace/gophercloud/testhelper/client"
+)
+
+func TestListCloudNetworks(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/cloud_networks", func(w http.ResponseWriter, r *http.Request) {
+		th.TestMethod(t, r, "GET")
+		th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+		th.TestHeader(t, r, "Accept", "application/json")
+
+		w.Header().Set("Content-Type", "application/json")
+		fmt.Fprintf(w, `[{
+      "cidr": "192.168.100.0/24",
+      "created": "2014-05-25T01:23:42Z",
+      "id": "07426958-1ebf-4c38-b032-d456820ca21a",
+      "name": "RC-CLOUD",
+      "updated": "2014-05-25T02:28:44Z"
+    }]`)
+	})
+
+	expected := []CloudNetwork{
+		CloudNetwork{
+			CIDR:      "192.168.100.0/24",
+			CreatedAt: time.Date(2014, 5, 25, 1, 23, 42, 0, time.UTC),
+			ID:        "07426958-1ebf-4c38-b032-d456820ca21a",
+			Name:      "RC-CLOUD",
+			UpdatedAt: time.Date(2014, 5, 25, 2, 28, 44, 0, time.UTC),
+		},
+	}
+
+	count := 0
+	err := List(fake.ServiceClient()).EachPage(func(page pagination.Page) (bool, error) {
+		count++
+		actual, err := ExtractCloudNetworks(page)
+		th.AssertNoErr(t, err)
+
+		th.CheckDeepEquals(t, expected, actual)
+
+		return true, nil
+	})
+	th.AssertNoErr(t, err)
+	th.CheckEquals(t, count, 1)
+}
+
+func TestGetCloudNetwork(t *testing.T) {
+	th.SetupHTTP()
+	defer th.TeardownHTTP()
+	th.Mux.HandleFunc("/cloud_networks/07426958-1ebf-4c38-b032-d456820ca21a", func(w http.ResponseWriter, r *http.Request) {
+		th.TestMethod(t, r, "GET")
+		th.TestHeader(t, r, "X-Auth-Token", fake.TokenID)
+		th.TestHeader(t, r, "Accept", "application/json")
+
+		w.Header().Set("Content-Type", "application/json")
+		w.WriteHeader(http.StatusOK)
+		fmt.Fprintf(w, `{
+      "cidr": "192.168.100.0/24",
+      "created": "2014-05-25T01:23:42Z",
+      "id": "07426958-1ebf-4c38-b032-d456820ca21a",
+      "name": "RC-CLOUD",
+      "updated": "2014-05-25T02:28:44Z"
+    }`)
+	})
+
+	expected := &CloudNetwork{
+		CIDR:      "192.168.100.0/24",
+		CreatedAt: time.Date(2014, 5, 25, 1, 23, 42, 0, time.UTC),
+		ID:        "07426958-1ebf-4c38-b032-d456820ca21a",
+		Name:      "RC-CLOUD",
+		UpdatedAt: time.Date(2014, 5, 25, 2, 28, 44, 0, time.UTC),
+	}
+
+	actual, err := Get(fake.ServiceClient(), "07426958-1ebf-4c38-b032-d456820ca21a").Extract()
+	th.AssertNoErr(t, err)
+
+	th.AssertDeepEquals(t, expected, actual)
+}
diff --git a/rackspace/rackconnect/v3/cloudnetworks/results.go b/rackspace/rackconnect/v3/cloudnetworks/results.go
new file mode 100644
index 0000000..282b9ce
--- /dev/null
+++ b/rackspace/rackconnect/v3/cloudnetworks/results.go
@@ -0,0 +1,114 @@
+package cloudnetworks
+
+import (
+	"fmt"
+	"reflect"
+	"time"
+
+	"github.com/jrperritt/gophercloud"
+	"github.com/mitchellh/mapstructure"
+	"github.com/rackspace/gophercloud/pagination"
+)
+
+// CloudNetwork represents a network associated with a RackConnect configuration.
+type CloudNetwork struct {
+	// Specifies the ID of the newtork.
+	ID string `mapstructure:"id"`
+	// Specifies the user-provided name of the network.
+	Name string `mapstructure:"name"`
+	// Specifies the IP range for this network.
+	CIDR string `mapstructure:"cidr"`
+	// Specifies the time the network was created.
+	CreatedAt time.Time `mapstructure:"-"`
+	// Specifies the time the network was last updated.
+	UpdatedAt time.Time `mapstructure:"-"`
+}
+
+// CloudNetworkPage is the page returned by a pager when traversing over a
+// collection of CloudNetworks.
+type CloudNetworkPage struct {
+	pagination.SinglePageBase
+}
+
+// IsEmpty returns true if a CloudNetworkPage contains no CloudNetworks.
+func (r CloudNetworkPage) IsEmpty() (bool, error) {
+	cns, err := ExtractCloudNetworks(r)
+	if err != nil {
+		return true, err
+	}
+	return len(cns) == 0, nil
+}
+
+// ExtractCloudNetworks extracts and returns CloudNetworks. It is used while iterating over
+// a cloudnetworks.List call.
+func ExtractCloudNetworks(page pagination.Page) ([]CloudNetwork, error) {
+	var res []CloudNetwork
+	casted := page.(CloudNetworkPage).Body
+
+	err := mapstructure.Decode(casted, &res)
+
+	var rawNets []interface{}
+	switch casted.(type) {
+	case interface{}:
+		rawNets = casted.([]interface{})
+	default:
+		return res, fmt.Errorf("Unknown type: %v", reflect.TypeOf(casted))
+	}
+
+	for i := range rawNets {
+		thisNet := (rawNets[i]).(map[string]interface{})
+
+		if t, ok := thisNet["created"].(string); ok && t != "" {
+			creationTime, err := time.Parse(time.RFC3339, t)
+			if err != nil {
+				return res, err
+			}
+			res[i].CreatedAt = creationTime
+		}
+
+		if t, ok := thisNet["updated"].(string); ok && t != "" {
+			updatedTime, err := time.Parse(time.RFC3339, t)
+			if err != nil {
+				return res, err
+			}
+			res[i].UpdatedAt = updatedTime
+		}
+	}
+
+	return res, err
+}
+
+// GetResult represents the result of a Get operation.
+type GetResult struct {
+	gophercloud.Result
+}
+
+// Extract is a function that extracts a CloudNetwork from a GetResult.
+func (r GetResult) Extract() (*CloudNetwork, error) {
+	if r.Err != nil {
+		return nil, r.Err
+	}
+	var res CloudNetwork
+
+	err := mapstructure.Decode(r.Body, &res)
+
+	b := r.Body.(map[string]interface{})
+
+	if date, ok := b["created"]; ok && date != nil {
+		t, err := time.Parse(time.RFC3339, date.(string))
+		if err != nil {
+			return nil, err
+		}
+		res.CreatedAt = t
+	}
+
+	if date, ok := b["updated"]; ok && date != nil {
+		t, err := time.Parse(time.RFC3339, date.(string))
+		if err != nil {
+			return nil, err
+		}
+		res.UpdatedAt = t
+	}
+
+	return &res, err
+}
diff --git a/rackspace/rackconnect/v3/cloudnetworks/urls.go b/rackspace/rackconnect/v3/cloudnetworks/urls.go
new file mode 100644
index 0000000..bd6b098
--- /dev/null
+++ b/rackspace/rackconnect/v3/cloudnetworks/urls.go
@@ -0,0 +1,11 @@
+package cloudnetworks
+
+import "github.com/rackspace/gophercloud"
+
+func listURL(c *gophercloud.ServiceClient) string {
+	return c.ServiceURL("cloud_networks")
+}
+
+func getURL(c *gophercloud.ServiceClient, id string) string {
+	return c.ServiceURL("cloud_networks", id)
+}
