如何获得有关桥梁的完整信息?

如何获得有关桥梁的完整信息?

我的笔记本电脑上有很多网桥,Ubuntu 22.04

ip link show type bridge

节目

3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:53:00:0a:c6:8d brd ff:ff:ff:ff:ff:ff
3: mpqemubr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:53:00:83:b8:32 brd ff:ff:ff:ff:ff:ff
5: br-9910826e1e83: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default 
    link/ether 02:32:22:ee:e6:a7 brd ff:ff:ff:ff:ff:ff
6: br-9ceb855c322b: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default 
    link/ether 02:32:58:1c:77:17 brd ff:ff:ff:ff:ff:ff
7: br-f6d0af00ea88: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default 

我试过

ip link xstats type bridge
virbr0          
                    IGMP queries:
                      RX: v1 0 v2 0 v3 0
                      TX: v1 0 v2 0 v3 0
                    IGMP reports:
                      RX: v1 0 v2 0 v3 0
                      TX: v1 0 v2 0 v3 0
                    IGMP leaves: RX: 0 TX: 0
                    IGMP parse errors: 0
                    MLD queries:
                      RX: v1 0 v2 0
                      TX: v1 0 v2 0
                    MLD reports:
                      RX: v1 0 v2 0
                      TX: v1 0 v2 0
                    MLD leaves: RX: 0 TX: 0
                    MLD parse errors: 0

我不明白输出。如何获取有关接口的信息以及如何创建桥接器?

答案1

如何获取有关接口的信息以及如何创建桥接器?

您无法获取有关“桥是如何创建的”的信息(也就是说,除了识别某些命名约定之外,没有办法判断桥是否是由 libvirt、docker、netplan、手动命令等创建的)。

您可以使用该命令获取附加到网桥的链接列表ip。显示所有桥接链接:

$ ip link show type bridge_slave

要显示与特定桥关联的链接:

$ ip link show type bridge_slave master virbr0

您可以使用-d( -details) 选项获取有关桥接器(或其他接口)的更多信息;比较:

$ ip link show virbr0
49: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:c5:a4:f7 brd ff:ff:ff:ff:ff:ff

和:

$ ip -d link show virbr0
49: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:c5:a4:f7 brd ff:ff:ff:ff:ff:ff promiscuity 0  allmulti
    0 minmtu 68 maxmtu 65535 bridge forward_delay 200 hello_time 200 max_age
    2000 ageing_time 30000 stp_state 1 priority 32768 vlan_filtering 0
    vlan_protocol 802.1Q bridge_id 8000.52:54:0:c5:a4:f7 designated_root
    8000.52:54:0:c5:a4:f7 root_port 0 root_path_cost 0 topology_change 0
    topology_change_detected 0 hello_timer    0.87 tcn_timer    0.00
    topology_change_timer    0.00 gc_timer  268.85 vlan_default_pvid 1
    vlan_stats_enabled 0 vlan_stats_per_port 0 group_fwd_mask 0 group_address
    01:80:c2:00:00:00 mcast_snooping 1 no_linklocal_learn 0 mcast_vlan_snooping
    0 mcast_router 1 mcast_query_use_ifaddr 0 mcast_querier 0
    mcast_hash_elasticity 16 mcast_hash_max 4096 mcast_last_member_count 2
    mcast_startup_query_count 2 mcast_last_member_interval 100
    mcast_membership_interval 26000 mcast_querier_interval 25500
    mcast_query_interval 12500 mcast_query_response_interval 1000
    mcast_startup_query_interval 3125 mcast_stats_enabled 0 mcast_igmp_version
    2 mcast_mld_version 1 nf_call_iptables 0 nf_call_ip6tables 0
    nf_call_arptables 0 addrgenmode eui64 numtxqueues 1 numrxqueues 1
    gso_max_size 65536 gso_max_segs 65535 tso_max_size 65536 tso_max_segs 65535
    gro_max_size 65536 

相关内容