python3 -m http.server запустите на S‑узлах HTTP‑серверы.
[root@S1 ~]# python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
[root@S2 ~]# python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
wget и ssh:
wget будет выполняться HTTP‑запрос; скачивание файла означает доступ к устройству, зависание — отсутствие доступа;
ssh осуществляется подключение к устройству; подключение означает доступ к устройству, зависание — отсутствие доступа.
Примечание
ssh‑подключении может появиться запрос на разрешение подключения. Необходимо явно написать yes в ответ на вопрос в терминал.
wget <dstIP>:<dstPort> и ssh <dstIP> на R1 и R3 проверьте доступность сервисов S‑абонентов.
[root@R1 ~]# wget 10.0.4.254:8000
Prepended http:// to '10.0.4.254:8000'
--2025-10-06 19:13:42-- http://10.0.4.254:8000/
Connecting to 10.0.4.254:8000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1142 (1.1K) [text/html]
Saving to: 'index.html.1'
index.html.1 100%[====================================>] 1.12K --.-KB/s in 0s
2025-10-06 19:13:42 (54.2 MB/s) - 'index.html.1' saved [1142/1142]
[root@R1 ~]#
[root@R1 ~]# wget 10.0.6.254:8000
Prepended http:// to '10.0.6.254:8000'
--2025-10-06 19:13:57-- http://10.0.6.254:8000/
Connecting to 10.0.6.254:8000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1087 (1.1K) [text/html]
Saving to: 'index.html.2'
index.html.2 100%[====================================>] 1.06K --.-KB/s in 0s
2025-10-06 19:13:57 (33.8 MB/s) - 'index.html.2' saved [1087/1087]
[root@R1 ~]#
[root@R1 ~]# ssh 10.0.4.254
Last login: Mon Oct 6 13:42:04 2025 from 10.0.13.1
[root@S1 ~]#
<^D>logout
Connection to 10.0.4.254 closed.
[root@R1 ~]#
[root@R1 ~]# ssh 10.0.6.254
The authenticity of host '10.0.6.254 (10.0.6.254)' can't be established.
ED25519 key fingerprint is SHA256:BxaYoHAW5ddfM6EwmgSAZ2tKXCH0zoppLfEcQ8YiGdg.
This host key is known by the following other names/addresses:
~/.ssh/known_hosts:3: 10.0.4.254
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.0.6.254' (ED25519) to the list of known hosts.
Last login: Mon Oct 6 18:58:46 2025 from 10.0.13.3
[root@S2 ~]#
<^D>logout
Connection to 10.0.6.254 closed.
[root@R1 ~]#
[root@R3 ~]# wget 10.0.4.254:8000
Prepended http:// to '10.0.4.254:8000'
--2025-10-06 19:13:45-- http://10.0.4.254:8000/
Connecting to 10.0.4.254:8000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1142 (1.1K) [text/html]
Saving to: 'index.html'
index.html 100%[====================================>] 1.12K --.-KB/s in 0s
2025-10-06 19:13:45 (66.8 MB/s) - 'index.html' saved [1142/1142]
[root@R3 ~]#
[root@R3 ~]# wget 10.0.6.254:8000
Prepended http:// to '10.0.6.254:8000'
--2025-10-06 19:13:54-- http://10.0.6.254:8000/
Connecting to 10.0.6.254:8000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1087 (1.1K) [text/html]
Saving to: 'index.html.1'
index.html.1 100%[====================================>] 1.06K --.-KB/s in 0s
2025-10-06 19:13:54 (31.1 MB/s) - 'index.html.1' saved [1087/1087]
[root@R3 ~]#
[root@R3 ~]# ssh 10.0.4.254
The authenticity of host '10.0.4.254 (10.0.4.254)' can't be established.
ED25519 key fingerprint is SHA256:BxaYoHAW5ddfM6EwmgSAZ2tKXCH0zoppLfEcQ8YiGdg.
This host key is known by the following other names/addresses:
~/.ssh/known_hosts:3: 10.0.6.254
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '10.0.4.254' (ED25519) to the list of known hosts.
Last login: Mon Oct 6 19:14:00 2025 from 10.0.13.1
[root@S1 ~]#
<^D>logout
Connection to 10.0.4.254 closed.
[root@R3 ~]#
[root@R3 ~]# ssh 10.0.6.254
Last login: Mon Oct 6 19:14:08 2025 from 10.0.13.1
[root@S2 ~]#
<^D>logout
Connection to 10.0.6.254 closed.
[root@R3 ~]#
[root@S1 ~]# python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
10.0.13.1 - - [06/Oct/2025 19:13:35] "GET / HTTP/1.1" 200 -
10.0.13.3 - - [06/Oct/2025 19:13:45] "GET / HTTP/1.1" 200 -
[root@S2 ~]# python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
10.0.13.1 - - [06/Oct/2025 19:13:50] "GET / HTTP/1.1" 200 -
10.0.13.3 - - [06/Oct/2025 19:13:54] "GET / HTTP/1.1" 200 -
wget);
ssh);
ip rule выведите текущий список контроля доступа.
[root@R2 ~]# ip rule
0: from all lookup local
32766: from all lookup main
32767: from all lookup default
[root@R2 ~]#
priority имеют приоритет над полями с большим значением. Принцип выбора срабатывания правил — сверху вниз до первого совпадения параметров.
ip rule add <*ip-rule-parameters> опишите следующие правила списка контроля доступа:
[root@R2 ~]# ip rule add from 10.0.13.1 to 10.0.4.254 dport 8000 priority 1 table main[root@R2 ~]# ip rule add blackhole from 10.0.13.1 to 10.0.4.254 priority 2[root@R2 ~]# ip rule add blackhole from 10.0.13.1 to 10.0.6.254 priority 2[root@R2 ~]# ip rule add from 10.0.13.3 to 10.0.6.254 dport 22 priority 1 table main[root@R2 ~]# ip rule add blackhole from 10.0.13.3 to 10.0.6.254 priority 2[root@R2 ~]# ip rule add blackhole from 10.0.13.3 to 10.0.4.254 priority 2[root@R2 ~]#
ip rule выведите текущий список контроля доступа.
[root@R2 ~]# ip rule
0: from all lookup local
1: from 10.0.13.1 to 10.0.4.254 dport 8000 lookup main
1: from 10.0.13.3 to 10.0.6.254 dport 22 lookup main
2: from 10.0.13.1 to 10.0.4.254 blackhole
2: from 10.0.13.1 to 10.0.6.254 blackhole
2: from 10.0.13.3 to 10.0.6.254 blackhole
2: from 10.0.13.3 to 10.0.4.254 blackhole
32766: from all lookup main
32767: from all lookup default
[root@R2 ~]#
[root@R1 ~]# ping -c3 10.0.13.2PING 10.0.13.2 (10.0.13.2) 56(84) bytes of data. 64 bytes from 10.0.13.2: icmp_seq=1 ttl=64 time=0.539 ms 64 bytes from 10.0.13.2: icmp_seq=2 ttl=64 time=0.596 ms 64 bytes from 10.0.13.2: icmp_seq=3 ttl=64 time=0.435 ms --- 10.0.13.2 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2079ms rtt min/avg/max/mdev = 0.435/0.523/0.596/0.066 ms[root@R1 ~]# ping -c3 10.0.4.254PING 10.0.4.254 (10.0.4.254) 56(84) bytes of data. --- 10.0.4.254 ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 2033ms[root@R1 ~]# ping -c3 10.0.6.254PING 10.0.6.254 (10.0.6.254) 56(84) bytes of data. --- 10.0.6.254 ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 2046ms [root@R1 ~]#
[root@R3 ~]# ping -c3 10.0.13.2PING 10.0.13.2 (10.0.13.2) 56(84) bytes of data. 64 bytes from 10.0.13.2: icmp_seq=1 ttl=64 time=0.452 ms 64 bytes from 10.0.13.2: icmp_seq=2 ttl=64 time=0.569 ms 64 bytes from 10.0.13.2: icmp_seq=3 ttl=64 time=0.435 ms --- 10.0.13.2 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2081ms rtt min/avg/max/mdev = 0.435/0.485/0.569/0.059 ms[root@R3 ~]# ping -c3 10.0.4.254PING 10.0.4.254 (10.0.4.254) 56(84) bytes of data. --- 10.0.4.254 ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 2051ms[root@R3 ~]# ping -c3 10.0.6.254PING 10.0.6.254 (10.0.6.254) 56(84) bytes of data. --- 10.0.6.254 ping statistics --- 3 packets transmitted, 0 received, 100% packet loss, time 2063ms [root@R3 ~]#
wget <dstIP>:<dstPort> и ssh <dstIP> на R1 и R3 проверьте доступность разрешённых сервисов S‑абонентов и запрет остальных.
[root@R1 ~]# wget -t=1 10.0.4.254:8000Prepended http:// to '10.0.4.254:8000' --2025-10-06 19:24:48-- http://10.0.4.254:8000/ Connecting to 10.0.4.254:8000... connected. HTTP request sent, awaiting response... 200 OK Length: 1142 (1.1K) [text/html] Saving to: 'index.html' index.html 100%[====================================>] 1.12K --.-KB/s in 0s 2025-10-06 19:24:48 (72.1 MB/s) - 'index.html' saved [1142/1142][root@R1 ~]# wget -t=1 10.0.6.254:8000Prepended http:// to '10.0.6.254:8000' --2025-10-06 19:24:53-- http://10.0.6.254:8000/ Connecting to 10.0.6.254:8000...^C[root@R1 ~]# ssh 10.0.4.254^C[root@R1 ~]# ssh 10.0.6.254^C [root@R1 ~]#
[root@R3 ~]# wget -t=1 10.0.4.254:8000Prepended http:// to '10.0.4.254:8000' --2025-10-06 19:26:32-- http://10.0.4.254:8000/ Connecting to 10.0.4.254:8000...^C[root@R3 ~]# wget -t=1 10.0.6.254:8000Prepended http:// to '10.0.6.254:8000' --2025-10-06 19:26:38-- http://10.0.6.254:8000/ Connecting to 10.0.6.254:8000...^C[root@R3 ~]# ssh 10.0.4.254^C[root@R3 ~]# ssh 10.0.6.254Last login: Mon Oct 6 19:14:31 2025 from 10.0.13.3 [root@S2 ~]# <^D>logout Connection to 10.0.6.254 closed. [root@R3 ~]#