root / docs / networks.rst @ 2e1e6844
History | View | Annotate | Download (15.8 kB)
1 | b11446c1 | Constantinos Venetsanopoulos | .. _networks: |
---|---|---|---|
2 | b11446c1 | Constantinos Venetsanopoulos | |
3 | b11446c1 | Constantinos Venetsanopoulos | Network Service (part of Cyclades) |
4 | b11446c1 | Constantinos Venetsanopoulos | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
5 | b11446c1 | Constantinos Venetsanopoulos | |
6 | b11446c1 | Constantinos Venetsanopoulos | Network setup overview |
7 | b11446c1 | Constantinos Venetsanopoulos | ====================== |
8 | b11446c1 | Constantinos Venetsanopoulos | |
9 | b11446c1 | Constantinos Venetsanopoulos | Currently the Network Service is part of Cyclades and comes along with the |
10 | b11446c1 | Constantinos Venetsanopoulos | Cyclades software components. |
11 | b11446c1 | Constantinos Venetsanopoulos | |
12 | b11446c1 | Constantinos Venetsanopoulos | Networking is deployment-specific and must be customized based on the specific |
13 | b11446c1 | Constantinos Venetsanopoulos | needs of the system administrator. However, to do so, the administrator needs |
14 | b11446c1 | Constantinos Venetsanopoulos | to understand how each level handles Virtual Networks, to be able to setup the |
15 | b11446c1 | Constantinos Venetsanopoulos | backend appropriately. |
16 | b11446c1 | Constantinos Venetsanopoulos | |
17 | 8f0fc472 | Dimitris Aragiorgis | Since v0.11 Synnefo supports multiple Ganeti clusters (backends). Having in |
18 | 8f0fc472 | Dimitris Aragiorgis | mind that every backend has its locality, there is a high possibility each |
19 | 8f0fc472 | Dimitris Aragiorgis | cluster to have different infrastracture (wires, routers, subnets, gateways, |
20 | 8f0fc472 | Dimitris Aragiorgis | etc.). |
21 | 8f0fc472 | Dimitris Aragiorgis | |
22 | 8f0fc472 | Dimitris Aragiorgis | In the following sections we investigate in a top-down approach, the way |
23 | 8f0fc472 | Dimitris Aragiorgis | networks are defined from the Cyclades, Ganeti, and Backend persperctive. |
24 | 8f0fc472 | Dimitris Aragiorgis | |
25 | b11446c1 | Constantinos Venetsanopoulos | Network @ Cyclades level |
26 | b11446c1 | Constantinos Venetsanopoulos | ------------------------ |
27 | b11446c1 | Constantinos Venetsanopoulos | |
28 | b11446c1 | Constantinos Venetsanopoulos | Cyclades understands two types of Virtual Networks: |
29 | b11446c1 | Constantinos Venetsanopoulos | |
30 | 8f0fc472 | Dimitris Aragiorgis | a) Public Networks |
31 | 8f0fc472 | Dimitris Aragiorgis | b) Private Networks |
32 | 8f0fc472 | Dimitris Aragiorgis | |
33 | 8f0fc472 | Dimitris Aragiorgis | Public Networks are created by the administrator via `snf-manage` commands |
34 | 8f0fc472 | Dimitris Aragiorgis | and can be used by all end-users. Each public network is assigned to a |
35 | 8f0fc472 | Dimitris Aragiorgis | single backend but one backend can have multiple public networks. |
36 | 8f0fc472 | Dimitris Aragiorgis | |
37 | 8f0fc472 | Dimitris Aragiorgis | Private Networks are created by the end-user from the Web UI or the kamaki |
38 | 8f0fc472 | Dimitris Aragiorgis | client and provide isolated Layer 2 connectivity to the end-user. With regard |
39 | 8f0fc472 | Dimitris Aragiorgis | to the fact that a user's VMs may be allocated across different Ganeti clusters |
40 | 8f0fc472 | Dimitris Aragiorgis | (backends), private networks are created in all backends to ensure VMs |
41 | 8f0fc472 | Dimitris Aragiorgis | connectivity. |
42 | 8f0fc472 | Dimitris Aragiorgis | |
43 | 8f0fc472 | Dimitris Aragiorgis | Both types of networks are created dynamically. |
44 | 8f0fc472 | Dimitris Aragiorgis | |
45 | 8f0fc472 | Dimitris Aragiorgis | From the VM perspective, each NIC is attached to a specific Network. |
46 | 8f0fc472 | Dimitris Aragiorgis | |
47 | 8f0fc472 | Dimitris Aragiorgis | When a new VM is created the backend allocator (in Cyclades) decides in which |
48 | 8f0fc472 | Dimitris Aragiorgis | backend to spawn it. Depending on the chosen backend, Synnefo finds the first |
49 | 8f0fc472 | Dimitris Aragiorgis | non-full public Network that exists in the backend. Then attaches the VM's |
50 | 8f0fc472 | Dimitris Aragiorgis | first NIC to this network. |
51 | 8f0fc472 | Dimitris Aragiorgis | |
52 | 8f0fc472 | Dimitris Aragiorgis | Once the VM is created, the user is able to connect the VM to multiple |
53 | 8f0fc472 | Dimitris Aragiorgis | private networks, that himself has already created. |
54 | 8f0fc472 | Dimitris Aragiorgis | |
55 | 8f0fc472 | Dimitris Aragiorgis | A Network can have the following attributes: |
56 | 8f0fc472 | Dimitris Aragiorgis | |
57 | 8f0fc472 | Dimitris Aragiorgis | - IPv4 subnet (mandatory) |
58 | 8f0fc472 | Dimitris Aragiorgis | - IPv4 gateway |
59 | 8f0fc472 | Dimitris Aragiorgis | - IPv6 subnet |
60 | 8f0fc472 | Dimitris Aragiorgis | - IPv6 gateway |
61 | 8f0fc472 | Dimitris Aragiorgis | - public/private flag |
62 | 8f0fc472 | Dimitris Aragiorgis | - flavor |
63 | 8f0fc472 | Dimitris Aragiorgis | |
64 | 8f0fc472 | Dimitris Aragiorgis | Flavor is a way to abstact infrastructure specific options, that are used to |
65 | 8f0fc472 | Dimitris Aragiorgis | ensure connectivity and isolation to the VMs connected to the network. It is a |
66 | 8f0fc472 | Dimitris Aragiorgis | set of options that eventually will guide scripts to set up rules, while |
67 | 8f0fc472 | Dimitris Aragiorgis | creating virtual interfaces in the node level. The available flavors and their |
68 | 8f0fc472 | Dimitris Aragiorgis | options can be found in the Synnefo settings and are configurable. |
69 | 8f0fc472 | Dimitris Aragiorgis | |
70 | 8f0fc472 | Dimitris Aragiorgis | To ensure L2 isolation, Synnefo supports two different mechanisms (see also Node |
71 | 8f0fc472 | Dimitris Aragiorgis | Level section): |
72 | 8f0fc472 | Dimitris Aragiorgis | |
73 | 8f0fc472 | Dimitris Aragiorgis | - assigning one physical VLAN per network |
74 | 8f0fc472 | Dimitris Aragiorgis | - assigning one MAC prefix per network, so that every NIC attached to this |
75 | 8f0fc472 | Dimitris Aragiorgis | network will have this prefix. Isolation is then achieved by filtering |
76 | 8f0fc472 | Dimitris Aragiorgis | rules (via `ebtables`) based on a specific mask (ff:ff:ff:00:00:00, see Node |
77 | 8f0fc472 | Dimitris Aragiorgis | Level section for more details). |
78 | 8f0fc472 | Dimitris Aragiorgis | |
79 | 8f0fc472 | Dimitris Aragiorgis | Having this in mind and in order to prevent assignment of duplicate VLAN/MAC |
80 | 8f0fc472 | Dimitris Aragiorgis | prefix to different networks, Synnefo supports two types of Pools: |
81 | 8f0fc472 | Dimitris Aragiorgis | |
82 | 8f0fc472 | Dimitris Aragiorgis | - Bridge Pool (corresponding to a number of VLANs bridged to those bridges) |
83 | 8f0fc472 | Dimitris Aragiorgis | - MAC prefix Pool |
84 | b11446c1 | Constantinos Venetsanopoulos | |
85 | 8f0fc472 | Dimitris Aragiorgis | For Pool handling refer to the corresponding doc section. |
86 | b11446c1 | Constantinos Venetsanopoulos | |
87 | 8f0fc472 | Dimitris Aragiorgis | Finally, each supported flavor must declare the following options (see also |
88 | 8f0fc472 | Dimitris Aragiorgis | Ganeti Level section): |
89 | b11446c1 | Constantinos Venetsanopoulos | |
90 | 8f0fc472 | Dimitris Aragiorgis | - ``mode`` ('bridged' or 'routed'), |
91 | 8f0fc472 | Dimitris Aragiorgis | - ``link`` ('br100', 'rt200', 'pool') |
92 | 8f0fc472 | Dimitris Aragiorgis | - ``mac_prefix`` ('aa:00:05', 'pool', None) |
93 | 8f0fc472 | Dimitris Aragiorgis | - ``tags`` (['ip-less-routed' or 'mac-filtered' or 'physical-vlan' or None]) |
94 | b11446c1 | Constantinos Venetsanopoulos | |
95 | 8f0fc472 | Dimitris Aragiorgis | Existing network flavors are the following: |
96 | b11446c1 | Constantinos Venetsanopoulos | |
97 | 8f0fc472 | Dimitris Aragiorgis | - ``DEFAULT``: { bridged, br0, aa:00:00, [] } |
98 | 8f0fc472 | Dimitris Aragiorgis | - ``IP_LESS_ROUTED``: { routed, snf_public, aa:00:00, [ip-less-routed] } |
99 | 8f0fc472 | Dimitris Aragiorgis | - ``MAC_FILTERED``: { bridged, br0, pool, [mac-filtered] } |
100 | 8f0fc472 | Dimitris Aragiorgis | - ``PHYSICAL_VLAN``: { bridged, pool, aa:00:00, [physical-vlan] } |
101 | 8f0fc472 | Dimitris Aragiorgis | - ``CUSTOM``: {} |
102 | b11446c1 | Constantinos Venetsanopoulos | |
103 | 8f0fc472 | Dimitris Aragiorgis | The end-user is allowed to create only networks of flavor ``MAC_FILTERED`` and |
104 | 8f0fc472 | Dimitris Aragiorgis | ``PHYSICAL_VLAN``. The administrator is able to create any of the above flavors or |
105 | 8f0fc472 | Dimitris Aragiorgis | explicitly define any of their options (mode, link, etc..) using the |
106 | 8f0fc472 | Dimitris Aragiorgis | `snf-manage network-create` command. In this case the flavor of the network is |
107 | 8f0fc472 | Dimitris Aragiorgis | marked as ``CUSTOM`` and cannot make use of existing pools. Because of that |
108 | 8f0fc472 | Dimitris Aragiorgis | link or mac uniqueness cannot be guaranteed. |
109 | b11446c1 | Constantinos Venetsanopoulos | |
110 | b11446c1 | Constantinos Venetsanopoulos | Network @ Ganeti level |
111 | b11446c1 | Constantinos Venetsanopoulos | ---------------------- |
112 | b11446c1 | Constantinos Venetsanopoulos | |
113 | b11446c1 | Constantinos Venetsanopoulos | Currently, Ganeti does not support IP Pool management. However, we've been |
114 | b11446c1 | Constantinos Venetsanopoulos | actively in touch with the official Ganeti team, who are reviewing a relatively |
115 | 8f0fc472 | Dimitris Aragiorgis | big patchset that implements this functionality. We hope that the functionality |
116 | 8f0fc472 | Dimitris Aragiorgis | will be merged to the Ganeti master branch soon and appear on Ganeti 2.7. |
117 | 8f0fc472 | Dimitris Aragiorgis | You can find it in https://code.grnet.gr/git/ganeti-local stable-2.6-grnet |
118 | 8f0fc472 | Dimitris Aragiorgis | (among with hotplug and external storage interface support). |
119 | b11446c1 | Constantinos Venetsanopoulos | |
120 | 8f0fc472 | Dimitris Aragiorgis | Any network created in Synnefo is also created in one (for public networks) or |
121 | 8f0fc472 | Dimitris Aragiorgis | all (for private networks) Ganeti backends. In Ganeti a network can have the |
122 | 8f0fc472 | Dimitris Aragiorgis | following options: |
123 | b11446c1 | Constantinos Venetsanopoulos | |
124 | 8f0fc472 | Dimitris Aragiorgis | - network (192.168.0.0/24, mandatory) |
125 | 8f0fc472 | Dimitris Aragiorgis | - gateway (192.168.0.1) |
126 | 8f0fc472 | Dimitris Aragiorgis | - network6 (2001:648:2ffc:1201::/64) |
127 | 8f0fc472 | Dimitris Aragiorgis | - gateway6 (2001:648:2ffc:1201::1) |
128 | 8f0fc472 | Dimitris Aragiorgis | - mac_prefix (aa:00:01) |
129 | 8f0fc472 | Dimitris Aragiorgis | - type (private, public) |
130 | 8f0fc472 | Dimitris Aragiorgis | - tags |
131 | b11446c1 | Constantinos Venetsanopoulos | |
132 | 8f0fc472 | Dimitris Aragiorgis | Networks in Ganeti cannot be used unless they are connected to a nodegroup in |
133 | 8f0fc472 | Dimitris Aragiorgis | order to define the connectivity mode and link. Synnefo, after creating a |
134 | 8f0fc472 | Dimitris Aragiorgis | network, connects it to all nodegroups of the Ganeti cluster(s) with the given |
135 | 8f0fc472 | Dimitris Aragiorgis | mode and link (defined in the network flavor). |
136 | 8f0fc472 | Dimitris Aragiorgis | |
137 | 8f0fc472 | Dimitris Aragiorgis | Ganeti makes use of environment variables to inform scripts about each NIC's |
138 | 8f0fc472 | Dimitris Aragiorgis | setup. `kvm-vif-script` that comes with `snf-network` sets up the nfdhcpd lease and |
139 | 8f0fc472 | Dimitris Aragiorgis | applies any rules needed depending on the network's mode, link, mac_prefix and |
140 | 8f0fc472 | Dimitris Aragiorgis | tags. |
141 | b11446c1 | Constantinos Venetsanopoulos | |
142 | b11446c1 | Constantinos Venetsanopoulos | Network @ Physical host level |
143 | b11446c1 | Constantinos Venetsanopoulos | ----------------------------- |
144 | b11446c1 | Constantinos Venetsanopoulos | |
145 | 8f0fc472 | Dimitris Aragiorgis | Currently, networking infrastructure must be pre-provisioned before creating |
146 | 8f0fc472 | Dimitris Aragiorgis | networks in Synnefo. According to which flavors you want to support, you should |
147 | 8f0fc472 | Dimitris Aragiorgis | have already setup all your physical hosts correspondingly. This means you |
148 | 8f0fc472 | Dimitris Aragiorgis | need: |
149 | 8f0fc472 | Dimitris Aragiorgis | |
150 | 8f0fc472 | Dimitris Aragiorgis | - one bridge for the ``DEFAULT`` flavor (br0, see Fig. 1) |
151 | 8f0fc472 | Dimitris Aragiorgis | - one bridge for the ``MAC_FILTERED`` flavor (prv0, see Fig. 2) |
152 | 8f0fc472 | Dimitris Aragiorgis | - a number of bridges and their corresponding VLANs (bridged to them) for |
153 | 8f0fc472 | Dimitris Aragiorgis | the ``PHYSICAL_VLAN`` flavor (prv1..prv100, see Fig. 3) |
154 | 8f0fc472 | Dimitris Aragiorgis | - a routing table for the ``IP_LESS_ROUTED`` flavor (snf_public, see Fig. 4) |
155 | 8f0fc472 | Dimitris Aragiorgis | |
156 | 8f0fc472 | Dimitris Aragiorgis | Please refer to the following figures, which clarify each infrastructure setup |
157 | 8f0fc472 | Dimitris Aragiorgis | and how connectivity and isolation is achieved in every case for every type of |
158 | 8f0fc472 | Dimitris Aragiorgis | network. |
159 | 8f0fc472 | Dimitris Aragiorgis | |
160 | 8f0fc472 | Dimitris Aragiorgis | |
161 | 8f0fc472 | Dimitris Aragiorgis | FLAVORS |
162 | 8f0fc472 | Dimitris Aragiorgis | ======= |
163 | 8f0fc472 | Dimitris Aragiorgis | |
164 | 8f0fc472 | Dimitris Aragiorgis | As mentioned earlier supported flavors are: |
165 | 8f0fc472 | Dimitris Aragiorgis | |
166 | 8f0fc472 | Dimitris Aragiorgis | - DEFAULT |
167 | 8f0fc472 | Dimitris Aragiorgis | - IP_LESS_ROUTED |
168 | 8f0fc472 | Dimitris Aragiorgis | - MAC_FILTERED |
169 | 8f0fc472 | Dimitris Aragiorgis | - PHYSICAL_VLAN |
170 | 8f0fc472 | Dimitris Aragiorgis | - CUSTOM |
171 | 8f0fc472 | Dimitris Aragiorgis | |
172 | 8f0fc472 | Dimitris Aragiorgis | In the following sections we mention what configuration imposes each flavor from |
173 | 8f0fc472 | Dimitris Aragiorgis | Synnefo, Ganeti and Physical host perspective. |
174 | 8f0fc472 | Dimitris Aragiorgis | |
175 | 8f0fc472 | Dimitris Aragiorgis | DEFAULT |
176 | 8f0fc472 | Dimitris Aragiorgis | ------- |
177 | 8f0fc472 | Dimitris Aragiorgis | |
178 | 8f0fc472 | Dimitris Aragiorgis | |
179 | 8f0fc472 | Dimitris Aragiorgis | |
180 | 8f0fc472 | Dimitris Aragiorgis | |
181 | 8f0fc472 | Dimitris Aragiorgis | To create a network with DEFAULT flavor run you have to pre-provision in each Ganeti |
182 | 8f0fc472 | Dimitris Aragiorgis | node one bridge (e.g. ``br100``) that will be on the same collition domain with the |
183 | 8f0fc472 | Dimitris Aragiorgis | router. To this end if we assume that ``eth0`` is the public interface run: |
184 | 8f0fc472 | Dimitris Aragiorgis | |
185 | 8f0fc472 | Dimitris Aragiorgis | .. image:: images/network-bridged.png |
186 | 8f0fc472 | Dimitris Aragiorgis | :align: right |
187 | 8f0fc472 | Dimitris Aragiorgis | :height: 550px |
188 | 8f0fc472 | Dimitris Aragiorgis | :width: 500px |
189 | 8f0fc472 | Dimitris Aragiorgis | |
190 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
191 | 8f0fc472 | Dimitris Aragiorgis | |
192 | 8f0fc472 | Dimitris Aragiorgis | # brctl addbr br100 |
193 | 8f0fc472 | Dimitris Aragiorgis | # vconfig add eth0 100 |
194 | 8f0fc472 | Dimitris Aragiorgis | # ip link set eth0.100 up |
195 | 8f0fc472 | Dimitris Aragiorgis | # brctl addif br100 eth0.100 |
196 | 8f0fc472 | Dimitris Aragiorgis | # ip link set br100 up |
197 | 8f0fc472 | Dimitris Aragiorgis | |
198 | 8f0fc472 | Dimitris Aragiorgis | # brctl show |
199 | 8f0fc472 | Dimitris Aragiorgis | bridge name bridge id STP enabled interfaces |
200 | 8f0fc472 | Dimitris Aragiorgis | br100 8000.8a3c3ede3583 no eth0.100 |
201 | 8f0fc472 | Dimitris Aragiorgis | |
202 | 8f0fc472 | Dimitris Aragiorgis | |
203 | 8f0fc472 | Dimitris Aragiorgis | |
204 | 8f0fc472 | Dimitris Aragiorgis | Then in Cyclades run: |
205 | 8f0fc472 | Dimitris Aragiorgis | |
206 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
207 | 8f0fc472 | Dimitris Aragiorgis | |
208 | 8f0fc472 | Dimitris Aragiorgis | # snf-manage network-create --subnet=5.6.7.0/27 --gateway=5.6.7.1 --subnet6=2001:648:2FFC:1322::/64 --gateway6=2001:648:2FFC:1322::1 --public --dhcp --flavor=DEFAULT --name=default --backend-id=1 |
209 | 8f0fc472 | Dimitris Aragiorgis | |
210 | 8f0fc472 | Dimitris Aragiorgis | # snf-manage network-list |
211 | 8f0fc472 | Dimitris Aragiorgis | id name flavor owner mac_prefix dhcp state link vms public IPv4 Subnet IPv4 Gateway |
212 | 8f0fc472 | Dimitris Aragiorgis | 1 default DEFAULT True ACTIVE br100 True 5.6.7.0/27 5.6.7.1 |
213 | 8f0fc472 | Dimitris Aragiorgis | |
214 | 8f0fc472 | Dimitris Aragiorgis | This will add a network in Synnefo DB and create a network in Ganeti backend by |
215 | 8f0fc472 | Dimitris Aragiorgis | issuing: |
216 | 8f0fc472 | Dimitris Aragiorgis | |
217 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
218 | 8f0fc472 | Dimitris Aragiorgis | |
219 | 8f0fc472 | Dimitris Aragiorgis | # gnt-network add --network=5.6.7.0/27 --gateway=5.6.7.1 --network6=2001:648:2FFC:1322::/64 --gateway6=2001:648:2FFC:1322::1 --network-type=public --tags=nfdhcpd snf-net-1 |
220 | 8f0fc472 | Dimitris Aragiorgis | |
221 | 8f0fc472 | Dimitris Aragiorgis | # gnt-network connect snf-net-1 default bridged br100 |
222 | 8f0fc472 | Dimitris Aragiorgis | # gnt-network list snf-net-1 |
223 | 8f0fc472 | Dimitris Aragiorgis | Network Subnet Gateway NetworkType MacPrefix GroupList Tags |
224 | 8f0fc472 | Dimitris Aragiorgis | snf-net-1 5.6.7.0/27 5.6.7.1 public None default(bridged, br100) nfdhcpd |
225 | 8f0fc472 | Dimitris Aragiorgis | |
226 | 8f0fc472 | Dimitris Aragiorgis | |
227 | 8f0fc472 | Dimitris Aragiorgis | To enable NAT in a Internal Router if you do not have a public IP range available |
228 | 8f0fc472 | Dimitris Aragiorgis | but only a public routable IP (e.g 5.6.7.1): |
229 | 8f0fc472 | Dimitris Aragiorgis | |
230 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
231 | 8f0fc472 | Dimitris Aragiorgis | |
232 | 8f0fc472 | Dimitris Aragiorgis | # iptables -t nat -A POSTROUTING -o eth0.100 --to-source 5.6.7.1 -j SNAT |
233 | 8f0fc472 | Dimitris Aragiorgis | |
234 | 8f0fc472 | Dimitris Aragiorgis | IP_LESS_ROUTED |
235 | 8f0fc472 | Dimitris Aragiorgis | -------------- |
236 | 8f0fc472 | Dimitris Aragiorgis | |
237 | 8f0fc472 | Dimitris Aragiorgis | .. image:: images/network-routed.png |
238 | 8f0fc472 | Dimitris Aragiorgis | :align: right |
239 | 8f0fc472 | Dimitris Aragiorgis | :height: 580px |
240 | 8f0fc472 | Dimitris Aragiorgis | :width: 500px |
241 | 8f0fc472 | Dimitris Aragiorgis | |
242 | 8f0fc472 | Dimitris Aragiorgis | To create a network with IP_LESS_ROUTED flavor run you have to pre-provision in |
243 | 8f0fc472 | Dimitris Aragiorgis | each Ganeti node one routing table (e.g. ``snf_public``) that will do all the |
244 | 8f0fc472 | Dimitris Aragiorgis | routing from/to the VMs' taps. Additionally you must enable ``Proxy-ARP`` |
245 | 8f0fc472 | Dimitris Aragiorgis | support. All traffic will be on a single VLAN (e.g. ``.201``). To this end if |
246 | 8f0fc472 | Dimitris Aragiorgis | we assume that ``eth0`` is the public interface run: |
247 | 8f0fc472 | Dimitris Aragiorgis | |
248 | 8f0fc472 | Dimitris Aragiorgis | |
249 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
250 | 8f0fc472 | Dimitris Aragiorgis | |
251 | 8f0fc472 | Dimitris Aragiorgis | # vconfig add eth0 201 |
252 | 8f0fc472 | Dimitris Aragiorgis | # ip link set eth0.201 up |
253 | 8f0fc472 | Dimitris Aragiorgis | |
254 | 8f0fc472 | Dimitris Aragiorgis | # echo 1 > /proc/sys/net/ipv4/conf/ip_fowarding |
255 | 8f0fc472 | Dimitris Aragiorgis | # echo 10 snf_public >> /etc/iproute2/rt_tables |
256 | 8f0fc472 | Dimitris Aragiorgis | # ip route add 5.6.7.0/27 dev eth0.201 ?????? |
257 | 8f0fc472 | Dimitris Aragiorgis | # ip route add 5.6.7.0/27 dev eth0.201 table snf_public |
258 | 8f0fc472 | Dimitris Aragiorgis | # ip route add default via 5.6.7.1 dev eth0.201 table snf_public |
259 | 8f0fc472 | Dimitris Aragiorgis | # ip rule add iif eth0.201 lookup snf_public |
260 | 8f0fc472 | Dimitris Aragiorgis | # arptables -A OUTPUT -o eth0.201 --opcode 1 --mangle-ip-s 5.6.7.30 |
261 | 8f0fc472 | Dimitris Aragiorgis | |
262 | 8f0fc472 | Dimitris Aragiorgis | Then in Cyclades run: |
263 | 8f0fc472 | Dimitris Aragiorgis | |
264 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
265 | 8f0fc472 | Dimitris Aragiorgis | |
266 | 8f0fc472 | Dimitris Aragiorgis | # snf-manage network-create --subnet=5.6.7.0/27 --gateway=5.6.7.1 --subnet6=2001:648:2FFC:1322::/64 --gateway6=2001:648:2FFC:1322::1 --public --dhcp --flavor=IP_LESS_ROUTED --name=routed --backend-id=1 |
267 | 8f0fc472 | Dimitris Aragiorgis | |
268 | 8f0fc472 | Dimitris Aragiorgis | # snf-manage network-list |
269 | 8f0fc472 | Dimitris Aragiorgis | id name flavor owner mac_prefix dhcp state link vms public IPv4 Subnet IPv4 Gateway |
270 | 8f0fc472 | Dimitris Aragiorgis | 2 routed IP_LESS_ROUTED True ACTIVE snf_public True 5.6.7.0/27 5.6.7.1 |
271 | 8f0fc472 | Dimitris Aragiorgis | |
272 | 8f0fc472 | Dimitris Aragiorgis | |
273 | 8f0fc472 | Dimitris Aragiorgis | This will add a network in Synnefo DB and create a network in Ganeti backend by |
274 | 8f0fc472 | Dimitris Aragiorgis | issuing: |
275 | 8f0fc472 | Dimitris Aragiorgis | |
276 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
277 | 8f0fc472 | Dimitris Aragiorgis | |
278 | 8f0fc472 | Dimitris Aragiorgis | # gnt-network add --network=5.6.7.0/27 --gateway=5.6.7.1 --network6=2001:648:2FFC:1322::/64 --gateway6=2001:648:2FFC:1322::1 --network-type=public --tags=nfdhcpd,ip-less-routed snf-net-2 |
279 | 8f0fc472 | Dimitris Aragiorgis | |
280 | 8f0fc472 | Dimitris Aragiorgis | # gnt-network connect snf-net-2 default bridged br100 |
281 | 8f0fc472 | Dimitris Aragiorgis | # gnt-network list snf-net-2 |
282 | 8f0fc472 | Dimitris Aragiorgis | Network Subnet Gateway NetworkType MacPrefix GroupList Tags |
283 | 8f0fc472 | Dimitris Aragiorgis | dimara-net-1 62.217.123.128/27 62.217.123.129 public None default(routed, snf_public) nfdhcpd,ip-less-routed |
284 | 8f0fc472 | Dimitris Aragiorgis | |
285 | 8f0fc472 | Dimitris Aragiorgis | |
286 | 8f0fc472 | Dimitris Aragiorgis | |
287 | 8f0fc472 | Dimitris Aragiorgis | |
288 | 8f0fc472 | Dimitris Aragiorgis | MAC_FILTERED |
289 | 8f0fc472 | Dimitris Aragiorgis | ------------ |
290 | 8f0fc472 | Dimitris Aragiorgis | |
291 | 8f0fc472 | Dimitris Aragiorgis | |
292 | 8f0fc472 | Dimitris Aragiorgis | To create a network with MAC_FILTERED flavor you have to pre-provision in each Ganeti |
293 | 8f0fc472 | Dimitris Aragiorgis | node one bridge (e.g. ``prv0``) that will be bridged with one VLAN (e.g. ``.400``) |
294 | 8f0fc472 | Dimitris Aragiorgis | across the whole cluster. To this end if we assume that ``eth0`` is the public interface run: |
295 | 8f0fc472 | Dimitris Aragiorgis | |
296 | 8f0fc472 | Dimitris Aragiorgis | .. image:: images/network-mac.png |
297 | 8f0fc472 | Dimitris Aragiorgis | :align: right |
298 | 8f0fc472 | Dimitris Aragiorgis | :height: 500px |
299 | 8f0fc472 | Dimitris Aragiorgis | :width: 500px |
300 | 8f0fc472 | Dimitris Aragiorgis | |
301 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
302 | 8f0fc472 | Dimitris Aragiorgis | |
303 | 8f0fc472 | Dimitris Aragiorgis | # brctl addbr prv0 |
304 | 8f0fc472 | Dimitris Aragiorgis | # vconfig add eth0 400 |
305 | 8f0fc472 | Dimitris Aragiorgis | # ip link set eth0.400 up |
306 | 8f0fc472 | Dimitris Aragiorgis | # brctl addif prv0 eth0.400 |
307 | 8f0fc472 | Dimitris Aragiorgis | # ip link set prv0 up |
308 | 8f0fc472 | Dimitris Aragiorgis | |
309 | 8f0fc472 | Dimitris Aragiorgis | # brctl show |
310 | 8f0fc472 | Dimitris Aragiorgis | bridge name bridge id STP enabled interfaces |
311 | 8f0fc472 | Dimitris Aragiorgis | prv0 8000.8a3c3ede3583 no eth0.400 |
312 | 8f0fc472 | Dimitris Aragiorgis | |
313 | 8f0fc472 | Dimitris Aragiorgis | |
314 | 8f0fc472 | Dimitris Aragiorgis | |
315 | 8f0fc472 | Dimitris Aragiorgis | Then in Cyclades first create a pool for MAC prefixes by running: |
316 | 8f0fc472 | Dimitris Aragiorgis | |
317 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
318 | 8f0fc472 | Dimitris Aragiorgis | |
319 | 8f0fc472 | Dimitris Aragiorgis | # snf-manage pool-create --type=mac-prefix --base=aa:00:00 --size=65536 |
320 | 8f0fc472 | Dimitris Aragiorgis | |
321 | 8f0fc472 | Dimitris Aragiorgis | and the create the network: |
322 | 8f0fc472 | Dimitris Aragiorgis | |
323 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
324 | 8f0fc472 | Dimitris Aragiorgis | |
325 | 8f0fc472 | Dimitris Aragiorgis | # snf-manage network-create --subnet=192.168.1.0/24 --gateway=192.168.1.0/24 --dhcp --flavor=MAC_FILTERED --name=mac --backend-id=1 |
326 | 8f0fc472 | Dimitris Aragiorgis | # snf-manage network-list |
327 | 8f0fc472 | Dimitris Aragiorgis | id name flavor owner mac_prefix dhcp state link vms public IPv4 Subnet IPv4 Gateway |
328 | 8f0fc472 | Dimitris Aragiorgis | 3 mac MAC_FILTERED aa:00:01 True ACTIVE prv0 False 192.168.1.0/24 192.168.1.1 |
329 | 8f0fc472 | Dimitris Aragiorgis | |
330 | 8f0fc472 | Dimitris Aragiorgis | This will add a network in Synnefo DB and create a network in Ganeti backend by |
331 | 8f0fc472 | Dimitris Aragiorgis | issuing: |
332 | 8f0fc472 | Dimitris Aragiorgis | |
333 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
334 | 8f0fc472 | Dimitris Aragiorgis | |
335 | 8f0fc472 | Dimitris Aragiorgis | # gnt-network add --network=192.168.1.0/24 --gateway=192.168.1.1 --network-type=private --tags=nfdhcpd,private-filtered snf-net-3 |
336 | 8f0fc472 | Dimitris Aragiorgis | |
337 | 8f0fc472 | Dimitris Aragiorgis | # gnt-network connect snf-net-3 default bridged prv0 |
338 | 8f0fc472 | Dimitris Aragiorgis | # gnt-network list snf-net-3 |
339 | 8f0fc472 | Dimitris Aragiorgis | Network Subnet Gateway NetworkType MacPrefix GroupList Tags |
340 | 8f0fc472 | Dimitris Aragiorgis | snf-net-3 192.168.1.0/24 192.168.1.1 private aa:00:01 default(bridged, prv0) nfdhcpd,private-filtered |
341 | 8f0fc472 | Dimitris Aragiorgis | |
342 | 8f0fc472 | Dimitris Aragiorgis | |
343 | 8f0fc472 | Dimitris Aragiorgis | |
344 | 8f0fc472 | Dimitris Aragiorgis | |
345 | 8f0fc472 | Dimitris Aragiorgis | |
346 | 8f0fc472 | Dimitris Aragiorgis | |
347 | 8f0fc472 | Dimitris Aragiorgis | PHYSICAL_VLAN |
348 | 8f0fc472 | Dimitris Aragiorgis | ------------- |
349 | 8f0fc472 | Dimitris Aragiorgis | To create a network with PHYSICAL_VALN flavor you have to pre-provision in each Ganeti |
350 | 8f0fc472 | Dimitris Aragiorgis | node a range of bridges (e.g. ``prv1..20``) that will be bridged with the corresponding VLANs (e.g. ``401..420``) |
351 | 8f0fc472 | Dimitris Aragiorgis | across the whole cluster. To this end if we assume that ``eth0`` is the public interface run: |
352 | 8f0fc472 | Dimitris Aragiorgis | |
353 | 8f0fc472 | Dimitris Aragiorgis | .. image:: images/network-vlan.png |
354 | 8f0fc472 | Dimitris Aragiorgis | :align: right |
355 | 8f0fc472 | Dimitris Aragiorgis | :height: 480px |
356 | 8f0fc472 | Dimitris Aragiorgis | :width: 500px |
357 | 8f0fc472 | Dimitris Aragiorgis | |
358 | 8f0fc472 | Dimitris Aragiorgis | |
359 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
360 | 8f0fc472 | Dimitris Aragiorgis | |
361 | 8f0fc472 | Dimitris Aragiorgis | # for i in {1..20}; do |
362 | 8f0fc472 | Dimitris Aragiorgis | br=prv$i ; vlanid=$((400+i)) ; vlan=eth0.$vlanid |
363 | 8f0fc472 | Dimitris Aragiorgis | brctl addbr $br ; ip link set $br up |
364 | 8f0fc472 | Dimitris Aragiorgis | vconfig add eth0 vlanid ; ip link set vlan up |
365 | 8f0fc472 | Dimitris Aragiorgis | brctl addif $br $vlan |
366 | 8f0fc472 | Dimitris Aragiorgis | done |
367 | 8f0fc472 | Dimitris Aragiorgis | # brctl show |
368 | 8f0fc472 | Dimitris Aragiorgis | bridge name bridge id STP enabled interfaces |
369 | 8f0fc472 | Dimitris Aragiorgis | prv1 8000.8a3c3ede3583 no eth0.401 |
370 | 8f0fc472 | Dimitris Aragiorgis | prv2 8000.8a3c3ede3583 no eth0.402 |
371 | 8f0fc472 | Dimitris Aragiorgis | ... |
372 | 8f0fc472 | Dimitris Aragiorgis | |
373 | 8f0fc472 | Dimitris Aragiorgis | |
374 | 8f0fc472 | Dimitris Aragiorgis | Then in Cyclades first create a pool for bridges by running: |
375 | 8f0fc472 | Dimitris Aragiorgis | |
376 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
377 | 8f0fc472 | Dimitris Aragiorgis | |
378 | 8f0fc472 | Dimitris Aragiorgis | # snf-manage pool-create --type=bridge --base=prv --size=20 |
379 | 8f0fc472 | Dimitris Aragiorgis | |
380 | 8f0fc472 | Dimitris Aragiorgis | and the create the network: |
381 | 8f0fc472 | Dimitris Aragiorgis | |
382 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
383 | 8f0fc472 | Dimitris Aragiorgis | |
384 | 8f0fc472 | Dimitris Aragiorgis | # snf-manage network-create --subnet=192.168.1.0/24 --gateway=192.168.1.0/24 --dhcp --flavor=PHYSICAL_VLAN --name=vlan --backend-id=1 |
385 | 8f0fc472 | Dimitris Aragiorgis | |
386 | 8f0fc472 | Dimitris Aragiorgis | # snf-manage network-list |
387 | 8f0fc472 | Dimitris Aragiorgis | id name flavor owner mac_prefix dhcp state link vms public IPv4 Subnet IPv4 Gateway |
388 | 8f0fc472 | Dimitris Aragiorgis | 4 vlan PHYSICAL_VLAN True ACTIVE prv1 False 192.168.1.0/24 192.168.1.1 |
389 | 8f0fc472 | Dimitris Aragiorgis | |
390 | 8f0fc472 | Dimitris Aragiorgis | This will add a network in Synnefo DB and create a network in Ganeti backend by |
391 | 8f0fc472 | Dimitris Aragiorgis | issuing: |
392 | 8f0fc472 | Dimitris Aragiorgis | |
393 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
394 | 8f0fc472 | Dimitris Aragiorgis | |
395 | 8f0fc472 | Dimitris Aragiorgis | # gnt-network add --network=192.168.1.0/24 --gateway=192.168.1.1 --network-type=private --tags=nfdhcpd,physica-vlan snf-net-4 |
396 | 8f0fc472 | Dimitris Aragiorgis | |
397 | 8f0fc472 | Dimitris Aragiorgis | # gnt-network connect snf-net-4 default bridged prv1 |
398 | 8f0fc472 | Dimitris Aragiorgis | # gnt-network list snf-net-4 |
399 | 8f0fc472 | Dimitris Aragiorgis | Network Subnet Gateway NetworkType MacPrefix GroupList Tags |
400 | 8f0fc472 | Dimitris Aragiorgis | snf-net-4 192.168.1.0/24 192.168.1.1 private None default(bridged, prv1) nfdhcpd,physical-vlan |
401 | 8f0fc472 | Dimitris Aragiorgis | |
402 | 8f0fc472 | Dimitris Aragiorgis | |
403 | 8f0fc472 | Dimitris Aragiorgis | |
404 | 8f0fc472 | Dimitris Aragiorgis | CUSTOM |
405 | 8f0fc472 | Dimitris Aragiorgis | ------ |
406 | 8f0fc472 | Dimitris Aragiorgis | |
407 | 8f0fc472 | Dimitris Aragiorgis | To create a network with CUSTOM flavor you have to pass your self mode, link, |
408 | 8f0fc472 | Dimitris Aragiorgis | mac prefix, tags for the network. You are not allowed to use the existing pools |
409 | 8f0fc472 | Dimitris Aragiorgis | (only MAC_FILTERED, PHYSICAL_VLAN use them) so link and mac prefix uniqueness |
410 | 8f0fc472 | Dimitris Aragiorgis | cannot be guaranteed. |
411 | 8f0fc472 | Dimitris Aragiorgis | |
412 | 8f0fc472 | Dimitris Aragiorgis | Lets assume a bridge ``br200`` that serves a VPN network to GRNET exist already |
413 | 8f0fc472 | Dimitris Aragiorgis | in Ganeti nodes and we want to create for a certain user a private network so |
414 | 8f0fc472 | Dimitris Aragiorgis | that he can access the VPN. Then we run in Cyclades: |
415 | 8f0fc472 | Dimitris Aragiorgis | |
416 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
417 | 8f0fc472 | Dimitris Aragiorgis | |
418 | 8f0fc472 | Dimitris Aragiorgis | # snf-manage network-create --subnet=192.168.1.0/24 --gateway=192.168.1.0/24 --dhcp --mode=bridge --link=br200 --mac-prefix=bb:00:44 --owner=user@grnet.gr --tags=nfdhcpd,vpn --name=vpn --backend-id=1 |
419 | 8f0fc472 | Dimitris Aragiorgis | |
420 | 8f0fc472 | Dimitris Aragiorgis | # snf-manage network-list |
421 | 8f0fc472 | Dimitris Aragiorgis | id name flavor owner mac_prefix dhcp state link vms public IPv4 Subnet IPv4 Gateway |
422 | 8f0fc472 | Dimitris Aragiorgis | 5 vpn CUSTOM user@grnet.gr bb:00:44 True ACTIVE br200 False 192.168.1.0/24 192.168.1.1 |
423 | 8f0fc472 | Dimitris Aragiorgis | |
424 | 8f0fc472 | Dimitris Aragiorgis | This will add a network in Synnefo DB and create a network in Ganeti backend by |
425 | 8f0fc472 | Dimitris Aragiorgis | issuing: |
426 | 8f0fc472 | Dimitris Aragiorgis | |
427 | 8f0fc472 | Dimitris Aragiorgis | .. code-block:: console |
428 | 8f0fc472 | Dimitris Aragiorgis | |
429 | 8f0fc472 | Dimitris Aragiorgis | # gnt-network add --network=192.168.1.0/24 --gateway=192.168.1.1 --network-type=private --tags=nfdhcpd snf-net-5 |
430 | 8f0fc472 | Dimitris Aragiorgis | |
431 | 8f0fc472 | Dimitris Aragiorgis | # gnt-network connect snf-net-5 default bridged br200 |
432 | 8f0fc472 | Dimitris Aragiorgis | # gnt-network list snf-net-5 |
433 | 8f0fc472 | Dimitris Aragiorgis | Network Subnet Gateway NetworkType MacPrefix GroupList Tags |
434 | 8f0fc472 | Dimitris Aragiorgis | snf-net-5 192.168.1.0/24 192.168.1.1 private bb:00:55 default(bridged, br200) nfdhcpd,private-filtered |
435 | 8f0fc472 | Dimitris Aragiorgis |