Multiple router and multiple network

Source: Internet
Author: User

Generally built successfully after the Opentack, the network is created according to the document

Scenario 1:one Tenant, networks, one router

Scenario 2:two tenants, networks, and routers

However, Neutron is a software-defined network, can create more complex topology diagram

I created the above three networks, each running a host, network 1 and Network 2, not directly connected, but connected via network 2.

For host Net1, because the network has only one router, the gateway can only be its

[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 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 0 0 eth0

10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

For host Net3, there is only one router in the network industry, so gateway can only be its

[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 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 0 0 eth0

10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

The more tangled is the host Net2, it has two routers on the network, the default gateway can only be one, then how it can ping the two sides of the host, you must manually add the router.

[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 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 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

To different networks, Gateway is not the same.

The final question is how to communicate between Net1 and Net3, if the router created by neutron supports dynamic routing, generally through routed or gated, neighboring routers Router1 and ROUTER2 can synchronize the routing table with each other. So router1 may know that at the other end of the ROUTER2, there is a network, and vice versa.

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

However, this seems to have not been achieved, so in order to communicate between Net1 and Net3, you need to manually add the routing table to the router

We modify the ROUTER1 routing table

[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

And then modify the ROUTER2 routing table.

[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

So we can ping each other.

Creating a routing table from the API

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.