1 / 9

OpenFlow 初级安装测试教程 --OpenFlow 交换机和 POX 安装记录

OpenFlow 初级安装测试教程 --OpenFlow 交换机和 POX 安装记录. 请关注新浪 @ Openflow 世界 2012.11.1. 拓扑图. OpenFlow Controller. 安装的开源 POX 控制器. 192.168.100.100. HUB 集线器. Switching hub. 请关注我的微博 @Openflow 世界. 192.168.100.11. 192.168.100.22. eth0. PC1. eth0. PC2. OpenFlow Switch1. OpenFlow Switch2.

Download Presentation

OpenFlow 初级安装测试教程 --OpenFlow 交换机和 POX 安装记录

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OpenFlow初级安装测试教程--OpenFlow交换机和POX安装记录OpenFlow初级安装测试教程--OpenFlow交换机和POX安装记录 请关注新浪@Openflow世界 2012.11.1

  2. 拓扑图 OpenFlow Controller 安装的开源POX控制器 192.168.100.100 HUB集线器 Switching hub 请关注我的微博 @Openflow世界 192.168.100.11 192.168.100.22 eth0 PC1 eth0 PC2 OpenFlow Switch1 OpenFlow Switch2 支持4网卡的PC1,PC2 实际安装我4个Openflow 交换机 eth2 eth1 192.168.111.11 eth3 192.168.122.22 eth3 Host1 Host2 192.168.111.201 192.168.122.202 Control path 总共5个PC,1个当控制器,2个当交换机安装Openflow, 2个当host。控制器和交换机我安装的是ubuntu12.4系统 Data path

  3. 搭建环境注意事项 • PC之间的网线线序稍微有差别,google之 • 两个安装switch的PC上,请查看下ip_forword的设置,请注意应设置为0 • cat /proc/sys/net/ipv4/ip_forward 应为0 • 不需要在switch上加任何路由,openflow不需要 • 配置如拓扑上的IP,注意Host配置IP地址,gateway地址为对端IP地址,如host1设置gateway地址为:192.168.111.201

  4. 安装和运行控制器POX(NOX’s sister) • Install • git clone http://www.github.com/noxrepo/pox • Run POX • cd $POX_HOME • sudo ./pox.py • NOX是最早支持Openflow的开源控制器,目前版本有NOX和POX系统,我们这里选择POX系统,初学的人安装和运行都很方便。容易吧 • NOX官网地址:www.noxrepo.org

  5. 安装OpenFlow Switch • Install • git clone git://openflow.org/openflow.git • cd openflow • ./boot.sh • ./configure • make • Create Datapath • cd $OF_HOME/udatapath • ./ofdatapath --detach unix:/var/run/dp0 –d $SWITCH_MAC_ID –i eth1, eth2 • unix:/var/run/dp0 指定就是交换机,其中dp0 后面跟有个空格别忘记,后面加一个个的flow命令老是用到这个 • Run secure channel • cd $OF_HOME/secchan • ./ofprotocol unix:/var/run/dp0 tcp:$CONTROLLER_IP:6633 -d 给交换机一个独立的ID,区别控制器里面的Openflow交换机, -i, 指定那个接口为Openflow交换机的port,本图拓扑eth0跟controller连接不做交换机的port 控制器的IP地址

  6. 手动添加flow命令 • dpctl • Show switch • $ sudo $OF_HOME/utilities/dpctl show unix:/var/run/dp0 • Add flow • $ sudo $OF_HOME/utilities/dpctl add-flow unix:/var/run/dp0 , in_port=3, dl_type=0x0800, • actions=output:2 • Modify MAC address • $ sudo $OF_HOME/utilities/dpctl add-flow unix:/var/run/dp0 , in_port=3, dl_type=0x0800, dl_dst=$GATEWAY_MAC, actions=mod_dl_dst:$DST_MAC, output:2 • Display flow • $ sudo $OF_HOME/utilities/dpctl dump-flows unix:/var/run/dp0 查询OF交换机的port口对应物理上的哪个eth口 需要更改MAC地址,否则无法ping通

  7. 手动添加flow命令 • 查询资料发现很多网友在咨询host之间不能ping通,通过抓包我们知道,host发出去的包目的MAC地址默认是Geteway MAC地址,需要将这个MAC在交换机改成实际目的MAC地址 • 一条flow默认在无数据的情况下60s将被移除

  8. 本拓扑的FLOW命令 • SW1上添加的flow命令如下 • sudo ./dpctl add-flow unix:/var/run/dp0 ,in_port=2, dl_type=0x0800, actions=output:3 • sudo ./dpctl add-flow unix:/var/run/dp0 ,in_port=3, dl_type=0x0800, dl_dst=$SW1_ETH3_MAC,action=mod_dl_dst:$HOST2_MAC,output:2 • SW2上添加的flow命令如下 • sudo ./dpctl add-flow unix:/var/run/dp0 ,in_port=1, dl_type=0x0800, actions=output:3 • sudo ./dpctl add-flow unix:/var/run/dp0 ,in_port=3, dl_type=0x0800, dl_dst=$SW2_ETH3_MAC,action=mod_dl_dst:$HOST1_MAC,output:1 • Host1 这样就能ping 通Host2 • 不能ping通的时候,在OF 交换机上用./dpctl dump-flows unix:/var/run/dp0 查看是否添加的flow存在 OpenFlow Switch1 OpenFlow Switch2 eth2 eth1 eth3 eth3 Host1 Host2 192.168.111.201 192.168.122.202

  9. THANKS! 感谢观看,初学者不当之处请谅解,有问题请新浪微博咨询我们

More Related