Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to configure nodes on a non root user #263

Open
cwyark opened this issue Sep 27, 2023 · 0 comments
Open

Failed to configure nodes on a non root user #263

cwyark opened this issue Sep 27, 2023 · 0 comments

Comments

@cwyark
Copy link

cwyark commented Sep 27, 2023

I'm using ramonfontes/containernet's version containernet. I found it could not configure nodes when the docker image is running under a non-root user permission.

here's my dockerfile

FROM ubuntu:focal
RUN useradd -u 1000 ubuntu
RUN apt update;apt install -y sudo iproute2 net-tools wireless-tools
USER ubuntu

it always show permission during configuring nodes (I thinks these commands is running under 'ubuntu' user)

*** Configuring WiFi nodes
Loading 3 virtual wifi interfaces
Created mac80211_hwsim device with ID 0
Created mac80211_hwsim device with ID 1
Created mac80211_hwsim device with ID 2
rfkill unblock 117
*** sta1 : ('ip link set wlan0 down',)
RTNETLINK answers: Operation not permitted
*** sta1 : ('ip link set wlan0 name sta1-wlan0',)
RTNETLINK answers: Operation not permitted
rfkill unblock 118
*** sta2 : ('ip link set wlan1 down',)
RTNETLINK answers: Operation not permitted
*** sta2 : ('ip link set wlan1 name sta2-wlan0',)
RTNETLINK answers: Operation not permitted
*** ap1 : ('ip link set wlan2 down',)
*** ap1 : ('ip link set wlan2 name ap1-wlan1',)
*** ap1 : ('ip link set ap1-wlan1 up',)

added intf sta1-wlan0 (0) to node sta1
*** sta1 : ('ip link set', 'sta1-wlan0', 'down')
Cannot find device "sta1-wlan0"
*** sta1 : ('ip link set', 'sta1-wlan0', 'address', '00:02:00:00:00:01')
Cannot find device "sta1-wlan0"
*** sta1 : ('ip link set', 'sta1-wlan0', 'up')
Cannot find device "sta1-wlan0"
*** sta1 : ('ip addr flush ', 'sta1-wlan0')
Device "sta1-wlan0" does not exist.
*** sta1 : ('ip addr add 10.0.0.1/8 brd + dev sta1-wlan0 && ip -6 addr add 2001:0:0:0:0:0:0:1/64 dev sta1-wlan0',)
Cannot find device "sta1-wlan0"
*** sta1 : ('ip -6 addr flush ', 'sta1-wlan0')
Device "sta1-wlan0" does not exist.
*** sta1 : ('ip -6 addr add', '2001:0:0:0:0:0:0:1/64', 'dev', 'sta1-wlan0')
Cannot find device "sta1-wlan0"
*** sta1 : ('ip link set lo up',)
RTNETLINK answers: Operation not permitted

I've check my running container has NET_ADMIN capability

            "CapAdd": [
                "net_admin",
                "net_raw",
                "sys_admin"
            ],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant