Lorsque je tente d'accéder du PC aux VMs (locales) par ssh
ou http (via un navigateur pour afficher les sites hébergés sur VM)
10.0.0.2 (adresse de l'interface virtuelle vboxnet0 ) est redirigé sur le localhost du PC
Avant, cela fonctionnait parfaitement,
enfin je crois (je ne suis plus sûr de rien :(( )
J'ai pensé que c'était suite au passage de testing au noyau 5.3
je suis donc revenu à 5.2 via le menu de GRUB ; j'ai du réinstaller virtualbox-dkms
mais cela n'a rien arrangé.
Voilà, je ne comprends pas pourquoi cette "redirection".
Autre fait qui me laisse dubitatif :
Après : $ sudo ifconfig vboxnet0 down
$ lynx 10.0.0.2
continue à afficher index.html du serveur local du PC
ÉDITÉ : Un exposé clair de "Comment créer un Réseau local virtuel" est placé en 2ème postage
Pour documenter la situation :
Côté PC (Hôte)
Code : Tout sélectionner
$ uname -r
5.3.0-2-amd64
Code : Tout sélectionner
$ dpkg-query -l | grep virtualbox
ii virtualbox 6.0.14-dfsg-3 amd64 x86 virtualization solution - base binaries
ii virtualbox-dkms 6.0.14-dfsg-3 all x86 virtualization solution - kernel module sources for dkms
ii virtualbox-ext-pack 6.0.14-1 all extra capabilities for VirtualBox, downloader.
ii virtualbox-guest-additions-iso 6.0.10-1 all guest additions iso image for VirtualBox
ii virtualbox-guest-dkms 6.0.14-dfsg-3 all x86 virtualization solution - guest addition module source for dkms
ii virtualbox-guest-utils 6.0.14-dfsg-3 amd64 x86 virtualization solution - non-X11 guest utilities
ii virtualbox-guest-x11 6.0.14-dfsg-3 amd64 x86 virtualization solution - X11 guest utilities
ii virtualbox-qt 6.0.14-dfsg-3 amd64 x86 virtualization solution - Qt based user interface
Code : Tout sélectionner
$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 nuc6
127.0.1.1 fluxbb.local
# VM de VirtualBox
# Utiliser 10.0.0.2 pour tous les domaines sur debwebserv1
10.0.0.2 debwebserv1.virt debwebserv1
#10.0.0.2 forum1.virt
# Utiliser 10.0.0.3 pour tous les domaines sur debwebserv2
#10.0.0.3 debwebserv2.virt debwebserv2
192.168.1.1 livebox.dezorg livebox
192.168.1.10 nuc6.dezorg nuc6
192.168.1.11 dc7800.dezorg dc7800
192.168.1.12 one-dezix.dezorg one-dezix
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Au démarrage du PC (Virtualbox n'est pas lancé)
Code : Tout sélectionner
$ sudo ifconfig
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 2a01:cb00:8a54:8c00:25c0:c827:fb5f:f5e7 prefixlen 64 scopeid 0x0<global>
inet6 fe80::96c6:91ff:fea9:d1c6 prefixlen 64 scopeid 0x20<link>
inet6 2a01:cb00:8a54:8c00:96c6:91ff:fea9:d1c6 prefixlen 64 scopeid 0x0<global>
ether 94:c6:91:a9:d1:c6 txqueuelen 1000 (Ethernet)
RX packets 331 bytes 123036 (120.1 KiB)
RX errors 0 dropped 20 overruns 0 frame 0
TX packets 408 bytes 185438 (181.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Boucle locale)
RX packets 4 bytes 156 (156.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4 bytes 156 (156.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
$ sudo ifconfig -a
affiche en plus l'interface sans fil (inutilisée) : wlp2s0
À ce stade (virtualbox non-démarré),
$ lynx 10.0.0.2
et
$ ssh 10.0.0.2
ne parviennent pas à se connecter (c'est normal)
Après avoir lancé VirtualBox (GUI)
Code : Tout sélectionner
$ sudo ifconfig
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 2a01:cb00:8a54:8c00:25c0:c827:fb5f:f5e7 prefixlen 64 scopeid 0x0<global>
inet6 fe80::96c6:91ff:fea9:d1c6 prefixlen 64 scopeid 0x20<link>
inet6 2a01:cb00:8a54:8c00:96c6:91ff:fea9:d1c6 prefixlen 64 scopeid 0x0<global>
ether 94:c6:91:a9:d1:c6 txqueuelen 1000 (Ethernet)
RX packets 647 bytes 164864 (161.0 KiB)
RX errors 0 dropped 76 overruns 0 frame 0
TX packets 755 bytes 262917 (256.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Boucle locale)
RX packets 4 bytes 156 (156.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4 bytes 156 (156.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Code : Tout sélectionner
$ sudo ifconfig -a
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 2a01:cb00:8a54:8c00:25c0:c827:fb5f:f5e7 prefixlen 64 scopeid 0x0<global>
inet6 fe80::96c6:91ff:fea9:d1c6 prefixlen 64 scopeid 0x20<link>
inet6 2a01:cb00:8a54:8c00:96c6:91ff:fea9:d1c6 prefixlen 64 scopeid 0x0<global>
ether 94:c6:91:a9:d1:c6 txqueuelen 1000 (Ethernet)
RX packets 661 bytes 166272 (162.3 KiB)
RX errors 0 dropped 78 overruns 0 frame 0
TX packets 771 bytes 267540 (261.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Boucle locale)
RX packets 4 bytes 156 (156.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4 bytes 156 (156.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vboxnet0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 0a:00:27:00:00:00 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp2s0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 96:ea:e6:23:3c:a2 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
$ lynx 10.0.0.2
et
$ ssh 10.0.0.2
ne parviennent toujours pas à se connecter.
VM = DebWebServ1
Debian stable
Code : Tout sélectionner
toto@debwebserv1:~$ uname -r
4.19.0-6-amd64
* interface1 => Extérieur (Internet)
* interface2 => Réseau virtuel VMs & PC hôte
Après démarrage de la VM : DebWebServ1
Le PC redirige 10.0.0.2 sur son localhost
HTTP
$ lynx 10.0.0.2
affiche : index.html
du serveur local du PC
et
SSH
Code : Tout sélectionner
$ ssh 10.0.0.2
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:omTC/ltQ+LlOG7NwB5UundpzMOY4e/C8PQwW5NC3dUk.
Please contact your system administrator.
Add correct host key in /home/dezix/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/dezix/.ssh/known_hosts:6
remove with:
ssh-keygen -f "/home/dezix/.ssh/known_hosts" -R "10.0.0.2"
ECDSA host key for 10.0.0.2 has changed and you have requested strict checking.
Host key verification failed.
ssh-keygen -f "/home/dezix/.ssh/known_hosts" -R "10.0.0.2"
on parvient même à se connecter (en boucle) sur le compte utilisateur du PC avec : ssh dezix@10.0.0.2
On a à présent :
Code : Tout sélectionner
$ sudo ifconfig
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::96c6:91ff:fea9:d1c6 prefixlen 64 scopeid 0x20<link>
inet6 2a01:cb00:8a54:8c00:96c6:91ff:fea9:d1c6 prefixlen 64 scopeid 0x0<global>
inet6 2a01:cb00:8a54:8c00:71d6:d15e:8d7e:2062 prefixlen 64 scopeid 0x0<global>
ether 94:c6:91:a9:d1:c6 txqueuelen 1000 (Ethernet)
RX packets 408 bytes 131990 (128.8 KiB)
RX errors 0 dropped 38 overruns 0 frame 0
TX packets 512 bytes 215772 (210.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Boucle locale)
RX packets 44 bytes 12971 (12.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 44 bytes 12971 (12.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vboxnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.2 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::800:27ff:fe00:0 prefixlen 64 scopeid 0x20<link>
ether 0a:00:27:00:00:00 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 92 bytes 11763 (11.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
vboxnet0: inet 10.0.0.2
qui reste identique après arrêt de la VM et [Ctrl+Q] sur la GUI de VBox
Côté VM
Code : Tout sélectionner
toto@debwebserv1:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 debwebserv1.virt debwebserv1
# Others VM vbox
10.0.2.4 deb9lxde.virt deb9lxde
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Code : Tout sélectionner
toto@debwebserv1:~$ sudo ifconfig
[sudo] Mot de passe de toto :
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.6 netmask 255.255.255.0 broadcast 10.0.2.255
inet6 fe80::a00:27ff:fefa:7813 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:fa:78:13 txqueuelen 1000 (Ethernet)
RX packets 27 bytes 7882 (7.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 60 bytes 7762 (7.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.2 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::a00:27ff:fe39:e259 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:39:e2:59 txqueuelen 1000 (Ethernet)
RX packets 72 bytes 13104 (12.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 38 bytes 4722 (4.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 base 0xd240
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Boucle locale)
RX packets 40 bytes 13526 (13.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 40 bytes 13526 (13.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
toto@debwebserv1:~$ sudo ifconfig -a
renvoie la même chose.
Les commandes suivantes :
toto@debwebserv1:~$ lynx 10.0.0.2
toto@debwebserv1:~$ lynx localhost
toto@debwebserv1:~$ lynx http://debwebserv1.virt
fonctionnent parfaitement en affichant : index.html du serveur local de la VM.
et
toto@debwebserv1:~$ lynx 192.168.1.10
Affiche : index.html
du serveur local du PC.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Merci d'avance pour vos avis.