主机名 | ip | 角色 |
---|---|---|
controller | 192.168.123.10 | 控制器1 |
ovs | 192.168.123.20 | 交换机 |
pc1 | 192.168.123.30 | 主机1 |
登陆控制器1,查看该端口是否处监听状态
root@guest-virtual-machine:/home/guest# netstat -an | grep 6633
tcp 0 0 192.168.123.10:44024 192.168.123.10:6633 ESTABLISHED
tcp6 0 0 :::6633 :::* LISTEN
tcp6 0 0 192.168.123.10:6633 192.168.123.10:44024 ESTABLISHED
保证控制器6633处监听状态后,使用root登陆交换机,查看交换机与控制器1的连接情况
注:如果连接不成功会显示‘’fail_mode:secure‘’
则需要命令手动在交换机内重连
#ovs-vsctl del-controller br-sw
#ovs-vsctl set-controller br=sw tcp:192.168.123.10:6633
查看主机的ip地址:
注:主机为获取到ip地址,需要手动重连
#ovs-vsctl del-controller br-sw
#ovs-vsctl set-controller br=sw tcp:192.168.123.10:6633
切换到交换机,设置OpenFlow协议版本为1.0
root@guest-virtual-machine:/home/guest# ovs-vsctl set bridge br-sw protocols=OpenFlow10
访问控制器web UI,点击‘Nodes’ ‘1’为节点连接的具体信息
展开所有目录
展开具体配置
补全node id、table id、flow id
展开流表的相关参数
]]>ssh可能会连接不上,需要配置本地VM8的网卡,或者ssh,推荐下面方法
vi /etc/ssh/sshd_config
//最后添加一行
PermitRootLogin yes
//保存后重启服务器即可用远程工具连接Ubuntu主机
首先连接虚拟机
上传安装包,解压缩并进入目录中,启动控制台
root@guest-virtual-machine:/home/guest# tar -zxvf distribution-karaf-0.3.0-Lithium.tar.gz
root@guest-virtual-machine:/home/guest# cd distribution-karaf-0.3.0-Lithium
//启动一(不推荐)
root@guest-virtual-machine:/home/guest# ./bin/karaf
//启动二(后台运行)
root@guest-virtual-machine:/home/guest/distribution-karaf-0.3.0-Lithium# ./bin/start
root@guest-virtual-machine:/home/guest/distribution-karaf-0.3.0-Lithium# ./bin/client -u karaf
//安装REST API功能
opendaylight-user@root>feature:install odl-restconf
//安装L2交换机和OpenFlow功能
opendaylight-user@root>feature:install odl-l2switch-switch-ui
opendaylight-user@root>feature:install odl-openflowplugin-flow-services-ui
//安装Karaf控制台的md-sal功能
opendaylight-user@root>feature:install odl-mdsal-apidocs
//安装DLUX功能 0.3.0无需安装,0.6.0可以安装
//opendaylight-user@root>feature:install odl-dluxapps-applications
//opendaylight-user@root>feature:install odl-faas-all
//列出所有组件
opendaylight-user@root>feature:list
首先查看ip地址:
连接控制器
root@guest-virtual-machine:/home/guest# mn --controller=remote,ip=192.168.123.10,port=6633
mininet> pingall
*** Ping: testing ping reachability
h1 -> h2
h2 -> h1
*** Results: 0% dropped (2/2 received)
访问web控制器(账号密码admin)
opendaylight-user@root>logout
logout退出,回到上一目录中
root@guest-virtual-machine:/home/guest/distribution-karaf-0.3.0-Lithium# rm -rf data
root@guest-virtual-machine:/home/guest/distribution-karaf-0.3.0-Lithium# ./bin/karaf clean
opendaylight-user@root>feature:list -i
查看已安装组件,确认已卸载
]]>