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

SDN第三次上机作业

时间:2017-12-13 23:17:52      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:shark   创建   测试   技术分享   port   作业   gpo   功能   vlan   

1.创建以下拓扑(可采用任意方式)
技术分享图片

2.利用OVS命令下发流表,实现VLAN功能
ovs-ofctl -O OpenFlow13 add-flow s1 priority=1,in_port=1,actions=push_vlan:0x8100,set_field:4096->vlan_vid,output:4
ovs-ofctl -O OpenFlow13 add-flow s1 priority=1,in_port=2,actions=push_vlan:0x8100,set_field:4097->vlan_vid,output:4
ovs-ofctl -O OpenFlow13 add-flow s1 priority=1,in_port=3,actions=push_vlan:0x8100,set_field:4098->vlan_vid,output:4
ovs-ofctl -O OpenFlow13 add-flow s1 priority=1,dl_vlan=0,actions=pop_vlan,output:1
ovs-ofctl -O OpenFlow13 add-flow s1 priority=1,dl_vlan=1,actions=pop_vlan,output:2
ovs-ofctl -O OpenFlow13 add-flow s1 priority=1,dl_vlan=2,actions=pop_vlan,output:3
ovs-ofctl -O OpenFlow13 add-flow s1 priority=0,actions=output:controller
ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,in_port=1,actions=push_vlan:0x8100,set_field:4096->vlan_vid,output:4
ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,in_port=2,actions=push_vlan:0x8100,set_field:4097->vlan_vid,output:4
ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,in_port=3,actions=push_vlan:0x8100,set_field:4098->vlan_vid,output:4
ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,dl_vlan=0,actions=pop_vlan,output:1
ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,dl_vlan=1,actions=pop_vlan,output:2
ovs-ofctl -O OpenFlow13 add-flow s2 priority=1,dl_vlan=2,actions=pop_vlan,output:3
ovs-ofctl -O OpenFlow13 add-flow s2 priority=0,actions=output:controller

3.利用OVS命令查看流表
技术分享图片

技术分享图片

4.验证性测试
技术分享图片

5.Wireshark抓包验证
技术分享图片

SDN第三次上机作业

标签:shark   创建   测试   技术分享   port   作业   gpo   功能   vlan   

原文地址:http://www.cnblogs.com/zhanglanxin/p/8034731.html

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