Difference between revisions of "Open vSwitch"
From HackerNet
Helikopter (talk | contribs) m |
Helikopter (talk | contribs) |
||
Line 11: | Line 11: | ||
sudo /usr/share/openvswitch/scripts/ovs-ctl start | sudo /usr/share/openvswitch/scripts/ovs-ctl start | ||
− | sudo /sbin/service openvswitch start | + | #sudo /sbin/service openvswitch start |
lsmod | grep openv | lsmod | grep openv | ||
Line 17: | Line 17: | ||
ovs-vsctl add-br br0 | ovs-vsctl add-br br0 | ||
ovs-vsctl add-port br0 eth0 | ovs-vsctl add-port br0 eth0 | ||
+ | ovs-vsctl list-ifaces br0 | ||
+ | |||
+ | Show | ||
ovs-vsctl show | ovs-vsctl show | ||
+ | ovs-ofctl show br0 | ||
+ | |||
Adress till hosten | Adress till hosten | ||
ifconfig eth0 0 | ifconfig eth0 0 | ||
dhclient br0 | dhclient br0 | ||
+ | |||
+ | ===Interface=== | ||
+ | Access | ||
+ | ovs-vsctl set port eth1 vlan_mode=access tag=1 | ||
+ | Trunk | ||
+ | ovs-vsctl set port eth1 vlan_mode=tagged | ||
+ | Hybrid | ||
+ | ovs-vsctl set port eth1 vlan_mode=native-untagged trunks=[1,3] tag=2 | ||
+ | Show | ||
+ | ovs-vsctl list port eth1 | ||
===Bond=== | ===Bond=== | ||
ovs-vsctl add-bond br0 bond0 eth0 eth1 lacp=active trunks=10,11,12 | ovs-vsctl add-bond br0 bond0 eth0 eth1 lacp=active trunks=10,11,12 | ||
+ | ovs-vsctl list port bond0 | ||
===STP=== | ===STP=== |
Revision as of 15:46, 3 January 2016
Open vSwitch är en virtuell multi layer switch, open source licensierad under Apache 2.0. Det används oftast med hypervisors för att koppla ihop vms med varandra mellan hostar och nätverk, t.ex. med KVM eller Xen. Det kan också användas med dedikerad switchhårdvara eller SDN-lösningar. Open vSwitch har stöd för de flesta traditionella tekniker inklusive STP, VLAN, LACP, GRE, VXLAN, QoS och net/sflow. Open vSwitch består i huvudsak av VSWITCHD, OVSDB-server och en kernel-modul. Det går även köra distribuerat över flera hostar likt VMwares vDS och Cisco Nexus 1000V.
Contents
Installation
Ubuntu
apt-cache show openvswitch-switch | grep Version sudo apt-get install openvswitch-switch
Fedora
sudo dnf info openvswitch | grep Version sudo dnf install openvswitch
sudo /usr/share/openvswitch/scripts/ovs-ctl start #sudo /sbin/service openvswitch start lsmod | grep openv
Konfiguration
ovs-vsctl add-br br0 ovs-vsctl add-port br0 eth0 ovs-vsctl list-ifaces br0
Show
ovs-vsctl show ovs-ofctl show br0
Adress till hosten
ifconfig eth0 0 dhclient br0
Interface
Access
ovs-vsctl set port eth1 vlan_mode=access tag=1
Trunk
ovs-vsctl set port eth1 vlan_mode=tagged
Hybrid
ovs-vsctl set port eth1 vlan_mode=native-untagged trunks=[1,3] tag=2
Show
ovs-vsctl list port eth1
Bond
ovs-vsctl add-bond br0 bond0 eth0 eth1 lacp=active trunks=10,11,12 ovs-vsctl list port bond0
STP
ovs-vsctl set bridge br0 stp_enable=true
SVI
ovs-vsctl add-port br0 vlan90 tag=09 -- set interface vlan09 type=internal
Interface till vms
ip tuntap add mode tap vport1 ip tuntap add mode tap vport2 ovs-vsctl add-port testbridge vport1 ovs-vsctl add-port testbridge vport2 ovs-vsctl show
Kolla mac-tabell
ovs-appctl fdb/show testbridge
Controller
ovs-vsctl set-controller br0 tcp:10.0.0.20:6633
OpenFlow
Open vSwitch har stöd för OpenFlow.