I have some question about netns, that i dont understand.
I create the namespace
ip netns add test
then add the wireless interface
ip link set wlx18d6c713f8b1 netns test
when use iwconfig
root@localpc:~# ip netns exec test iwconfig
lo no wireless extensions.
wlx18d6c713f8b1 unassociated Nickname:"<WIFI@REALTEK>"
Mode:Managed Frequency=2.412 GHz Access Point: Not-Associated
Sensitivity:0/0
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality:0 Signal level:0 Noise level:0
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
it said i have one interface, BUT nmcli cant find in the namespace
root@localpc:~# ip netns exec test nmcli device
DEVICE TYPE STATE CONNECTION
enxd481d7246891 ethernet connected Wired connection 2
wlp2s0 wifi connected myap
enp0s31f6 ethernet unavailable --
lo loopback unmanaged --
so where is my setted wireless interface?
i need to connect to an AP within the namespace.
Otherwise, i have a project that i have to run a python program with ffplayer on a specified wireless interface, so i anybody have a good idea about this, i am gladly read it.
Thanks!
1 Answer
Nmcli communicates with Network Manager which is running in the initial network namespace.
You may need another instance of Network Manager and dbus, with some additional mount to keep them separate from the instances running in the initial network namespace. ip ns exec creates a new mount namespace for you.