DPDK 설치가 완료된 후
필요 패키지 설치
$ apt-get install autoconf libtool
OVS 다운 및 설치
$ git clone https://github.com/openvswitch/ovs.git
$ cd ovs
$ ./boot.sh
$ ./configure --with-dpdk=$DPDK_BUILD
$ make
$ make install
DPDK-OVS 실행 스크립트
$ vi start.sh
pkill -9 ovs
rm -rf /usr/local/var/run/openvswitch
rm -rf /usr/local/etc/openvswitch
rm -rf /tmp/conf.db
mkdir -p /usr/local/etc/openvswich
mkdir -p /usr/local/var/run/openvswitch
export PATH=$PATH:/usr/local/share/openvswitch/scripts
export DB_SOCK=/usr/local/var/run/openvswitch/db.sock
ovsdb-tool create /usr/local/etc/openvswitch/conf.db /home/[user]/ovs/vswitchd/vswitch.ovsschema
ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach
ovs-vsctl --no-wait set Open_vSwitch . other_config:dpdk-init=true other_config:dpdk-lcore-mask=0x4 other_config:dpdk-socket-mem="1024,0"
ovs-vsctl set Open_vSwitch . other_config:pmd-cpu-mask=2
ovs-ctl --no-ovsdb-server --db-sock="$DB_SOCK" start
ovs-vsctl get Open_vSwitch . other_config
Bridge 생성 (물리 - 물리)
ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev
ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk options:dpdk-devargs=0000:05:00.0
ovs-vsctl add-port br0 dpdk1 -- set Interface dpdk1 type=dpdk options:dpdk-devargs=0000:05:00.1
ovs-vsctl add-port br0 포트이름 -- set Interface 포트이름 type=dpdk options:dpdk-devargs=DPDK에서 등록한 NIC
Flow rule 설정
ovs-ofctl del-flows br0
ovs-ofctl add-flow br0 in_port=1,actions=output:2
ovs-ofctl add-flow br0 in_port=2,actions=output:1