Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
isno committed Feb 11, 2025
1 parent 9734a1c commit 32483cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions network/linux-bridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ Linux Bridge 作为虚拟交换机,其功能与物理交换机类似。将多
图 3-15 veth 网卡与 Linux Bridge
:::

1. 首先,创建一个 Linux Bridge 设备。如下命令,会创建一个名为 br0 的虚拟交换机,并将其激活。
1. 首先,创建一个 Linux Bridge 设备。如下命令所示,创建一个名为 br0 的虚拟交换机,并将其激活。

```bash
$ ip link add name br0 type bridge
$ ip link set br0 up
```

2. 接着,创建一对 Veth 设备,并将它们分别分配给两个命名空间。命令如下。
2. 接着,创建一对 Veth 设备,并将它们分别分配给两个命名空间。

```bash
# 创建 veth1 和 veth2
Expand Down
2 changes: 1 addition & 1 deletion network/network-namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Chain OUTPUT (policy ACCEPT)
target prot opt source destination
```

不难看出,不同的网络命名空间默认相互隔离,也无法直接通信。如果它们需要与外界(包括其他网络命名空间或宿主机)建立连接,该如何实现呢?
不难看出,不同的网络命名空间默认相互隔离,也无法直接通信。如果它们需要与外界(其他网络命名空间或宿主机)建立连接,该如何实现呢?

我们先看看物理机是怎么操作的,一台物理机如果要想与外界进行通信,那得插入一块网卡,通过网线连接到以太网交换机,加入一个局域网内。被隔离的网络命名空间如果想与外界进行通信,就需要利用到稍后介绍的各类虚拟网络设备。也就是,在网络命名空间里面插入“虚拟网卡”,然后把“网线”的另一头桥接到“虚拟交换机”中。

Expand Down
2 changes: 1 addition & 1 deletion network/virtual-nic.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $ ip link set veth1 netns ns1
$ ip link set veth2 netns ns2
```

Veth 作为虚拟网络设备,具备与物理网卡相同的特性,因此可以配置 IP 和 MAC 地址。接下来,我们为 Veth 设备分配 IP 地址,使其处于同一子网 172.16.0.0/24,并同时激活设备
Veth 作为虚拟网络设备,具备与物理网卡相同的特性,因此可以配置 IP 和 MAC 地址。接下来,我们为 Veth 设备分配 IP 地址,使其处于同一子网 172.16.0.0/24,然后激活设备

```bash
# 配置命名空间1
Expand Down

0 comments on commit 32483cf

Please sign in to comment.