<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>guide to vswtich Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/guide-to-vswtich/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Fri, 14 Aug 2020 16:01:06 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>Configuring Open vSwitch on CentOS &#124; RHEL &#124; Fedora</title>
		<link>https://www.osradar.com/configuring-open-vswitch-on-centos-rhel-fedora/</link>
					<comments>https://www.osradar.com/configuring-open-vswitch-on-centos-rhel-fedora/#respond</comments>
		
		<dc:creator><![CDATA[sabi]]></dc:creator>
		<pubDate>Mon, 17 Aug 2020 08:00:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[centos 8 how to tutorials]]></category>
		<category><![CDATA[configure vswitch]]></category>
		<category><![CDATA[Configuring Open vSwitch on CentOS | RHEL | Fedora]]></category>
		<category><![CDATA[guide to vswtich]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[how to 2020]]></category>
		<category><![CDATA[vswitch installation on centos 8]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=20893</guid>

					<description><![CDATA[<p>Today we are going to learn that how to configure Open vSwitch on CentOS/RHEL. In our previous lecture you&#8217;ve learned that how to install Open vSwitch on CentOS/RHEL. If you missed the previous article simply click the below link to read it first for the installation of Open vSwitch on CentOS/RHEL. How To Install Open [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/configuring-open-vswitch-on-centos-rhel-fedora/">Configuring Open vSwitch on CentOS | RHEL | Fedora</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Today we are going to learn that <a href="https://www.osradar.com/?p=20893" target="_blank" aria-label="undefined (opens in a new tab)" rel="noreferrer noopener">how to configure Open vSwitch on CentOS/RHEL</a>. In our previous lecture you&#8217;ve learned that how to install Open vSwitch on CentOS/RHEL. If you missed the previous article simply click the below link to read it first for the installation of Open vSwitch on CentOS/RHEL.</p>



<p><a href="https://www.osradar.com/?p=20895" target="_blank" aria-label="undefined (opens in a new tab)" rel="noreferrer noopener">How To Install Open vSwitch on CentOS 8 | RHEL 8</a></p>



<p>Here we&#8217;ll use the os-net-confi script for the configuration of Open vSwtich on CentOS/RHEL. So, follow the below steps to configure the Open vSwitch on your system.</p>



<h3><strong>Step 1: Install os-net-config Tool</strong></h3>



<p>To configure the Open vSwitch we need os-net-config tool as it will help us to perform configuration steps more easily. It provides the configuration of host networking using YAML or JSON files format.</p>



<p>By default, os-net-config use the YAML file that can be located under <strong>/etc/os-net-config/config.yaml</strong>. You can also customize this by &#8211;config-file(-c) CLI option.</p>



<h4><strong>Installing os-net-config by using OpenStack Repository</strong></h4>



<p>Hit the following command to install the os-net-config tool using OpenStack repository if you&#8217;ve already configured it.</p>



<pre class="wp-block-verse">sudo yum install os-net-config</pre>



<p>Find out more details about the package by typing</p>



<pre class="wp-block-verse">[sabi@localhost ~]$ <strong>rpm -qi os-net-config</strong>
Name : os-net-config
Version : 11.3.1
Release : 1.el8
Architecture: noarch
Install Date: Sat 08 Aug 2020 02:20:02 AM EDT
Group : Unspecified
Size : 3760703
License : ASL 2.0
Signature : RSA/SHA1, Sun 19 Apr 2020 12:34:05 PM EDT, Key ID f9b9fee7764429e6
Source RPM : os-net-config-11.3.1-1.el8.src.rpm
Build Date : Fri 28 Feb 2020 08:55:33 AM EST
Build Host : c1be.rdu2.centos.org
Relocations : (not relocatable)
Packager : CBS <a href="mailto:cbs@centos.org">cbs@centos.org</a>
Vendor : CentOS
URL : http://pypi.python.org/pypi/os-net-config
Summary : Host network configuration tool
Description :
Host network configuration tool for OpenStack.</pre>



<h4><strong>Installing os-net-config with the help of Pip</strong></h4>



<p>You can also install the os-net-config tool using pip or pip3 as it is distributed as python package.</p>



<h5><strong>CentOS 8</strong>:</h5>



<pre class="wp-block-verse">sudo dnf install python3-pip</pre>



<h5><strong>CentOS 7:</strong></h5>



<pre class="wp-block-verse">sudo yum install -y epel-release<br>sudo yum -y install python-pip<br>sudo pip install os-net-config</pre>



<p>Make sure to verify the PATH once the installation finished.</p>



<pre class="wp-block-verse">[sabi@localhost ~]$ <strong>which os-net-config</strong>
/usr/bin/os-net-config</pre>



<h3><strong>Step 2: Configuring Open vSwitch by using os-net-config</strong></h3>



<p>Let&#8217;s dive into the configuration of Open vSwitch by using os-net-config tool as we&#8217;ve already installed the Open vSwitch and the configuration tool.</p>



<p>Here we&#8217;ll see some example to understand that how we can configure.</p>



<h4><strong>Single Interface Configuration with Static IP Address</strong></h4>



<p>First create a YAML file to save configuration.</p>



<pre class="wp-block-verse">sudo nano ovs-interface.yml</pre>



<p>And then configure as shown below:</p>



<pre class="wp-block-verse">network_config:
- type: interface
 name: eth1
 use_dhcp: false
 use_dhcpv6: false
 addresses:
- ip_netmask: 172.11.101.10/24
routes:
- ip_netmask: 0.0.0.0/0
next_hop: 172.11.101.254
default: true</pre>



<h5><strong>Result:</strong></h5>



<p>It&#8217;ll configure the eth1 interface along with the static IP address as 172.11.101/24 and the gateway is 172.11.101.254.</p>



<p>Run the given command to apply the configuration changes.</p>



<pre class="wp-block-verse">sudo os-net-config -c ovs-interface.yml</pre>



<h4><strong>Configure OVS bridge With Single Attached Interface (Port)</strong></h4>



<p>First create the file for configuration and then do the changes as given below:</p>



<pre class="wp-block-verse">sudo nano ovs-bridge-single-interface.yml</pre>



<p>It&#8217;ll look like this:</p>



<pre class="wp-block-verse">network_config:
- type: ovs_bridge
 name: br-ex 
use_dhcp: false 
use_dhcpv6: false 
addresses:
 - ip_netmask: 172.11.101.10/24
routes:
- ip_netmask: 0.0.0.0/0
next_hop: 172.11.101.254
default: true
members:
-
type: interface
name: eth1</pre>



<p>Finally apply the configuration.</p>



<pre class="wp-block-verse">os-net-config -c ovs-bridge-single-interface.yml</pre>



<h4><strong>Configure OVS Bridge on OVS Bond</strong></h4>



<p>Follow the below configuration for OVS bridge.</p>



<pre class="wp-block-verse">network_config:
- type: 
ovs_bridge 
name: br-ex 
use_dhcp: true 
members: 
- type: ovs_bond 
name: bond1 
members: 
- type: interface
name: em1
- type: interface
name: em2</pre>



<p>Apply the changes in a file as done in above step.</p>



<h4><strong>Configure Tagged VLAN Interface On Top of OVS Bridge</strong></h4>



<p>Here&#8217;s the configuration sample.</p>



<pre class="wp-block-verse">network_config:
- type: ovs_bridge 
name: br-ctlplane
 use_dhcp: true 
members: 
- type: interface
name: em1
- type: vlan 
vlan_id: 20 
addresses:
- ip_netmask: 192.0.2.1/24</pre>



<h4><strong>Creating an OVS Bond</strong></h4>



<p>You can create OVS bond by doing the changes as given below:</p>



<pre class="wp-block-verse">network_config:
- type: ovs_bridge
 name: bond1 
use_dhcp: true
 members: 
- type: interface
name: eno1
- type: interface
name: eno2</pre>



<h4><strong>Checking OVS Configuration</strong></h4>



<p>Once the settings are applied, network config script will be added automatically to <strong>/etc/sysconfig/network-scripts/</strong> directory.</p>



<pre class="wp-block-verse">ls /etc/sysconfig/network-scripts/</pre>



<p>Verify the settings by hitting</p>



<pre class="wp-block-verse">ovs-vsctl show</pre>



<h3><strong>Step 3: Creating KVM Network with OVS</strong></h3>



<p>For users who are using Open vSwitch with KVM virutalization, need to define the network that Virtual Machine will use.</p>



<p>Create xml config file.</p>



<pre class="wp-block-verse">sudo nano kvm-ovs.xml</pre>



<p>Then add the bridge details in the file and save it.</p>



<pre class="wp-block-verse">&lt;network&gt;
&lt;name&gt;ovs-bridge &lt;/name&gt;
&lt;forward mode='bridge'/&gt;
&lt;bridge name='br-ex'/&gt;
&lt;virtualport type='openvswitch'/&gt;
&lt;network/&gt;</pre>



<p><strong>Note:</strong></p>



<p><strong>ovs-bridge: </strong>Name of the libvirt network<br><strong>br-ex: </strong>Name of OVS bridge</p>



<p>To define a network from the XML file, without starting it hit</p>



<pre class="wp-block-verse">sudo virsh net-define kvm-ovs.xml</pre>



<p>If you want to start the inactive network(previously defined) type</p>



<pre class="wp-block-verse">sudo virsh net-start ovs-bridge</pre>



<p>To start a network when service started, type the following command:</p>



<pre class="wp-block-verse">sudo virsh net-autostart ovs-bridge</pre>



<p>Verify that autostart flag is turned to yes.</p>



<pre class="wp-block-verse">sudo virsh net-list --all</pre>



<p>So, this is how you can configure the Open vSwitch on CentOS/RHEL.</p>



<p>Please share this post and join <a href="https://t.me/osradar" target="_blank" rel="noreferrer noopener">our Telegram Channel</a>.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/configuring-open-vswitch-on-centos-rhel-fedora/">Configuring Open vSwitch on CentOS | RHEL | Fedora</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/configuring-open-vswitch-on-centos-rhel-fedora/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
