Skip to contentSkip to conversation

Bug in netlink monitor

DISCUSSION George Shuklin 2 participants 4 messages Oct 25, 2022 – Oct 26, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I found that if veth interface is created in a namespace using netns option for ip, no events are logged in ip monitor all-nsid.

Steps to reproduce:

(console1)

ip monitor all-nsid

(console 2)

ip net add foobar

ip link add netns foobar type veth

Expected results:

Output in ip monitor. Actual result: no output, (but there are two new veth interaces in foobar namespace).

Additional observation: namespace 'foobar' does not have id in output of ip net:

# ip net
foobar
test (id: 0)
test2 (id: 1)
#1 lore raw

Le 25/10/2022 à 13:18, George Shuklin a écrit :

Quoted 18 lines

I found that if veth interface is created in a namespace using netns option for ip, no events are logged in ip monitor all-nsid.

Steps to reproduce:

(console1)

ip monitor all-nsid

(console 2)

ip net add foobar

ip link add netns foobar type veth

Quoted 6 lines

Expected results:

Output in ip monitor. Actual result: no output, (but there are two new veth interaces in foobar namespace).

Additional observation: namespace 'foobar' does not have id in output of ip net:

This is why.
https://man7.org/linux/man-pages/man8/ip-monitor.8.html

" If the all-nsid option is set, the program listens to all network
namespaces that have a nsid assigned into the network namespace were the program is running"

You can assign one with:
ip netns set foobar auto

Regards,
Nicolas

Quoted 6 lines
# ip net
foobar
test (id: 0)
test2 (id: 1)
#2 lore raw
Quoted 28 lines · Nicolas Dichtel

Le 25/10/2022 à 13:18, George Shuklin a écrit :

Quoted 18 lines

I found that if veth interface is created in a namespace using netns option for ip, no events are logged in ip monitor all-nsid.

Steps to reproduce:

(console1)

ip monitor all-nsid

(console 2)

ip net add foobar

ip link add netns foobar type veth

Quoted 6 lines

Expected results:

Output in ip monitor. Actual result: no output, (but there are two new veth interaces in foobar namespace).

Additional observation: namespace 'foobar' does not have id in output of ip net:

This is why.
https://man7.org/linux/man-pages/man8/ip-monitor.8.html

Quoted 7 lines

" If the all-nsid option is set, the program listens to all network
namespaces that have a nsid assigned into the network namespace were the program is running"

You can assign one with:
ip netns set foobar auto

Oh, I missed that.

But I think it's making things a bit odd, because there are network events in the system which are not visible in ip monitor (no matter what options are set).

Are there a way to see _all_ network events?

#3 lore raw

Le 26/10/2022 à 14:41, George Shuklin a écrit :

Quoted 34 lines · Nicolas Dichtel
Quoted 33 lines

Le 25/10/2022 à 13:18, George Shuklin a écrit :

Quoted 18 lines

I found that if veth interface is created in a namespace using netns option for ip, no events are logged in ip monitor all-nsid.

Steps to reproduce:

(console1)

ip monitor all-nsid

(console 2)

ip net add foobar

ip link add netns foobar type veth

Quoted 7 lines

Expected results:

Output in ip monitor. Actual result: no output, (but there are two new veth interaces in foobar namespace).

Additional observation: namespace 'foobar' does not have id in output of ip net:

This is why.
https://man7.org/linux/man-pages/man8/ip-monitor.8.html

"       If the all-nsid option is set, the program listens to all network namespaces that have a nsid assigned into the network namespace were the program is running"

Quoted 7 lines
Quoted 3 lines

You can assign one with:
ip netns set foobar auto

Oh, I missed that.

But I think it's making things a bit odd, because there are network events in the system which are not visible in ip monitor (no matter what options are set).

It's not visible, because this netns is not visible.

Quoted 2 lines

Are there a way to see _all_ network events?

No. Remember that network namespace are used for isolation. There are a lot of scenarii where you don't have to know what happen in another netns, even not that another netns exists ;-)