我知道可以使用brctl setfd
,但建议我不要使用 brctl 并使用 iproute2 或 ip 代替(因为 brctl 已弃用:https://lwn.net/Articles/435845/)。如果这个建议是合理的,我如何使用 ip/iproute2 将网桥的转发延迟设置为零?
答案1
使用iproute2:
# ip link add br0 typebridge # 这里也可以指定forward_delay 0 # ip link set br0类型网桥forward_delay 0 # ip -d 链接 sh br0 4: br0: mtu 1500 qdisc noop 状态 DOWN 模式 DEFAULT 组默认 qlen 1000 链接/以太 7a:21:f1:b3:08:8d brd ff:ff:ff:ff:ff:ff 混杂 0 桥转发延迟 0 hello_time 199 max_age 1999 老化时间 29999 stp_state 0 优先级 32768 vlan_filtering 0 vlan_protocol 802.1Qbridge_id 8000.0:0:0:0:0:0 指定根 8000.0:0:0:0:0:0 根端口 0 根路径成本 0 拓扑更改 0检测到的拓扑变化 0 hello_timer 0.00 tcn_timer 0.00 topology_change_timer 0.00 gc_timer 0.00 vlan_default_pvid 1 vlan_stats_enabled 0 group_fwd_mask 0 group_address 01:80:c2:00:00:00 mcast_snooping 1 mcast_router 1 mcast_query_use_ifaddr 0 mcast_querier 0 mcast_hash_elasticity 4 mcast_hash_max 512 mcast_last_member_count 2 mcast_startup_query_count 2 mcast_last_member_interval 99 mcast_membership_interval 25999 mcast_querier_interval 25499 mcast_query_interval 12499 mcast_query_response_interval 999 mcast_startup_query_interval 3124 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 6第5536章 65535
# ip 链接帮助桥接 用法:...桥[ fdb_flush ] [ 转发延迟 转发延迟 ] [ 你好时间 HELLO_TIME ] [ 最大年龄 MAX_AGE ] [ 老化时间 AGEING_TIME ] [ stp_state STP_STATE ] [优先优先] [ group_fwd_mask 掩码 ] [ 组地址 地址 ] [ vlan_filtering VLAN_FILTERING ] [ vlan_protocol VLAN_PROTOCOL ] [ vlan_default_pvid VLAN_DEFAULT_PVID ] [ vlan_stats_enabled VLAN_STATS_ENABLED ] [ mcast_snooping MULTICAST_SNOOPING ] [ mcast_router 多播路由器 ] [ mcast_query_use_ifaddr MCAST_QUERY_USE_IFADDR ] [ mcast_querier MULTICAST_QUERIER ] [ mcast_hash_elasticity HASH_ELASTICITY ] [ mcast_hash_max HASH_MAX ] [ mcast_last_member_count LAST_MEMBER_COUNT ] [ mcast_startup_query_count STARTUP_QUERY_COUNT ] [ mcast_last_member_interval LAST_MEMBER_INTERVAL ] [ mcast_membership_interval MEMBERSHIP_INTERVAL ] [ mcast_querier_interval QUERIER_INTERVAL ] [ mcast_query_interval QUERY_INTERVAL ] [ mcast_query_response_interval QUERY_RESPONSE_INTERVAL ] [ mcast_startup_query_interval STARTUP_QUERY_INTERVAL ] [ mcast_stats_enabled MCAST_STATS_ENABLED ] [ mcast_igmp_version IGMP_VERSION ] [ mcast_mld_version MLD_VERSION ] [ nf_call_iptables NF_CALL_IPTABLES ] [ nf_call_ip6tables NF_CALL_IP6TABLES ] [ nf_call_arptables NF_CALL_ARPTABLES ]
还有一个sysfs
可以与之交互的界面:
# cat /sys/class/net/br0/bridge/forward_delay 0