Free and Open Source Software Knowledge Base

A common problem for people who want to try Openstack without a full blown hardware setup is that they have just one network interface. Openstack identifies three distinct networks

Internal Network

This is where all your inter process communication happens. This is where your mysql-server/queue-server etc are listening and this is where your services exchange information among themselves. On a proper set up this network should be isolated and secured and the interface connected to this network should not be added to any bridge.

Data Network

This is where your Instances talk to each other and to their network’s l3 and dhcp services. This network again should be isolated and secured. There can be more than one data network. The data networks are mapped to a physical networks which will be available for neutron to use using config file parameters. It is the physical network that you denote as ‘provider:physical_network’ in the ‘neutron net-create‘ API call. You need not worry about choosing the physical_network for each network you create as neutron will choose it for you if you did not.

bridge_mappings

Present inside the ‘ovs’ section of ‘ml2_conf.ini’. You tell Neutron which physical networks are available for use through this parameter. You also have to tell which bridge to use in order to reach that physical network.? Thus ‘bridge_mappings’ is a comma separated list of ‘physical_network:bridge_name’ pairs. You also have to make sure the bridges that you mapped to physical networks exists on the host.

flat_networks

Present under ‘ml2_type_flat’ section. Configured in case of flat networks. This is just a comma separated list of physical networks that are flat(no vlan involved)

network_vlan_ranges

Present under ‘ml2_type_vlan’ section. Configured in case of vlan networks. This is similar to flat_networks except that for each physical networks there is a start and an end vlan appended with a ‘:’ between them.

local_ip

Present under ‘ovs’ section’. In case you are using GRE mode this parameter will tell neutron which IP to bind and run GRE on. This in turn determines which interface and network should be used as data network. So it is a good idea to use an interface other than the one used for internal network.

Finally, unless you are using ‘GRE’ alone, you have to add one of the host’s network interface to every bridge specified so that all physical networks are now bridged to their corresponding data network. Using a little trick you can even map more than one physical network to a data network.

External Network

This network is used for two purposes.

To expose the services(nova-api, glance-api .,etc) to consumers outside of Openstack.

To allow your Instances to be accessible from outside of Openstack, through floating-ip.

It is a good idea to use two external networks for the above two purposes. That way you can restrict all ports other than those on which your exposed services are listening.

In Neutron and external network is one on which you have ‘router:external’ set to true. Only then can you create foating-ips on it. In all other ways all rules that apply to physical networks also apply here. Normally you would want to chose a flat physical network for creating external network. Otherwise you would have to ask your network administrator to set up vlan on the switch port connecting to the machine running your l3-agent and things start to get ugly.

The host interface connecting to the external network should not have any form of security. You should allow security groups to do that job.

Full blown OpenStack setup

Using the same Interface for all Networks

Finally we arrive at the purpose of this blog. This blog gives you plenty of information and reason why you should not do this but while you are experimenting all is fair.

Assumptions:

eth0 is the only available port

bridge_mappings=Physnet1:br-eth1,External_network:br-ex

network_vlan_ranges=Physnet1:100:200

flat_networks=External_network

ovs-vsctl add-br br-eth0

ovs-vsctl add-port br-eth0 eth0

ifconfig br-eth0 up

ip link set br-eth0 promisc on

ip link add proxy-br-eth1 type veth peer name eth1-br-proxy

ip link add proxy-br-ex type veth peer name ex-br-proxy

ovs-vsctl add-br br-eth1

ovs-vsctl add-br br-ex

ovs-vsctl add-port br-eth1 eth1-br-proxy

ovs-vsctl add-port br-ex ex-br-proxy

ovs-vsctl add-port br-eth0 proxy-br-eth1

ovs-vsctl add-port br-eth0 proxy-br-ex

ip link set eth1-br-proxy up promisc on

ip link set ex-br-proxy up promisc on

ip link set proxy-br-eth1 up promisc on

ip link set proxy-br-ex up promisc on

What we have done is added a new bridge br-eth0 and added eth0 to it.

Assign eth0’s ip address to br-eth0 and set the interface in promiscuous mode.

Then we create two veth pairs. In case you are not aware they are like virtual cables.

We connect br-eth1 and br-ex to br-eth0 using the veth pairs.

Then we enable promiscuous mode and bring up all the interfaces we use.

Single machine setup with 1 interface

Running Controller and Network on same host

Sometimes It is desired to have controller and Network node running on same machine and the machines have only two network interfaces each. The compute node requires only two interfaces as shown in the picture below. However in the network node we can combine the internal and external network by adding eth0 to br-ex and assigning br-ex with the ip address of eth0.

ovs-vsctl add-port br-ex eth0

ifconfig br-ex? up

ip link set eth0 up promisc on

2 Machine with 2 interfaces each

If both your servers have only a single nic you may follow the below setup.

On network/controller node

#add all bridges

ovs-vsctl add-br br-int

ovs-vsctl add-br br-ex

ovs-vsctl add-br br-eth1

ovs-vsctl add-br br-proxy

#Create Veth pairs

ip link add proxy-br-eth1 type veth peer name eth1-br-proxy

ip link add proxy-br-ex type veth peer name ex-br-proxy

#Attach bridges using veth pair

ovs-vsctl add-port br-eth1 eth1-br-proxy

ovs-vsctl add-port br-ex ex-br-proxy

ovs-vsctl add-port br-proxy proxy-br-eth1

ovs-vsctl add-port br-proxy proxy-br-ex

#Assign eth0's ip address to br-proxy

ifconfig br-proxy? up

#Bring up the interfaces

ip link set eth1-br-proxy up promisc on

ip link set ex-br-proxy up promisc on

ip link set proxy-br-eth1 up promisc on

ip link set proxy-br-ex up promisc on

On the Compute node

ovs-vsctl add-br br-eth1

ovs-vsctl add-port br-eth1 eth0

#Assign eth0's ip addres to br-eth1

ifconfig br-eth1? up

#Bring up the interfaces

ip link set eth0 up promisc on

The pictorial representation would be something like below

Dual machine setup with single nic each

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌日月,老刑警劉巖,帶你破解...
    沈念sama閱讀 211,561評(píng)論 6 492
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件燃箭,死亡現(xiàn)場離奇詭異昏苏,居然都是意外死亡肴盏,警方通過查閱死者的電腦和手機(jī)芋浮,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,218評(píng)論 3 385
  • 文/潘曉璐 我一進(jìn)店門抱环,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人纸巷,你說我怎么就攤上這事镇草。” “怎么了瘤旨?”我有些...
    開封第一講書人閱讀 157,162評(píng)論 0 348
  • 文/不壞的土叔 我叫張陵梯啤,是天一觀的道長。 經(jīng)常有香客問我存哲,道長因宇,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 56,470評(píng)論 1 283
  • 正文 為了忘掉前任宏胯,我火速辦了婚禮羽嫡,結(jié)果婚禮上本姥,老公的妹妹穿的比我還像新娘肩袍。我一直安慰自己,他們只是感情好婚惫,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,550評(píng)論 6 385
  • 文/花漫 我一把揭開白布氛赐。 她就那樣靜靜地躺著,像睡著了一般先舷。 火紅的嫁衣襯著肌膚如雪艰管。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 49,806評(píng)論 1 290
  • 那天蒋川,我揣著相機(jī)與錄音牲芋,去河邊找鬼。 笑死,一個(gè)胖子當(dāng)著我的面吹牛缸浦,可吹牛的內(nèi)容都是我干的夕冲。 我是一名探鬼主播,決...
    沈念sama閱讀 38,951評(píng)論 3 407
  • 文/蒼蘭香墨 我猛地睜開眼裂逐,長吁一口氣:“原來是場噩夢(mèng)啊……” “哼歹鱼!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起卜高,我...
    開封第一講書人閱讀 37,712評(píng)論 0 266
  • 序言:老撾萬榮一對(duì)情侶失蹤弥姻,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后掺涛,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體庭敦,經(jīng)...
    沈念sama閱讀 44,166評(píng)論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,510評(píng)論 2 327
  • 正文 我和宋清朗相戀三年薪缆,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了螺捐。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 38,643評(píng)論 1 340
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡矮燎,死狀恐怖定血,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情诞外,我是刑警寧澤澜沟,帶...
    沈念sama閱讀 34,306評(píng)論 4 330
  • 正文 年R本政府宣布,位于F島的核電站峡谊,受9級(jí)特大地震影響茫虽,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜既们,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,930評(píng)論 3 313
  • 文/蒙蒙 一濒析、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧啥纸,春花似錦号杏、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,745評(píng)論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至荣暮,卻和暖如春庭惜,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背穗酥。 一陣腳步聲響...
    開封第一講書人閱讀 31,983評(píng)論 1 266
  • 我被黑心中介騙來泰國打工护赊, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留惠遏,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 46,351評(píng)論 2 360
  • 正文 我出身青樓骏啰,卻偏偏與公主長得像爽哎,于是被迫代替她去往敵國和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子器一,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,509評(píng)論 2 348

推薦閱讀更多精彩內(nèi)容

  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc閱讀 2,822評(píng)論 0 0
  • 裝載自http://sdnhub.cn/index.php/openv-switch-full-guide/ 1 ...
    ximitc閱讀 5,775評(píng)論 0 11
  • 投射兒子身心健康课锌,明白自己想要的,能多花點(diǎn)時(shí)間去學(xué)習(xí)祈秕,把學(xué)習(xí)狀態(tài)調(diào)到最佳去迎接他人生中的第一個(gè)轉(zhuǎn)折點(diǎn)渺贤。投射老公生意...
    伶麗閱讀 151評(píng)論 2 1
  • 在日益喧囂的社會(huì)里,有很大一個(gè)群體的生活變得浮光掠影请毛,他們每天的生活單調(diào)重復(fù)志鞍,除了機(jī)械上班,就是呼朋喚友方仿,飲酒喝茶...
    竹海星空閱讀 316評(píng)論 1 1
  • 【學(xué)號(hào):FH0386—曲妍妍】 大叔說人生就是一場選擇仙蚜,一次次的選擇讓你找到你的定位此洲,勇敢地選擇回報(bào) 可能...
    小妍妍快跑啊閱讀 263評(píng)論 0 2