zoukankan      html  css  js  c++  java
  • centos安装mininet 和卸载

    稳定版本:

    mininet==2.2.2
    ~/mininet

    "RedHatEnterpriseServer"的地方添加 CentOS
    DIST=`lsb_release -is`
    [root@kunpeng82 util]# lsb_release -is
    CentOS
    [root@kunpeng82 util]# 

    pip install pexpect
    [root@kunpeng82 mininet]# pip uninstall mininet
    DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
    Found existing installation: mininet 2.2.2
    Uninstalling mininet-2.2.2:
      Would remove:
        /usr/bin/mn
        /usr/lib/python2.7/site-packages/mininet-2.2.2-py2.7.egg
    Proceed (y/n)? n
    [root@kunpeng82 mininet]# git branch -d 2.2.0
    error: branch '2.2.0' not found.
    [root@kunpeng82 mininet]# git checkout 2.2.0
    HEAD is now at c75eb47... 2.2.0rc1 -> 2.2.0
    [root@kunpeng82 mininet]# make install
    cc -Wall -Wextra  -DVERSION="`PYTHONPATH=. bin/mn --version`" mnexec.c -o mnexec
    PYTHONPATH=. help2man -N -n "create a Mininet network." 
    --no-discard-stderr bin/mn -o mn.1
    help2man -N -n "execution utility for Mininet." 
    -h "-h" -v "-v" --no-discard-stderr ./mnexec -o mnexec.1
    install mnexec /usr/bin
    install mn.1 mnexec.1 /usr/share/man/man1

    =======================================================================================================================

    #$install cgroup-tools || $install cgroup-bin
    换成
    
    $install libcgroup libcgroup-tools
    yum -y install libcgroup libcgroup-tools
    增加
    test -e /etc/centos-release && DIST="CentOS" if [ "$DIST" = "CentOS" ]; then install='sudo yum -y install' remove='sudo yum -y erase' pkginst='sudo rpm -ivh' # Prereqs for this script if ! which lsb_release &> /dev/null; then $install redhat-lsb-core fi fi test -e /etc/SuSE-release && DIST="SUSE Linux"
    修改
    DISTS='Ubuntu|Debian|Fedora|RedHatEnterpriseServer|SUSE LINUX'


    DISTS='Ubuntu|Debian|Fedora|RedHatEnterpriseServer|SUSE LINUX|CentOS' if ! echo $DIST | egrep "$DISTS" >/dev/null; then echo "Install.sh currently only supports $DISTS." exit 1 fi
    #mininet/util/install.sh[options]
    这里典型的[options]主要有下面几种:
    “-a”:完整安装包括Mininet VM,还包括如Open vSwitch的依赖关系,以及像的OpenFlow Wireshark分离器和POX。默认情况下,这些工具将被安装在你的home目录中。
    “-nfv”:安装Mininet、基于OpenFlow的交换机和Open vSwitch。
    “-s mydir” :在其他选项使用前使用此选项可将源代码建立在一个指定的目录中,而不是在你的home目录。
    # install.sh –a        ##完整安装(默认安装在home目录下)
    # install.sh -s mydir –a        ##完整安装(安装在其他目录) 
    # install.sh –nfv        ##安装Mininet+用户交换机+OVS(安装在home目录下)        
    # install.sh -s mydir –nfv            ##安装Mininet+用户交换机+OVS(安装在其他目录下)
    mininet/util/install.sh -nf
    [root@kunpeng82 mininet]# mininet/util/install.sh -h
    Detected Linux distribution: CentOS 7.8.2003 AltArch aarch64
    sys.version_info(major=2, minor=7, micro=5, releaselevel='final', serial=0)
    Detected Python (python) version 2
    
    Usage: install.sh [-abcdfhikmnprtvVwxy03]
    
    This install script attempts to install useful packages
    for Mininet. It should (hopefully) work on Ubuntu 11.10+
    If you run into trouble, try
    installing one thing at a time, and looking at the 
    specific installation function in this script.
    
    options:
     -a: (default) install (A)ll packages - good luck!
     -b: install controller (B)enchmark (oflops)
     -c: (C)lean up after kernel install
     -d: (D)elete some sensitive files from a VM image
     -e: install Mininet d(E)veloper dependencies
     -f: install Open(F)low
     -h: print this (H)elp message
     -i: install (I)ndigo Virtual Switch
     -k: install new (K)ernel
     -m: install Open vSwitch kernel (M)odule from source dir
     -n: install Mini(N)et dependencies + core files
     -p: install (P)OX OpenFlow Controller
     -r: remove existing Open vSwitch packages
     -s <dir>: place dependency (S)ource/build trees in <dir>
     -t: complete o(T)her Mininet VM setup tasks
     -v: install Open (V)switch
     -V <version>: install a particular version of Open (V)switch on Ubuntu
     -w: install OpenFlow (W)ireshark dissector
     -y: install R(y)u Controller
     -x: install NO(X) Classic OpenFlow controller
     -0: (default) -0[fx] installs OpenFlow 1.0 versions
     -3: -3[fx] installs OpenFlow 1.3 versions
    [root@kunpeng82 mininet]# 
    [root@kunpeng82 mininet]# mn --version
    2.3.0d6
    [root@kunpeng82 mininet]# 
    [root@kunpeng82 mininet]#  mn --test pingall
    *** 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 ...
    *** Waiting for switches to connect
    s1 
    *** Ping: testing ping reachability
    h1 -> h2 
    h2 -> h1 
    *** Results: 0% dropped (2/2 received)
    *** Stopping 1 controllers
    c0 
    *** Stopping 2 links
    ..
    *** Stopping 1 switches
    s1 
    *** Stopping 2 hosts
    h1 h2 
    *** Done
    completed in 1.459 seconds
    [root@kunpeng82 mininet]#
    [root@kunpeng82 mininet]# mn --version
    2.3.0d6
    [root@kunpeng82 mininet]#  mn --test pingall
    *** 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 ...
    *** Waiting for switches to connect
    s1 
    *** Ping: testing ping reachability
    h1 -> h2 
    h2 -> h1 
    *** Results: 0% dropped (2/2 received)
    *** Stopping 1 controllers
    c0 
    *** Stopping 2 links
    ..
    *** Stopping 1 switches
    s1 
    *** Stopping 2 hosts
    h1 h2 
    *** Done
    completed in 1.459 seconds
    [root@kunpeng82 mininet]# 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:
    mininet> quit-------------------退出
    *** Stopping 1 controllers
    c0 
    *** Stopping 2 links
    ..
    *** Stopping 1 switches
    s1 
    *** Stopping 2 hosts
    h1 h2 
    *** Done
    completed in 33.922 seconds
    [root@kunpeng82 mininet]#
    No package ssh available.
    Package iperf-2.0.13-1.el7.aarch64 already installed and latest version
    Package 1:telnet-0.17-65.el7_8.aarch64 already installed and latest version
    Package 2:ethtool-4.8-10.el7.aarch64 already installed and latest version
    Package help2man-1.41.1-3.el7.noarch already installed and latest version
    Package python2-pyflakes-1.6.0-4.el7.noarch already installed and latest version
    Package pylint-1.6.5-6.el7.noarch already installed and latest version
    No package pep8 available.
    Package python-setuptools-0.9.8-7.el7.noarch already installed and latest version
    No package python-pexpect available.
    No package python-tk available.
    Nothing to do
    Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
    
    This system is not registered with an entitlement server. You can use subscription-manager to register.
    
    Repository base is listed more than once in the configuration
    Repository updates is listed more than once in the configuration
    Repository extras is listed more than once in the configuration
    Repository centosplus is listed more than once in the configuration
    Loading mirror speeds from cached hostfile
    No package iproute2 available.

    卸载

    [root@kunpeng82 mininet]# pip list | grep mininet
    DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
    mininet                          2.3.0d6
    [root@kunpeng82 mininet]# pip uninstall mininet
  • 相关阅读:
    sql注入-原理&防御
    vulnhub靶场之AI-WEB1.0渗透记录
    python -m http.server 搭建一个简易web下载服务器
    渗透测试工具-sqlmap
    OSI七层模型
    LAXCUS大数据操作系统3.03版本发布,欢迎使用试用
    松耦合和紧耦合的架构设计、性能对比
    Laxcus大数据操作系统2.0(5)- 第二章 数据组织
    从AlphaGo谈通用型人工智能设计
    基于深度推理、自编程、大数据的通用人工智能
  • 原文地址:https://www.cnblogs.com/dream397/p/12944743.html
Copyright © 2011-2022 走看看