参考原文链接:
https://cyneliu.gitee.io/2019/05/16/%E6%90%AD%E5%BB%BA%E8%87%AA%E5%B7%B1%E7%9A%84SDN%E5%AE%9E%E9%AA%8C%E7%8E%AF%E5%A2%83/
解决办法如下:
首先运行下面的命令来移除 /var/lib/dpkg/ 文件夹下的锁定文件:
sudo rm /var/lib/dpkg/lock
之后像下面这样强制重新配置软件包:
sudo dpkg --configure -a
最后sudo apt update
git checkout -b 2.2.1 2.2.1
解决方法如下:
apt-get update
apt-get upgrade
apt-get install iproute
使用apt-get upgrade报错:
Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
解决办法:
sudo apt-get clean
sudo apt-get update
解决方法:
sudo apt-get install mininet
sudo apt-get update
sudo apt-get install openvswitch-switch openvswitch-common
ovs-vsctl --version
sudo apt-get install unzip lrzsz
sudo apt-get install openjdk-7-jdk
报错,解决方法:
sudo add-apt-repository ppa:openjdk-r/ppa
apt install software-properties-common
sudo apt-get update
sudo apt-get install openjdk-7-jdk
再次使用该命令:
sudo apt-get install openjdk-7-jdk
解决办法,参照虚拟机1 ,仍然失败
转而安装openjdk-8-jdk
reboot
feature:install odl-l2switch-switch
feature:install odl-openflowplugin-all
feature:install odl-dlux-all
feature:install odl-mdsal-all
feature:install odl-adsal-northbound
`
(此时虚拟机2 ip为192.168.160.156,后因虚拟机瘫痪重建虚拟机2)
mn --controller=remote,ip=192.168.160.156,port=6633 –mac
(此时用的新建的虚拟机2,IP为192.168.160.158)
sudo vi linear.py
sudo mn --controller=remote,ip=192.168.160.158,port=6633 --custom ./linear.py --topo mytopo --switch ovs,protocols=OpenFlow10 --mac
is_connected:true 已连接
(mininet与odl已连接)
打开虚拟机2 访问OpenDaylight Web页面
选择模块
展开“opendaylight-inventory rev.2013-08-19”,选择“config ——> nodes ——> node{id} ——> table{id} ——> flow{id}”
展开“match ——> ethernet-match ——> ethernet -type”,填写“type”为“0x0800”
展开“instructions”,并单击“instruction list”后面的“+”,在“instruction”后面下拉框中选择“apply-actions-case”
展开“apply-actions”,单击“action list”后面的“+”,在action后面的下拉框中选择“drop-action-case”,action order和instruction order都设置为0
设置“priority”为27,“idle-timeout”为0,“hard-timeout”为0,“cookie”为100000000,“table_id”为0
向右滚动Actions栏,在路径后面有动作类型GET、PUT、POST、DELETE,下发流表则选择PUT动作,然后单击“Send”
可是查了opendaylight的log还是没有发现问题,下发流表失败,拓扑图建立成功。