add scripts for Blatt01 and Notes

This commit is contained in:
2024-11-03 21:55:01 +01:00
parent c6e384433b
commit b9388e579e
4 changed files with 196 additions and 71 deletions

View File

@@ -1,12 +1,5 @@
## router table
| device | eth | ip |
| ------- | ---- | ----------- |
| PC1 | eth1 | 10.5.0.2/24 |
| PC2 | eth1 | 10.5.1.2/24 |
| router1 | eth1 | 10.5.0.1/24 |
| router2 | eth1 | 10.5.1.1/24 |
router -> router
```
@@ -163,7 +156,51 @@ listening on eth1, link-type EN10MB (Ethernet), snapshot length 262144 bytes
### 主要工具:`ip`
## A103
### router table
router1
```
ip route show
10.5.1.0/24 dev eth1 proto kernel scope link src 10.5.1.2
10.5.2.0/24 dev eth2 proto kernel scope link src 10.5.2.1
10.5.3.0/24 via 10.5.2.2 dev eth2
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.7
```
pc1
```
ip route
10.5.1.0/24 dev eth1 proto kernel scope link src 10.5.1.1
10.5.3.0/24 via 10.5.1.2 dev eth1
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.1
```
router2
```
ip route
10.5.1.0/24 via 10.5.2.1 dev eth2
10.5.2.0/24 dev eth2 proto kernel scope link src 10.5.2.2
10.5.3.0/24 dev eth1 proto kernel scope link src 10.5.3.2
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.12
```
pc2
```
root@pc2:~# ip route
10.5.1.0/24 via 10.5.3.2 dev eth1
10.5.3.0/24 dev eth1 proto kernel scope link src 10.5.3.1
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.3
```
## `ip`
**`ip`** 是 IPRoute2 工具集中最常用的命令,能够管理和配置 IP 地址、路由、链路等多种网络参数。与旧版的 `ifconfig``route` 命令相比,`ip` 更加灵活和强大。