我在Ubuntu 20.04中使用apt 安装mininet 2.2.2, 每次执行mn命令都出现如下错误:
xxx@dell:~$ sudo mn
*** Creating network
*** Adding controller
*** Adding hosts:
h1 h2
*** Adding switches:
s1 r setting lo up:
*** Adding links:
Caught exception. Cleaning up…
xception: Error creating interface pair (h1-eth0,s1-eth1):
*** Removing excess controllers/ofprotocols/ofdatapaths/pings/noxes
killall controller ofprotocol ofdatapath ping nox_core lt-nox_core ovs-openflowd ovs-controller udpbwtest mnexec ivs 2> /dev/null
killall -9 controller ofprotocol ofdatapath ping nox_core lt-nox_core ovs-openflowd ovs-controller udpbwtest mnexec ivs 2> /dev/null
pkill -9 -f “sudo mnexec”
*** Removing junk from /tmp
rm -f /tmp/vconn* /tmp/vlogs* /tmp/.out /tmp/.log
*** Removing old X11 tunnels
*** Removing excess kernel datapaths
ps ax | egrep -o ‘dp[0-9]+’ | sed ‘s/dp/nl:/’
*** Removing OVS datapaths
ovs-vsctl --timeout=1 list-br
ovs-vsctl --timeout=1 list-br
*** Removing all links of the pattern foo-ethX
ip link show | egrep -o ‘([-_.[:alnum:]]±eth[[:digit:]]+)’
( ip link del s1-eth1 ) 2> /dev/null
ip link show
*** Killing stale mininet node processes
pkill -9 -f mininet:
*** Shutting down stale tunnels
pkill -9 -f Tunnel=Ethernet
pkill -9 -f .ssh/mn
rm -f ~/.ssh/mn/*
*** Cleanup complete.
折腾好久无果后,决定使用源码安装mininet,命令如下:
git clone https://github.com/mininet/mininet
cd mininet
git checkout -b mininet-2.3.0 2.3.0
cd …
./mininet/util/install.sh
成功升级到版本2.3.0, 再执行mn命令,错误没有再出现,mininet正常运行。