File tree Expand file tree Collapse file tree 2 files changed +20
-6
lines changed
Expand file tree Collapse file tree 2 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,8 @@ icon: material/link-box
1616
1717!!! question "桥不就是一个交换机吗?"
1818
19- 是的,尽管「桥接」指的是将网口加入到一个虚拟交换机中,但在 Linux 中,桥接接口(bridge interface)除了这个虚拟交换机之外,也包含了一根由本机接入该交换机的虚拟接口 。
20- 因此 bridge interface 上可以配置 IP 地址,本机也可以通过该接口进行通信 。
19+ 是的,尽管「桥接」指的是将网口加入到一个虚拟交换机中,但在 Linux 中,桥接接口(bridge interface)除了这个虚拟交换机之外,也包含了一个由本机接入该交换机的虚拟接口 。
20+ 因此 bridge interface 上可以配置 IP 地址,本机也可以通过桥接接口进行通信 。
2121
2222!!! question "为什么 IP 地址要配置在桥接接口上,而不是被桥接的网口上?"
2323
@@ -27,15 +27,29 @@ icon: material/link-box
2727 在处理完接收的数据包后,`br_handle_frame` 会返回 `RX_HANDLER_CONSUMED`,表示该数据包已经被 bridge 处理完毕,不再在网口本身的协议栈中继续处理。
2828 因此,即使你再在网口上配置 IP 地址等信息,这些信息也不会被使用到。
2929
30- 类似地,由于每个网口的 `rx_handler` 是唯一的,因此在网口被加入桥接后,就无法再注册其他的 `rx_handler` 回调函数了,例如加入另一个桥或引申出 MACVLAN 接口等。
31- 此处唯一的例外是 802.1Q VLAN 接口,因为 VLAN 子接口并不通过 `rx_handler` 机制实现。
32-
3330 [ br_handle_frame ] : https://elixir.bootlin.com/linux/v6.17.8/source/net/bridge/br_input.c#L331
3431
32+ !!! question "思考题"
33+
34+ 1. 一个网络接口可以同时被加入多个桥接吗?
35+ 2. 一个网络接口可以在被加入桥接的同时扩展出 MACVLAN 子接口吗?
36+ 3. 一个网络接口可以在被加入桥接的同时扩展出 802.1Q VLAN 子接口吗?
37+
38+
3539### Veth 对 {#veth-pair}
3640
3741## 网卡聚合 {#bonding}
3842
3943## MACVLAN 与 IPVLAN {#macvlan-ipvlan}
4044
4145## VRF {#vrf}
46+
47+ ## 参考资料 {#references}
48+
49+ ??? info "思考题参考解答"
50+
51+ 「桥接」小节的思考题:1 和 2 的答案是否定的,而 3 的答案是肯定的。
52+ 由于每个网口的 `rx_handler` 是唯一的,因此在被加入桥接后,就无法再注册其他的 `rx_handler` 回调函数了,例如加入另一个桥或引申出 MACVLAN 子接口等。
53+ 然而,802.1Q VLAN 子接口并不通过 `rx_handler` 机制实现,而是在 `rx_handler` 前另有[专门的处理阶段][vlan_do_receive],因而可以与桥接等 `rx_handler` 机制共存。
54+
55+ [ vlan_do_receive ] : https://elixir.bootlin.com/linux/v6.17.8/source/net/core/dev.c#L5916
Original file line number Diff line number Diff line change @@ -556,7 +556,7 @@ fio 输出内容比较丰富,除了带宽 BW 外,还可以关注 IOPS、提
556556# <file system> <mount point> <type> <options> <dump> <pass>
557557UUID=6cf8f654-9a14-4703-be4e-c5a059c9f7f8 / ext4 errors=remount-ro 0 1
558558/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
559- sharing /mnt/sharing virtiofs defaults,nofail 0 0
559+ sharing /mnt/sharing virtiofs defaults,nofail 0 0
560560```
561561
562562可以看到第一部分定位了文件系统的位置。对于物理磁盘来说,使用 UUID 是比较好的选择,详情可参考[ 分区与文件系统] ( filesystem.md ) 中对 ` /dev/disk ` 的介绍。` /dev/sda1 ` 这样的设备名虽然也可以使用,但是可能会出现意料之外的问题。
You can’t perform that action at this time.
0 commit comments