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,毕竟三者的包管理都是一样的。
- 因为
