分享

openstack【juno】入门高级篇:为何你的实例ping不通外网【概述】

pig2 发表于 2015-6-2 16:02:04 [显示全部楼层] 只看大图 回帖奖励 阅读模式 关闭右栏 8 59834
本帖最后由 pig2 于 2015-6-3 16:34 编辑
问题导读


1.neutron使用了哪些技术?
2.为什么ping不同外网?
3.ping不通的域名原因是什么?






本来想发布一篇关于kilo的安装部署文档,因为官网提供的文档还不成熟,经常有变动,因此搭建的环境存在一些问题。能够实例化网络,dashboard添加成功,其它还有问题,比如启动实例。里面的内容会经常更新,详细参考openstack kilo安装部署篇章汇总及总结

此篇其实是网络篇,网络其实是很复杂的,其中需要学习的内容:
  • 防火墙
  • 路由器
  • OVS
  • OpenFlow


因为没有这些知识,网络还是比较难搞定的。特别是sdn,即使我们偶然搞定了,遇到问题,也是难以解决的。
这里也只是给大家分享些资料,带领入门。

防火墙:

这里的防火墙

集群网络必备:防火墙基础知识补充

Neutron防火墙

Openstack 中的防火墙规则分析【分享】

openstack基础之防火墙:Linux防火墙iptables入门教程

openstack安全组(防火墙)入门1——安全组之架构篇

Openstack 中的防火墙规则分析【分享】

OpenStack中的防火墙简介

Linux防火墙Iptable设置只允许某ip访问某端口

路由器

路由器是什么?
我们执行下面命令看到如下:
[mw_shl_code=bash,true]ip netns exec qrouter-cc1a264d-1442-4507-a54b-e61cd7e26f42 ip add[/mw_shl_code]

route.png



OVS

[mw_shl_code=bash,true] ovs-vsctl show[/mw_shl_code]

[mw_shl_code=bash,true]689c0ac3-e282-4638-822c-9444333396e5
    Bridge br-tun
        Port br-tun
            Interface br-tun
                type: internal
        Port "gre-0a00011f"
            Interface "gre-0a00011f"
                type: gre
                options: {df_default="true", in_key=flow, local_ip="10.0.1.21", out_key=flow, remote_ip="10.0.1.31"}
        Port patch-int
            Interface patch-int
                type: patch
                options: {peer=patch-tun}
    Bridge br-int
        fail_mode: secure
        Port br-int
            Interface br-int
                type: internal
        Port patch-tun
            Interface patch-tun
                type: patch
                options: {peer=patch-int}
        Port "tap19c5765e-d9"
            tag: 1
            Interface "tap19c5765e-d9"
                type: internal
        Port int-br-ex
            Interface int-br-ex
                type: patch
                options: {peer=phy-br-ex}
        Port "qr-bd91f930-92"
            tag: 1
            Interface "qr-bd91f930-92"
                type: internal
    Bridge br-ex
        Port br-ex
            Interface br-ex
                type: internal
        Port "eth2"
            Interface "eth2"
        Port "qg-a5a35520-41"
            Interface "qg-a5a35520-41"
                type: internal
        Port phy-br-ex
            Interface phy-br-ex
                type: patch
                options: {peer=int-br-ex}
    ovs_version: "2.0.2"[/mw_shl_code]

OpenFlow

OpenvSwitch安装及配置包括【openFlow】

基于OpenFlow架构的IaaS云安全

基于 Open vSwitch 的 OpenFlow 实践【教程】

基于 Open vSwitch 的 OpenFlow 实践(ubuntu 14.04)

SDN的选择:OpenFlow、虚拟机、OpenStack和VXLAN/NVGRE

基于 Open vSwitch 的 OpenFlow 实践

OpenFlow网络中的路由服务



##############################################

上面是基础知识,neutron使用了ovs和openflow.

我们为什么创建实例ping不通外网。这里跟环境有关系。因此这里贴出整体环境。

控制节点:

计算节点.png



网络节点

网络节点.png


计算节点

计算节点.png



网络节点
auto eth1
iface eth1 inet static
address 10.0.0.21
netmask 255.255.255.0
gateway 10.0.0.1
dns-nameservers 8.8.8.8

auto eth0
iface eth0 inet static
address 10.0.1.21
netmask 255.255.255.0

# The external network interface
auto eth2
iface eth2 inet manual
        up ip link set dev $IFACE up
        down ip link set dev $IFACE down

这里注意eth2跟eth0是同一个网段

控制节点:

auto lo
iface lo inet loopback


# The primary network interface
auto eth0
iface eth0 inet static
address 10.0.0.11
netmask 255.255.255.0
gateway 10.0.0.1
dns-nameservers 8.8.8.8



计算节点

auto eth1
iface eth1 inet static
address 10.0.0.31
netmask 255.255.255.0
gateway 10.0.0.2
dns-nameservers 8.8.8.8

auto eth0
iface eth0 inet static
address 10.0.1.31
netmask 255.255.255.0


环境介绍完毕,我们开始创建实例

[mw_shl_code=bash,true]nova boot --flavor m1.tiny --image cirros-0.3.3-x86_64 --nic net-id=c5820bc3-9612-407b-8f67-eaf167192c7f \
--security-group default --key-name demo-key demo-instance1[/mw_shl_code]

nova.png


[mw_shl_code=bash,true]nova list[/mw_shl_code]

novalist.png


进入控制台

1.png



我们ping下about云(www.aboutyun.com

ping.png


我们看到
[mw_shl_code=bash,true]ping : bad address 'www.aboutyun.com'[/mw_shl_code]

这里是因为我们没有修改resolv.conf


修改完毕,我们在

[mw_shl_code=bash,true]ping 'www.aboutyun.com'[/mw_shl_code]

pingaboutyun.png





######################################
neutron相关资料:


OpenStack Neutron 原理详解

Neutron 网络架构讲解_VLAN 网络

浅谈SDN,NFV与NV-薛保平

系统讲解 Openvswtich (138页)ppt分享

openstack的neutron介绍

neutron-VLAN模式测试报告

系统讲解Libvirt Qemu KVM ppt(250页)

openstack (2015)neutron最新英文资料【推荐】

Neutron配置文件简析及Neutron代码结构文档下载

nova network三种网络模式介绍


已有(8)人评论

跳转到指定楼层
doscho 发表于 2015-6-13 08:34:39
resolv.conf 这个是在哪里的文件?
回复

使用道具 举报

Alkaloid0515 发表于 2015-6-14 12:30:57
doscho 发表于 2015-6-13 08:34
resolv.conf 这个是在哪里的文件?

[mw_shl_code=bash,true]/etc/resolv.conf[/mw_shl_code]
回复

使用道具 举报

tfp_about 发表于 2015-6-15 16:43:13
请问,为什么第三块网卡要与eth0同一网段,楼主这里eth0按照openstack neutron方式搭建,是做什么用?隧道?管理?
# The external network interface
auto eth2
iface eth2 inet manual
        up ip link set dev $IFACE up
        down ip link set dev $IFACE down

这里注意eth2跟eth0是同一个网段



回复

使用道具 举报

jixianqiuxue 发表于 2015-6-15 16:43:16
tfp_about 发表于 2015-6-15 16:43
请问,为什么第三块网卡要与eth0同一网段,楼主这里eth0按照openstack neutron方式搭建,是做什么用?隧道 ...

你可以试试非同一网段,只要eth2能上网即可
回复

使用道具 举报

tfp_about 发表于 2015-6-15 16:52:14
jixianqiuxue 发表于 2015-6-15 16:43
你可以试试非同一网段,只要eth2能上网即可

我现在就是遇到无法连通eth2网卡的网段,请帮忙看下
http://www.aboutyun.com/forum.ph ... a=page%3D1#pid98475

回复

使用道具 举报

ZZH 发表于 2016-4-28 18:26:03
你好,我的实例能ping通域名8.8.8.8,但一直ping不通外网,类似于www.aboutyun.com,求解答,已经卡住很久了
回复

使用道具 举报

when30 发表于 2016-4-28 20:39:46
ZZH 发表于 2016-4-28 18:26
你好,我的实例能ping通域名8.8.8.8,但一直ping不通外网,类似于www.aboutyun.com,求解答,已经卡住很久 ...

没做解析吧,配置这个文件
/etc/resolv.conf
添加
[mw_shl_code=bash,true]nameserver  8.8.8.8[/mw_shl_code]

修改完毕,我们在

[mw_shl_code=bash,true]ping 'www.aboutyun.com'[/mw_shl_code]











回复

使用道具 举报

Carry 发表于 2017-5-9 14:58:19
您好,我在创建实例的时候遇到了下面的问题,请问该怎么解决?# neutron subnet-create --name provider allocation-pool start=10.10.10.101,end=10.10.10.200 dns-nameserver 8.8.8.8 --gateway 10.10.10.254 provider 10.10.10.0/24
Invalid values_specs dns-nameserver 8.8.8.8 provider 10.10.10.0/24

我在VM虚拟机里部署的环境,我的控制节点和计算节点都是两块网卡,eth0是管理网络,eth1通过桥接的方式连接外网,自动获取IP
DNS配置过了,也能ping通,10.10.10.0/24是实验室的内网


2017-05-09 14^I^Q屏幕截图_看图王.png
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条