多个router和多个network

一般搭建成功了opentack后,都会按照文档的这样创建网络

Scenario 1: one tenant, two networks, one router

Scenario 2: two tenants, two networks, two routers

然而neutron号称软件定义网络,可否创建更复杂的拓扑图

我创建了上面的三个网络,每个网络都运行一个主机,网络1和网络2,并不直接相连,但是通过网络2相连。

对于主机net1,由于网络只有一个路由器,所以gateway只能是它

[email protected]:/home/ubuntu# ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

inet 127.0.0.1/8 scope host lo

inet6 ::1/128 scope host

valid_lft forever preferred_lft forever

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000

link/ether fa:16:3e:f2:68:34 brd ff:ff:ff:ff:ff:ff

inet 10.0.0.2/24 brd 10.0.0.255 scope global eth0

inet6 fe80::f816:3eff:fef2:6834/64 scope link

valid_lft forever preferred_lft forever

[email protected]:/home/ubuntu# route -n

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

0.0.0.0 10.0.0.1 0.0.0.0 UG 100 0 0 eth0

10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

对于主机net3,所在的网络业只有一个路由器,所以gateway也只能是它

[email protected]:/home/ubuntu# ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

inet 127.0.0.1/8 scope host lo

inet6 ::1/128 scope host

valid_lft forever preferred_lft forever

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000

link/ether fa:16:3e:73:2b:1f brd ff:ff:ff:ff:ff:ff

inet 10.0.2.2/24 brd 10.0.2.255 scope global eth0

inet6 fe80::f816:3eff:fe73:2b1f/64 scope link

valid_lft forever preferred_lft forever

[email protected]:/home/ubuntu# route -n

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

0.0.0.0 10.0.2.1 0.0.0.0 UG 100 0 0 eth0

10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

比较纠结的是主机net2,它的网络上有两个路由器,默认gateway只能是一个,那它如何才能ping通两面的主机呢,必须手动添加路由器。

[email protected]:/home/ubuntu# ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN

link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

inet 127.0.0.1/8 scope host lo

inet6 ::1/128 scope host

valid_lft forever preferred_lft forever

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000

link/ether fa:16:3e:3c:65:ad brd ff:ff:ff:ff:ff:ff

inet 10.0.1.4/24 brd 10.0.1.255 scope global eth0

inet6 fe80::f816:3eff:fe3c:65ad/64 scope link

valid_lft forever preferred_lft forever

[email protected]:/home/ubuntu# route -n

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

0.0.0.0 10.0.1.1 0.0.0.0 UG 100 0 0 eth0

10.0.0.0 10.0.1.1 255.255.255.0 UG 0 0 0 eth0

10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

10.0.2.0 10.0.1.2 255.255.255.0 UG 0 0 0 eth0

到不同的网络,gateway不一样。

最后的问题是,net1和net3之间怎么通信,如果neutron创建的路由器支持动态路由就好了,一般通过routed或者gated,相邻的路由器router1和router2可以相互同步路由表,这样router1才可能知道,在router2的另一端,还有一个网络,反之亦然。

https://blueprints.launchpad.net/neutron/+spec/bgp-dynamic-routing

然而这个好像还没实现,所以要想net1和net3之间通信,需要手动添加路由表到路由器

我们修改router1的路由表

[email protected]:~# ip netns exec qrouter-8fd947fc-2b5b-40a3-b16e-72aabb001f2d route -n

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 qr-bbbc67c3-81

10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 qr-10b0d153-4c

10.0.2.0 10.0.1.2 255.255.255.0 UG 0 0 0 qr-10b0d153-4c

再来修改router2的路由表

[email protected]:~# ip netns exec qrouter-d2c831c9-44ff-43dd-8c9d-2dc42370c2fd route -n

Kernel IP routing table

Destination Gateway Genmask Flags Metric Ref Use Iface

10.0.0.0 10.0.1.1 255.255.255.0 UG 0 0 0 qr-ad73f294-6d

10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 qr-ad73f294-6d

10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 qr-866838bd-d7

这样相互就ping通了

通过API创建路由表

https://blueprints.launchpad.net/neutron/+spec/quantum-l3-routes

多个router和多个network

时间: 2024-10-06 11:09:17

多个router和多个network的相关文章

Computer Network学习笔记_1

1_1 开始学习David Weatherall讲的Computer Networks,第一节课主要讲Goals and Motivation,Focus of the course是Networking,讨论packets and internet,会讲底层的Communications和上层的Distributed systems,就是Network如何建立,上层apps能做什么.The main point是学习Internet如何运行,TCP/IP,DNS,HTTP,NAT,VPNs,8

深入理解openstack网络架构(4)-----连接到public network

原文地址: https://blogs.oracle.com/ronen/entry/diving_into_openstack_network_architecture3 在上一篇文章中,我们介绍了openstack中的路由,了解到openstack如何通过namespace实现的router将两个network连通.本文中,我们进一步分析路由功能,说明实现内部internal network和public network的路由(而不仅仅是internal network之间).我们还会分析n

Identifying a distributed denial of service (DDOS) attack within a network and defending against such an attack

The invention provides methods, apparatus and systems for detecting distributed denial of service (DDoS) attacks within the Internet by sampling packets at a point or points in Internet backbone connections to determine a packet metric parameter. The

openstack M版安装 network(neutron)服务篇

安装配置network(neutron) 服务 Mitaka版本网络有两个选择,Provider network 和Self-service network,这里我们选择第二种. controller 节点 一.创建数据库 [[email protected] ~]# mysql -u root -p >>CREATE DATABASE neutron; >>GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@'localhost'   I

Neutron 理解 (6): Neutron 是怎么实现虚拟三层网络的 [How Neutron implements virtual L3 network]

学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GRE/VxLAN 虚拟网络 (4)Neutron OVS OpenFlow 流表 和 L2 Population (5)Neutron DHCP Agent (6)Neutron L3 Agent (7)Neutron LBaas Neutron 对虚拟三层网络的实现是通过其 L3 Agent (ne

Vitual Router in The Cloud

VyOS and ESXi,VyOS Configuration The next step is to configure both VyOS routers. Before we do, we should ensure that we have a good high-level understanding of what should be happening. The ultimate goal of this three-router setup is to have our own

RIP(Router Information Protocol)路由信息协议

1. RIP V1和RIP V2的区别 a. V1是有类路由协议,V2是无类路由协议 b. V1不支持VLSM,V2支持VLSM c. V1没有认证功能,V2可以支持认证,并且有明文和MD5两种认证 d. V1是广播更新(255.255.255.255),V2是组播更新(224.0.0.9) e. V1对路由没有标记功能,V2可以对路由打标记(tag),用于过滤和做策略 f. V1发送的update最多可以携带25条路由条目,V2在没有认证的情况下最多只能24条路由 g. V1发送的update

OSPF 基本配置

实验 OSPF 基本配置[实验名称]OSPF 单区域基本配置.[实验目的]掌握在路由器上配置 OSPF 单区域.[背景描述]假设校园网通过 1 台三层交换机连到校园网出口路由器,路由器再和校园外的另 1 台路由器连接,现做适当配置,实现校园网内部主机与校园网外部主机的相互通信.本实验以两台路由器.1 台三层交换机为例.S3550 上划分有 VLAN10 和 VLAN50,其中 VLAN10 用于连接 RA,VLAN50 用于连接校园网主机.[需求分析]需要在路由器和交换机上配置 OSPF 路 由

[Lab4-1]抓路由练习题

[Lab4-1]抓路由练习题 问题1: 用ACL抓取172.18.0.0/16----172.29.0.0/16的路由 答案: 172.16.0.0 0.15.255.255,看上去很完美,但实际上框的范围有些大. R1(f0/0)-(f0/0)R2 R1上的接口地址: R1#sh ip int b Interface IP-Address OK? Method Status Protocol FastEthernet0/0 12.1.1.1 YES NVRAM up up Loopback0