实验环境:Mininet and Remote Controller(Ubuntu14.04 Desktop ryu)
实验过程:
1. 在有图形界面的控制器端,远程登录到mininet以使用可视化界面来配置实验网络
$ ssh -X mininet@192.168.0.31
$ cd ~/mininet/examples
$ sudo python miniedit.py
2. 打开控制器gui发现进程
$ cd ~/Downloads/ryu-3.26
# PYTHONPATH=. ./bin/ryu run --observe-links ryu/app/gui_topology/gui_topology.py
3. 在mininet运行拓扑,进入CLI命令行界面,启动成功后,在控制器用网页打卡本地8080端口可看到拓扑展示
$ sudo mn -c
$ sudo python ~/mininet/examples/etest.py
4. 配置流表
a. standalone配置MAC Learning
# ovs-ofctl del-flows s4
# ovs-ofctl add-flow s4 "table=0 actions=learn(table=2,NXM_OF_ETH_DST[]=NXM_OF_ETH_SRC[],output:NXM_OF_IN_PORT[]),resubmit(,1)"
# ovs-ofctl add-flow s4 "table=1,priority=0 actions=NORMAL"
# ovs-ofctl dump-flows s4
b. secure配置流表
# ovs-ofctl add-flow s1 "in_port=2,ip,nw_src=10.0.0.1,nw_dst=10.0.0.4 actions=output:1"
# ovs-ofctl add-flow s1 "in_port=1,ip,nw_src=10.0.0.4,nw_dst=10.0.0.1 actions=output:2"
# ovs-ofctl add-flow s1 "in_port=2,arp,nw_src=10.0.0.1,nw_dst=10.0.0.4 actions=output:1"
# ovs-ofctl add-flow s1 "in_port=1,arp,nw_src=10.0.0.4,nw_dst=10.0.0.1 actions=output:2"