码迷,mamicode.com
首页 > 其他好文 > 详细

多网卡PC装OVS改造成OpenFlow交换机配置脚本

时间:2015-04-13 10:58:17      阅读:285      评论:0      收藏:0      [点我收藏+]

标签:

#!/bin/sh

#启动物理端口

echo "openflow" | sudo -S ifconfig eth0 up
echo "openflow" | sudo -S ifconfig eth1 up
echo "openflow" | sudo -S ifconfig eth2 up
echo "openflow" | sudo -S ifconfig eth3 up
#如果网桥已存在,删除

echo "openflow" | sudo -S ovs-vsctl --if-exists del-br s1

#添加新网桥,并设置其OpenFlow版本号和dpid

echo "openflow" | sudo -S ovs-vsctl add-br s1
echo "openflow" | sudo -S ovs-vsctl set Bridge s1 protocols=OpenFlow13
echo "openflow" | sudo -S ovs-vsctl set Bridge s1 other_config:datapath-id=0000000000000001

#添加物理端口到网桥

echo "openflow" | sudo -S ovs-vsctl add-port s1 eth0

echo "openflow" | sudo -S ovs-vsctl add-port s1 eth1
echo "openflow" | sudo -S ovs-vsctl add-port s1 eth2
echo "openflow" | sudo -S ovs-vsctl add-port s1 eth3
#设置网桥IP
echo "openflow" | sudo -S ifconfig s1 192.168.1.2 netmask 255.255.255.0
echo "openflow" | sudo -S route del default
echo "openflow" | sudo -S route add default gw 192.168.1.1 s1

echo "openflow" | sudo -S ovs-vsctl set Bridge s1 fail-mode=secure
#连接控制器
echo "openflow" | sudo -S ovs-vsctl del-controller s1

echo "openflow" | sudo -S ovs-vsctl set-controller s1 tcp:192.168.1.11:6633


ocean

2015.4.13

于东南大学

多网卡PC装OVS改造成OpenFlow交换机配置脚本

标签:

原文地址:http://blog.csdn.net/sdnexplorer/article/details/45022197

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!