1

I am new to GCP services and try to deploy mininet-wifi script to the cloud. On physical machines the installation described in the link and the SDN python script work pretty fine. However, for some reason on GCP Ubuntu instance this does not happen.

When I run the python script I get this error:

modprobe: FATAL: Module mac80211_hwsim not found in directory /lib/modules/4.13.0-1006-gcp
find: ‘/sys/kernel/debug/ieee80211’: No such file or directory
Warning! Error when loading mac80211_hwsim. Please run sudo 'mn -c' before running your code.

During the installation no errors regarding the module were displayed. I tried to add manually but are not avaiable:

# modprobe mac80211_hwsim
modprobe: FATAL: Module mac80211_hwsim not found in directory /lib/modules/4.13.0-1006-gcp
# modprobe mac80211
modprobe: FATAL: Module mac80211 not found in directory /lib/modules/4.13.0-1006-gcp

I find difficulties to find some working/updated manual to build these modules by hand. Do you know if GCP allows to build and add new modules to the kernel ?

2 Answers2

2

Today I found out what has happened. For some reason linux-image-extra was somehow "partially" installed i.e. some of its modules did not install of course the ones I needed. After simple apt-get install linux-image-extra-$(uname -r) they are available and everything is working as it should.

0

It looks like the *-gcp kernels are not built by default with the kernel module mac80211_hwsim available so you'll have to get it somewhere or install/compile a new kernel with it.

Anyway you mentioned you are using Ubuntu 16, and with the mininet-wifi package there comes the installation script on util/install.sh which automatically pulls the required dependencies from git and compiles everything. See this part of the script:

# Install Mininet-WiFi deps
function wifi_deps {
    echo "Installing Mininet-WiFi dependencies"
    $install wireless-tools rfkill python-numpy python-scipy pkg-config \
            python-matplotlib libnl-3-dev libnl-genl-3-dev libssl-dev make libevent-dev patch
    pushd $MININET_DIR/mininet-wifi
    git submodule update --init --recursive
    pushd $MININET_DIR/mininet-wifi/hostap
    patch -p0 < $MININET_DIR/mininet-wifi/util/hostap-patches/config.patch
    pushd $MININET_DIR/mininet-wifi/hostap/hostapd
    cp defconfig .config
    sudo make && make install
    pushd $MININET_DIR/mininet-wifi/hostap/wpa_supplicant
    cp defconfig .config
    sudo make && make install
    pushd $MININET_DIR/mininet-wifi/iw
    sudo make && make install
    cd $BUILD_DIR
    if [ -d mac80211_hwsim_mgmt ]; then
      echo "Removing mac80211_hwsim_mgmt..."
      rm -r mac80211_hwsim_mgmt
    fi
    git clone --depth=1 https://github.com/ramonfontes/mac80211_hwsim_mgmt.git
    pushd $BUILD_DIR/mac80211_hwsim_mgmt
    sudo make install
}

So I recommend you use it, I tested it on a Google Cloud Platform Ubuntu 16 instance and it got it working in no time. If you still want to do it manually just look for the missing dependencies and kernel modules and modprobe them in.

I could find the mac80211_hwsim module here, for example:

https://github.com/jlopex/mac80211_hwsim

DevopsTux
  • 158
  • 7