Open vSwith analog gateway for interconnection between different subnets (1)

Source: Internet
Author: User

Open vSwith analog gateway for interconnection between different subnets (1)

I. Tutorial Purpose

This experiment uses Mininet to build a subnet and make OVS a gateway to simulate intercommunication between subnets. In the experiment, let's take a look at the process of building a subnet in OVS.

OVS sets the gateway process.

OVS configures the stream table process.

 

2. Test preparation

We use Mininet to build the experiment environment. We recommend that you download the latest Mininet virtual machine from the Mininet official website. In this experiment, the virtual machine version is a mininet-2.2.1-150420-ubuntu-14.04-server-amd64 or install it by referring to the Native Installation from Source described in the official documentation.

The topology of the experiment is as follows:

 

Iii. Experiment steps

1. Build a network topology.

Our goal is to allow two hosts in different subnets to communicate with each other. We can first build two hosts and then set different subnets for the hosts. Because the Mininet virtual host belongs to 10.0.0.0/24 by default, you need to set the host network.

Note:

$> Indicates the Linux Command Line input. The permission is root.

Mininet> indicates the Mininet command line mode.

Create Topology

$> mn --topo single,2 --mac

Note:The mac parameter is used to create a host with a simpler MAC address and facilitate subsequent flow table creation.

Query status

mininet> dump

We can see that the default h1 and h2 are in the same network segment and can ping each other.

mininet> h1 ping h2PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=1.96 ms64 bytes from 10.0.0.2: icmp_seq=2 ttl=64 time=0.412 ms

Modify network settings

mininet> h1 ifconfig h1-eth0 10.0.0.1/24 netmask 255.0.0.0mininet> h2 ifconfig h2-eth0 20.0.0.1/24 netmask 255.0.0.0

The test network status is as follows:

mininet> h1 ping h2connect: Network is unreachable

As configured, h1 and h2 are no longer in the same network segment. When h1 is pinged to h2, the packet is forwarded to the gateway of the subnet. However, because no gateway is set for the two network segments in the current environment, the final state is inaccessible. In this case, we can set a gateway for the host.

Set Gateway

mininet> h1 route add default gw 10.0.0.254 h1-eth0mininet> h2 route add default gw 20.0.0.254 h2-eth0

The test network status is as follows:

mininet> h1 ping h2PING 20.0.0.1 (20.0.0.1) 56(84) bytes of data.From 10.0.0.1 icmp_seq=1 Destination Host UnreachableFrom 10.0.0.1 icmp_seq=2 Destination Host Unreachable


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.