Mininet本身不支持Deepin系统,仅仅支持Ubuntu、Debian、Fedora、RedHatEnterpriseServer、SUSE LINUX。这类系统的教程参考:Mininet使用源码安装
-
首先确认系统是否有
git
,有就跳过"安装git
"这一步,否则执行下面所有操作。(deepin v20下好像没有git
)安装git:
sudo apt install git
安装完
git
后,运行命令ssh-keygen
,一路回车就好。登录
GitHub
,添加/home/xxx/.ssh/id_rsa.pub
的内容到github的ssh keys中,这一步可以参考博客:GitHub 添加 SSH keys。这一步是为了执行下面的git clone git://....时不会报错。
获取
Mininet
源码:git clone git://github.com/mininet/mininet
选择
Mininet
安装版本:
cd minint
git tag # 所有版本
git checkout -b 2.3.0d4 # 版本需要根据git tag结果自己选择
-
执行安装:
- 修改install.sh脚本,保证deepin环境可以安装!
-
Mininet
确定系统是否支持的逻辑就写在这个脚本中,修改代码如下(就是在DIST
中添加了Deepin):
DISTS='Deepin|Ubuntu|Debian|Fedora|RedHatEnterpriseServer|SUSE LINUX' if ! echo $DIST | egrep "$DISTS" >/dev/null; then echo "Install.sh currently only supports $DISTS." exit 1 fi
-
只修改这是不行的,我们需要确定
DIST
从哪来,往上翻,发现这样一片代码:test -e /etc/debian_version && DIST="Debian" grep Ubuntu /etc/lsb-release &> /dev/null && DIST="Ubuntu" if [ "$DIST" = "Ubuntu" ] || [ "$DIST" = "Debian" ]; then # Truly non-interactive apt-get installation install='sudo DEBIAN_FRONTEND=noninteractive apt-get -y -q install' remove='sudo DEBIAN_FRONTEND=noninteractive apt-get -y -q remove' pkginst='sudo dpkg -i' update='sudo apt-get' # Prereqs for this script if ! which lsb_release &> /dev/null; then $install lsb-release fi fi
-
把这里的代码复制一份,然后修改
DIST
为Deepin
即可,贴一个我改的:test -e /etc/debian_version && DIST="Deepin" grep Deepin /etc/lsb-release &> /dev/null && DIST="Deepin" if [ "$DIST" = "Deepin" ] || [ "$DIST" = "Debian" ]; then # Truly non-interactive apt-get installation install='sudo DEBIAN_FRONTEND=noninteractive apt-get -y -q install' remove='sudo DEBIAN_FRONTEND=noninteractive apt-get -y -q remove' pkginst='sudo dpkg -i' update='sudo apt-get' # Prereqs for this script if ! which lsb_release &> /dev/null; then $install lsb-release fi fi ```
-
-
执行安装
mininet/util/install.sh -a
最后的参数
-a
参数可以自己选择,也可以-nvf
只安装mininet、OpenFlow、Open vSwitch。具体参数可以参考官网或者Mininet使用源码安装
-
确认安装成功
-
执行
sudo mn
,能够建立最简单的网络拓扑,执行pingall
可以全网ping通image.png
-
-
为什么
Mininet
可以在deepin环境下安装成功:- 因为
Ubuntu
和Deepin
都是基于Debian
构建,没道理Mininet
支持Debian
和Ubuntu
,而不支持Deepin
,毕竟三者的包管理都是一样的。
- 因为