mininet配置命令
Mininet实验手册
一、安装
1、 直接使用带有完整软件的VM(略)
2、 源码安装
1) 下载
git clone git://github.com/mininet/mininet
2) 安装
cd mininet/util
./install.sh –a ##good luck
install.sh –nfv
3) 测试
sudo mn --switch ovsbr --test pingall
3、 软件包安装
sudo apt-get install mininet
二、常用命令
1、 创建拓扑
1) 最小化拓扑
root@user1-virtual-machine:~/mininet/util# mn --topo minimal
*** Creating network
*** Adding controller
*** 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) 创建线性拓扑
root@user1-virtual-machine:~/mininet/util# mn --topo linear,4
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2 h3 h4
*** Adding switches:
s1 s2 s3 s4
*** Adding links:
(h1, s1) (h2, s2) (h3, s3) (h4, s4) (s2, s1) (s3, s2) (s4, s3)
*** Configuring hosts
h1 h2 h3 h4
*** Starting controller
c0
*** Starting 4 switches
s1 s2 s3 s4 ...
*** Starting CLI:
请画出上面示例中线性结构的图形结构(在画图里表示即可):
3) 构建属性拓扑
root@user1-virtual-machine:~/mininet/util# mn --topo tree,fanout=3,depth=2
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2 h3 h4 h5 h6 h7 h8 h9
*** Adding switches:
s1 s2 s3 s4
*** Adding links:
(s1, s2) (s1, s3) (s1, s4) (s2, h1) (s2, h2) (s2, h3) (s3, h4) (s3, h5) (s3, h6) (s4, h7) (s4, h8) (s4, h9)
*** Configuring hosts
h1 h2 h3 h4 h5 h6 h7 h8 h9
*** Starting controller
c0
*** Starting 4 switches
s1 s2 s3 s4 ...
*** Starting CLI:
请画出上面示例中属性结构的图形结构(在画图里表示即可):
2、 使用python脚本构建拓扑
1) 线性拓扑脚本
#!/usr/bin/env python
"""
Create a self-defined linear network, and run the CLI on it.
"""
from mininet.net import Mininet
from mininet.topo import LinearTopo
Linear4 = LinearTopo(k=4) #交换机数量为4
net = Mininet(topo=Linear4)
net.start()
net.pingAll()
net.stop()
~
2) 单交换机的星形拓扑(见上课文件)
3) 树形拓扑
4) 自定义ip
5) 自定义链路
以上程序文件参考课上
三、交互式界面命令
1、 执行mn创建最原始拓扑
root@user1-virtual-machine:~/mini_topo# mn
*** Creating network
*** Adding controller
*** 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、 添加h3主机
mininet> py net.addHost('h3')
<Host h3: pid=39832>
3、 添加h3和s0之间的连接
mininet> py net.addLink(s1,net.get('h3'))
<mininet.link.Link object at 0x7f674c3e5bb0>
4、 给交换机添加端口连接h3
mininet> py s1.attach('s1-eth3')
5、 给h3设置ip地址
mininet> py h3.setIP("10.0.0.3/24")
6、 测试连通性
mininet> h1 ping h3
PING 10.0.0.3 (10.0.0.3) 56(84) bytes of data.
64 bytes from 10.0.0.3: icmp_seq=1 ttl=64 time=1.50 ms
64 bytes from 10.0.0.3: icmp_seq=2 ttl=64 time=0.198 ms
64 bytes from 10.0.0.3: icmp_seq=3 ttl=64 time=0.043 ms
^C
--- 10.0.0.3 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2012ms
rtt min/avg/max/mdev = 0.043/0.581/1.504/0.655 ms
7、 查看信息
mininet> dump
<Host h1: h1-eth0:10.0.0.1 pid=39788>
<Host h2: h2-eth0:10.0.0.2 pid=39790>
<Host h3: h3-eth0:10.0.0.3 pid=39832>
<OVSSwitch s1: lo:127.0.0.1,s1-eth1:None,s1-eth2:None,s1-eth3:None pid=39795>
<Controller c0: 127.0.0.1:6653 pid=39781>
具体命令手册查看官网:http://mininet.org/walkthrough/#interact-with-hosts-and-switches
四、图形化
本实验在openlab注册平台上实现:
效果如下:
mininet配置命令的更多相关文章
- linux配置网卡IP地址命令详细介绍及一些常用网络配置命令
linux配置网卡IP地址命令详细介绍及一些常用网络配置命令2010-- 个评论 收藏 我要投稿 Linux命令行下配置IP地址不像图形界面下那么方 便,完全需要我们手动配置,下面就给大家介绍几种配置 ...
- 一个简单的零配置命令行HTTP服务器
http-server 是一个简单的零配置命令行HTTP服务器, 基于 nodeJs. 如果你不想重复的写 nodeJs 的 web-server.js, 则可以使用这个. 安装 (全局安装加 -g) ...
- IB交换机配置命令总结
串口通过远程CRT登录,波特率9600用户名和密码都是adminDo you want to use the wizard for initial configuration?选择no打开ip rou ...
- 一个简单的零配置命令行HTTP服务器 - http-server (nodeJs)
http-server 是一个简单的零配置命令行HTTP服务器, 基于 nodeJs. 如果你不想重复的写 nodeJs 的 web-server.js, 则可以使用这个. 安装 (全局安装加 -g) ...
- 思科Cisco 2960系列交换机配置命令
配置密码: 2960>en :第一次密码为空 2960h#conf t :进入全局配置模式 2960(config)#hostname swa :设置交换机名 2960(config)#enab ...
- RHEL7查看网卡配置命令ip addr show
Validating Network Address Configuration To verify the configuration of the network address, you nee ...
- LINUX查看硬件配置命令
LINUX查看硬件配置命令 系统 # uname -a # 查看内核/操作系统/CPU信息 # head -n 1 /etc/issue # 查看操作系统版本 # cat /proc/cpuinf ...
- Ubuntu Linux下设置IP的配置命令
Ubuntu Linux下设置IP的配置命令 今天装了Ubuntu,但是发现不能上网,开始排查问题: 1.首先确定网络连接是否正确,所用的网线是否可以正常工作 2.查看网卡是否能正常工作,检测的方法如 ...
- 烽火2640路由器命令行手册-13-VPDN(L2TP,PPTP,PPPOE)配置命令
VPDN(L2TP,PPTP,PPPOE)配置命令 目 录 第1章 VPDN配置命令... 1 1.1 VPDN配置命令... 1 1.1.1 accept-dialin. 1 1.1.2 doma ...
- 烽火2640路由器命令行手册-12-IBM网络配置命令
IBM网络配置命令 目 录 第1章 DLSW配置命令... 1 1.1 DLSW配置命令... 1 1.1.1 dlsw local-peer 1 1.1.2 dlsw remote-peer 3 ...
随机推荐
- 058_Component Bundles
- 目标检测yolov5检测火龙果
一.github官方网址 https://github.com/ultralytics/yolov5/tree/v6.1 二.labelme标记数据集: (1).进入虚拟环境 (2).pip inst ...
- 实验一 密码引擎-1-OpenEuler-OpenSSL编译
1. 下载最新的OpenSSL源码 2. 用自己的8位学号建立一个文件夹,cd 你的学号,用pwd获得绝对路径 3. 参考https://www.cnblogs.com/rocedu/p/508762 ...
- Notepad++轻量级java环境
2020-07-11 summary: Notepad++搭建轻量级java环境 notepad++搭建轻量级Java 原因:不想用eclipse 一.本机环境 Windows10 64位 已安装No ...
- B - WeirdSort
B - WeirdSort 思路:经过认真的审题,你会发现,这只是个冒泡的变形,我们建立两个数组,然后用一个数组里面的数字确定位置,然后冒泡就行了.最后抖机灵用了个is_sorted,判断数组里面数字 ...
- 【JavaScript】JS写法随笔(三) JS联动设置元素默认值
问题: 使用DOM获取元素后setAttribute("value", "1")在页面有修改此标签value的情况下,再次触发function发生不生效.无法修 ...
- 反序列化 sqlserver 中的 sysdiagrams,找到其中包含的表的信息
转载于:Script SQL Server 2005 diagrams to a file - CodeProject /** <summary> Based on ufn_Varbina ...
- MySQL 面试题总结
MySQL的面试知识点总结 Q1:MySQL 的逻辑架构了解吗? 第一层是服务器层,主要提供连接处理.授权认证.安全等功能. 第二层实现了 MySQL 核心服务功能,包括查询解析.分析.优化.缓存以及 ...
- @media移动PC端fontSize响应设置
@media only screen and (min-width: 320px) and (max-width: 359px) { html, body { font-size: 8.51px; } ...
- FII-PRA006/010开发板硬件实验一
FII-PRA006/010开发板硬件实验一 以一位全加器为例介绍如何利用开发板进行板载实验.一位全加器的Verilog代码如下: 1 2 3 4 5 6 7 8 9 10 module fadd1 ...