summaryrefslogtreecommitdiffstats
path: root/meta-openstack/Documentation/README.networking
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2014-05-23 23:49:49 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-05-23 23:49:49 -0400
commit649327f80dc331943d448e87f73ecaadcc78a22a (patch)
tree2d640deedbc19b925f5539a31da26f2f7a6249c8 /meta-openstack/Documentation/README.networking
parentfb1d6f23fa01c0217ed3f6778d8033dd0030db2a (diff)
downloadmeta-cloud-services-649327f80dc331943d448e87f73ecaadcc78a22a.tar.gz
docs: move more READMEs into Documentation
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta-openstack/Documentation/README.networking')
-rw-r--r--meta-openstack/Documentation/README.networking208
1 files changed, 208 insertions, 0 deletions
diff --git a/meta-openstack/Documentation/README.networking b/meta-openstack/Documentation/README.networking
new file mode 100644
index 0000000..2299de3
--- /dev/null
+++ b/meta-openstack/Documentation/README.networking
@@ -0,0 +1,208 @@
1Networking
2==============
3
4Description
5-----------
6OpenStack provides tools to setup many different network topologies using
7tunnels, Vlans, GREs... the list goes on. In this document we describe how to
8setup 3 basic network configurations which can be used as building blocks for a
9larger network deployment. Going through these setups also tests that the
10Open vSwitch plugin and DHCP and l3 agents are operating correctly.
11
12
13Assumptions
14-----------
15The following assumes you have built the controller and compute nodes for the
16qemux86-64 machine as described in README.setup and have been able to spin-up an
17instance successfully.
18
19
20Prerequisites
21-------------
22
231. Following the instructions in README.setup to spin-up your controller and
24compute nodes in VMs will result in NATed tap interfaces on the host. While this
25is fine for basic use it will not allow you to use things like GRE tunnels as
26the packet will appear to be coming from the host when it arrives at the other
27end of the tunnel and will therefore be rejected (since the src IP will not
28match the GRE's remote_ip). To get around this we must setup an Open vSwitch
29bridge on the host and attach the taps. Open vSwitch must therefore be installed
30and running on the host.
31
32On Ubuntu systems this may be done via:
33sudo apt-get install openvswitch-switch openvswitch-common
34
352. Also since we will be using an Open vSwitch on the host we need to ensure the
36controller and compute network interfaces have different MAC addresses. We
37therefor must modify the runqemu script as per the following:
38
39--- a/scripts/runqemu-internal
40+++ b/scripts/runqemu-internal
41@@ -252,7 +252,7 @@ else
42 KERNEL_NETWORK_CMD="ip=192.168.7.$n2::192.168.7.$n1:255.255.255.0"
43 QEMU_TAP_CMD="-net tap,vlan=0,ifname=$TAP,script=no,downscript=no"
44 if [ "$KVM_ACTIVE" = "yes" ]; then
45- QEMU_NETWORK_CMD="-net nic,model=virtio $QEMU_TAP_CMD,vhost=on"
46+ QEMU_NETWORK_CMD="-net nic,macaddr=52:54:00:12:34:$(printf '%x' $((RANDOM % 170))),model=virtio $QEMU_TAP_CMD,vhost=on"
47 DROOT="/dev/vda"
48 ROOTFS_OPTIONS="-drive file=$ROOTFS,if=virtio"
49 else
50---
51this will not guarantee distinct MAC addresses but most of the time they will be.
52
53
54Host Open vSwitch bridge
55------------------------
56As per the prerequisites we need to setup a bridge on the host to avoid NATed
57tap interfaces. After you have used 'runqemu' to boot your controller and
58compute nodes perform the following instructions on your host
59
60(I will assume tap0 - controller, tap1 - compute, use 'ip a s' or 'ifconfig' to
61identify the tap interfaces)
62
63sudo ovs-vsctl add-br br-int
64sudo ovs-vsctl add-port br-int tap0
65sudo ovs-vsctl add-port br-int tap1
66sudo ip address del 192.168.7.1/24 dev tap0
67sudo ip address del 192.168.7.3/24 dev tap1
68sudo ip address add 192.168.7.1/24 broadcast 192.168.7.255 dev br-int
69sudo route del 192.168.7.2 tap0
70sudo route del 192.168.7.4 tap1
71
72
73NOTE: Any time you reboot the controller or compute nodes you will
74want to remove and re-add the port via:
75# ovs-vsctl del-port br-int tapX
76# ovs-vsctl add-port br-int tapX
77# ip address del 192.168.7.Y/24 dev tapX
78(where X and Y are substituted accordingly)
79This will also ensure the ARP tables in the vSwitch are updated since
80chances are the MAC address will have changed on a reboot due to the
81MAC randomizer of prerequisite 2.
82
83
84Controller/Compute network setup
85--------------------------------
86The neutron Open vSwitch plugin expects several bridges to exist on
87the controller and compute nodes. When the controller and compute
88nodes are first booted however these do not exist and depending on how
89you are setting up your network this is subject to change and as such
90is not 'baked' in to our images. This would normally be setup by
91cloud-init, chef, cobbler or some other deployment scripts. Here we
92will accomplish it by hand.
93
94On first boot your network will look like this: (controller node)
95---snip---
96root@controller:~# ip a show eth0
972: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
98 link/ether 52:54:00:12:34:a9 brd ff:ff:ff:ff:ff:ff
99 inet 192.168.7.2/24 brd 192.168.7.255 scope global eth0
100 valid_lft forever preferred_lft forever
101 inet6 fe80::5054:ff:fe12:34a9/64 scope link
102 valid_lft forever preferred_lft forever
103
104root@controller:~# ovs-vsctl show
105524a6c84-226d-427b-8efa-732ed7e7fa43
106 Bridge br-int
107 Port patch-tun
108 Interface patch-tun
109 type: patch
110 options: {peer=patch-int}
111 Port br-int
112 Interface br-int
113 type: internal
114 Bridge br-tun
115 Port br-tun
116 Interface br-tun
117 type: internal
118 Port patch-int
119 Interface patch-int
120 type: patch
121 options: {peer=patch-tun}
122 ovs_version: "2.0.0"
123---snip---
124
125To complete the expected network configuration you must add a bridge
126which will contain the physical interface as one of its ports and move
127the IP address from the interface to the bridge. The following will
128accomplish this:
129
130ovs-vsctl add-br br-eth0
131ovs-vsctl add-port br-eth0 eth0
132ip address del 192.168.7.2/24 dev eth0
133ip address add 192.168.7.2/24 broadcast 192.168.7.255 dev br-eth0
134route add default gw 192.168.7.1
135
136And now you network will look like the following:
137---snip---
138root@controller:~# ip a s
139...skip
1402: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master ovs-system state UP group default qlen 1000
141 link/ether 52:54:00:12:34:a9 brd ff:ff:ff:ff:ff:ff
142...skip
1437: br-eth0: <BROADCAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default
144 link/ether ae:f8:be:7c:78:42 brd ff:ff:ff:ff:ff:ff
145 inet 192.168.7.2/24 scope global br-eth0
146 valid_lft forever preferred_lft forever
147 inet6 fe80::e453:1fff:fec1:79ff/64 scope link
148 valid_lft forever preferred_lft forever
149
150root@controller:~# ovs-vsctl show
151524a6c84-226d-427b-8efa-732ed7e7fa43
152 Bridge "br-eth0"
153 Port "eth0"
154 Interface "eth0"
155 Port "br-eth0"
156 Interface "br-eth0"
157 type: internal
158 Bridge br-int
159 Port patch-tun
160 Interface patch-tun
161 type: patch
162 options: {peer=patch-int}
163 Port br-int
164 Interface br-int
165 type: internal
166 Bridge br-tun
167 Port br-tun
168 Interface br-tun
169 type: internal
170 Port patch-int
171 Interface patch-int
172 type: patch
173 options: {peer=patch-tun}
174 ovs_version: "2.0.0"
175
176At this point you will want to restart the neutron network services
177
178(controller)
179/etc/init.d/neutron-openvswitch-agent stop
180/etc/init.d/neutron-dhcp-agent stop
181/etc/init.d/neutron-server reload
182/etc/init.d/neutron-dhcp-agent start
183/etc/init.d/neutron-openvswitch-agent start
184
185(Compute)
186/etc/init.d/neutron-openvswitch-agent stop
187/etc/init.d/nova-compute reload
188/etc/init.d/neutron-openvswitch-agent start
189
190
191NOTE: on a reboot the Open vSwitch configuration will remain but at
192this point in time you will need to manually move the IP address from
193the eth0 interface to the br-eth0 interface using
194
195ip address del 192.168.7.2/24 dev eth0
196ip address add 192.168.7.2/24 broadcast 192.168.7.255 dev br-eth0
197
198With this network configuration on the controller and similar
199configuration on the compute node (just replace 192.168.7.2 with
200192.168.7.4) everything is ready to configure any of the 3 network
201sample configurations.
202
203Further reading
204---------------
205
206README.networking_flat
207README.networking_vlan
208README.networking_l3_router \ No newline at end of file