SSH подключение через виртуальный интерфейс:
Код: Выделить всё
olej@R420:~/2022/own.BOOKs/BHV.kernel/examples/network/virt$ ssh olej@192.168.5.142
The authenticity of host '192.168.5.142 (192.168.5.142)' can't be established.
ECDSA key fingerprint is SHA256:GBQB/iRPDZ7NZbruurCU9KnmiyCYU+XweZxWAIKq3hg.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.5.142' (ECDSA) to the list of known hosts.
olej@192.168.5.142's password:
Linux raspberrypi 5.15.32-v7+ #1538 SMP Thu Mar 31 19:38:48 BST 2022 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Jun 20 09:54:16 2022 from 192.168.1.14
Код: Выделить всё
olej@raspberrypi:~ $ inxi -CSxxx
System: Host: raspberrypi Kernel: 5.15.32-v7+ armv7l bits: 32 compiler: gcc v: 10.2.1 Console: tty 1 DM: LightDM 1.26.0
Distro: Raspbian GNU/Linux 11 (bullseye)
CPU: Info: Quad Core model: ARMv7 v7l variant: cortex-a7 bits: 32 type: MCP arch: v7l rev: 5
features: Use -f option to see features bogomips: 0
Speed: 700 MHz min/max: 600/1000 MHz Core speeds (MHz): 1: 700 2: 700 3: 700 4: 700
Код: Выделить всё
olej@raspberrypi:~ $ who
olej tty1 2022-06-18 12:27
olej tty7 2022-06-18 12:27 (:0)
olej pts/0 2022-06-20 09:54 (192.168.1.14)
olej pts/1 2022-06-20 10:30 (192.168.5.240)
На сервере контролирую 192.168.5.142:22:
Код: Выделить всё
olej@R420:~$ netstat -n -4
Активные соединения с интернетом (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 192.168.1.14:49238 192.168.1.15:22 ESTABLISHED
tcp 0 0 192.168.5.240:60888 192.168.5.142:22 ESTABLISHED
tcp 0 0 192.168.1.14:33016 77.111.246.18:443 ESTABLISHED
tcp 0 0 192.168.1.14:52920 77.111.246.23:443 TIME_WAIT
tcp 0 0 192.168.1.14:52932 77.111.246.23:443 ESTABLISHED
tcp 0 0 192.168.1.14:45136 185.26.182.94:443 ESTABLISHED
tcp 0 0 192.168.1.14:52918 77.111.246.23:443 TIME_WAIT
tcp 0 0 192.168.1.14:55274 192.168.1.142:22 ESTABLISHED
tcp 0 0 192.168.1.14:52930 77.111.246.23:443 ESTABLISHED
Код: Выделить всё
olej@R420:~/2022/own.BOOKs/BHV.kernel/examples/network/net$ sudo ifconfig virt0
virt0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.5.240 netmask 255.255.255.0 broadcast 192.168.5.255
ether 90:b1:1c:54:3a:47 txqueuelen 1000 (Ethernet)
RX packets 885 bytes 101053 (101.0 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 247 bytes 26295 (26.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Код: Выделить всё
olej@raspberrypi:~ $ hostname
raspberrypi
olej@raspberrypi:~ $ exit
выход
Connection to 192.168.5.142 closed.