-
一、创建环境(ubuntu2204)
-
二、启动控制器
-
1、启动opendaylight
-
root@yyq-virtual-machine:/home/yyq# cd opendaylight/
root@yyq-virtual-machine:/home/yyq/opendaylight# cd distribution-karaf-0.6.4-Carbon
root@yyq-virtual-machine:/home/yyq/opendaylight/distribution-karaf-0.6.4-Carbon# cd bin/
root@yyq-virtual-machine:/home/yyq/opendaylight/distribution-karaf-0.6.4-Carbon/bin# . karaf
Apache Karaf starting up. Press Enter to open the shell now...
100% [========================================================================]Karaf started in 25s. Bundle stats: 363 active, 363 total
________ ________ .__ .__ .__ __
\_____ \ ______ ____ ____ \______ \ _____ ___.__.| | |__| ____ | |___/ |_
/ | \\____ \_/ __ \ / \ | | \\__ \< | || | | |/ ___\| | \ __\
/ | \ |_> > ___/| | \| ` \/ __ \\___ || |_| / /_/ > Y \ |
\_______ / __/ \___ >___| /_______ (____ / ____||____/__\___ /|___| /__|
\/|__| \/ \/ \/ \/\/ /_____/ \/
Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.opendaylight-user@root>
-
2、用netstat查看端口(主要查看6633和6653)
- root@yyq-virtual-machine:/home/yyq# netstat -ntlp |grep 6633
tcp6 0 0 :::6633 :::* LISTEN 3670/java
root@yyq-virtual-machine:/home/yyq# netstat -ntlp |grep 6653
tcp6 0 0 :::6653 (listen代表正在监听) -
3、用浏览器测试web端口
- IP地址:8181/index.html#/login(用户名和密码都是admin)
-
三、创建mn虚拟环境
-
1、启动虚拟环境
- root@yyq-virtual-machine:/home/yyq# mn --controller=remote,ip=192.168.87.130 --switch=ovsk,protocols=OpenFlow13(这里的ip地址每个人根据自己实际情况都是不一样的)
*** Creating network
*** Adding controller
Connecting to remote controller at 192.168.87.130:6653
*** Adding hosts:
h1 h2
*** Adding switches:
s1
*** Adding links:
(h1, s1) (h2, s1)
*** Configuring hosts
h1 h2
*** Starting controller
c0
*** Starting 1 switches
s1 ...
*** Starting CLI: -
2、在Linux终端查看端口交换机
- root@yyq-virtual-machine:/home/yyq# ovs-vsctl show
1540ba6b-9f63-4ba3-8df4-0d053718cb6f
Bridge s1
Controller "ptcp:6654"
Controller "tcp:192.168.87.130:6653"
is_connected: true(这里的true说明连接成功)
fail_mode: secure
Port s1
Interface s1
type: internal
Port s1-eth2
Interface s1-eth2
Port s1-eth1
Interface s1-eth1
ovs_version: "2.17.9" -
3、在mn虚拟环境中用pingall测试
-
4、在浏览器查看拓扑
- (说明控制器已经和交换机成功建立连接)
-
四、安装抓包工具
- apt install wireshark
-
五、打开抓包工具进行抓包
- 在mininet终端下执行pingall即可
Openflow南向接口协议分析
最新推荐文章于 2024-06-09 18:09:24 发布